mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge central to inbound
This commit is contained in:
commit
0675a1c1a6
@ -1,193 +1,201 @@
|
||||
<?xml version="1.0"?>
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist">
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1306529826000">
|
||||
<emItems>
|
||||
<emItem id="fdm_ffext@freedownloadmanager.org">
|
||||
<versionRange minVersion="1.0" maxVersion="1.3.1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem id="firefox@bandoo.com">
|
||||
<versionRange minVersion="5.0" maxVersion="5.0" severity="1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1pre" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem id="langpack-vi-VN@firefox.mozilla.org">
|
||||
<versionRange minVersion="2.0" maxVersion="2.0"/>
|
||||
</emItem>
|
||||
<emItem id="masterfiler@gmail.com">
|
||||
<versionRange severity="3"/>
|
||||
</emItem>
|
||||
<emItem id="mozilla_cc@internetdownloadmanager.com">
|
||||
<versionRange minVersion=" " maxVersion="6.9.8">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1pre" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
<versionRange minVersion="2.1" maxVersion="3.3">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem id="msntoolbar@msn.com">
|
||||
<versionRange minVersion=" " maxVersion="6.*"/>
|
||||
</emItem>
|
||||
<emItem id="personas@christopher.beard">
|
||||
<versionRange minVersion="1.6" maxVersion="1.6">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.6" maxVersion="3.6.*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem id="ShopperReports@ShopperReports.com">
|
||||
<versionRange minVersion="3.1.22.0" maxVersion="3.1.22.0"/>
|
||||
</emItem>
|
||||
<emItem id="support@daemon-tools.cc">
|
||||
<versionRange minVersion=" " maxVersion="1.0.0.5"/>
|
||||
</emItem>
|
||||
<emItem id="support@update-firefox.com"/>
|
||||
<emItem id="yslow@yahoo-inc.com">
|
||||
<versionRange minVersion="2.0.5" maxVersion="2.0.5">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.5.7" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem id="{2224e955-00e9-4613-a844-ce69fccaae91}"/>
|
||||
<emItem id="{27182e60-b5f3-411c-b545-b44205977502}">
|
||||
<versionRange minVersion="1.0" maxVersion="1.0"/>
|
||||
</emItem>
|
||||
<emItem id="{3252b9ae-c69a-4eaf-9502-dc9c1f6c009e}">
|
||||
<versionRange minVersion="2.2" maxVersion="2.2"/>
|
||||
</emItem>
|
||||
<emItem id="{3f963a5b-e555-4543-90e2-c3908898db71}">
|
||||
<versionRange minVersion=" " maxVersion="8.5"/>
|
||||
</emItem>
|
||||
<emItem id="{46551EC9-40F0-4e47-8E18-8E5CF550CFB8}">
|
||||
<versionRange minVersion="1.1b1" maxVersion="1.1b1"/>
|
||||
</emItem>
|
||||
<emItem id="{4B3803EA-5230-4DC3-A7FC-33638F3D3542}">
|
||||
<versionRange minVersion="1.2" maxVersion="1.2">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem id="{6E19037A-12E3-4295-8915-ED48BC341614}">
|
||||
<versionRange minVersion="0.1" maxVersion="1.3.328.4" severity="1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1pre" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem id="{8CE11043-9A15-4207-A565-0C94C42D590D}"/>
|
||||
<emItem id="{AB2CE124-6272-4b12-94A9-7303C7397BD1}">
|
||||
<versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1"/>
|
||||
</emItem>
|
||||
<emItem id="{B13721C7-F507-4982-B2E5-502A71474FED}">
|
||||
<versionRange severity="1"/>
|
||||
</emItem>
|
||||
<emItem id="{B7082FAA-CB62-4872-9106-E42DD88EDE45}">
|
||||
<versionRange minVersion="0.1" maxVersion="3.3.0.*">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
<versionRange minVersion="3.3.1" maxVersion="*">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="5.0a1" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem id="{E8E88AB0-7182-11DF-904E-6045E0D72085}"/>
|
||||
</emItems>
|
||||
<pluginItems>
|
||||
<pluginItem>
|
||||
<match name="name" exp="^Yahoo Application State Plugin$"/>
|
||||
<match name="description" exp="^Yahoo Application State Plugin$"/>
|
||||
<match name="filename" exp="npYState.dll"/>
|
||||
<versionRange>
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="3.*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem>
|
||||
<match name="name" exp="QuickTime Plug-in 7[.]1[.]"/>
|
||||
<match name="filename" exp="npqtplugin.?[.]dll"/>
|
||||
<versionRange>
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="3.*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem>
|
||||
<match name="filename" exp="NPFFAddOn.dll"/>
|
||||
<versionRange>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem>
|
||||
<match name="filename" exp="NPMySrch.dll"/>
|
||||
<versionRange>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem>
|
||||
<match name="filename" exp="npViewpoint.dll"/>
|
||||
<versionRange>
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem>
|
||||
<match name="name" exp="[0-6]\.0\.[01]\d{2}\.\d+"/>
|
||||
<match name="filename" exp="npdeploytk.dll"/>
|
||||
<versionRange severity="1">
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem>
|
||||
<match name="filename" exp="[Nn][Pp][Jj][Pp][Ii]1[56]0_[0-9]+\.[Dd][Ll][Ll]"/>
|
||||
<versionRange>
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.6a1pre" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
</pluginItems>
|
||||
<gfxItems>
|
||||
<gfxBlacklistEntry>
|
||||
<os>WINNT 6.1</os>
|
||||
<vendor>0x10de</vendor>
|
||||
<devices>
|
||||
<device>0x0a6c</device>
|
||||
</devices>
|
||||
<feature>DIRECT2D</feature>
|
||||
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
|
||||
<driverVersion>8.17.12.5896</driverVersion>
|
||||
<driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
|
||||
</gfxBlacklistEntry>
|
||||
<gfxBlacklistEntry>
|
||||
<os>WINNT 6.1</os>
|
||||
<vendor>0x10de</vendor>
|
||||
<devices>
|
||||
<device>0x0a6c</device>
|
||||
</devices>
|
||||
<feature>DIRECT3D_9_LAYERS</feature>
|
||||
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
|
||||
<driverVersion>8.17.12.5896</driverVersion>
|
||||
<driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
|
||||
</gfxBlacklistEntry>
|
||||
<gfxBlacklistEntry>
|
||||
<os>WINNT 5.1</os>
|
||||
<vendor>0x10de</vendor>
|
||||
<feature>DIRECT3D_9_LAYERS</feature>
|
||||
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
|
||||
<driverVersion>7.0.0.0</driverVersion>
|
||||
<driverVersionComparator>GREATER_THAN_OR_EQUAL</driverVersionComparator>
|
||||
</gfxBlacklistEntry>
|
||||
</gfxItems>
|
||||
</blocklist>
|
||||
<emItem blockID="i8" id="{B13721C7-F507-4982-B2E5-502A71474FED}">
|
||||
<versionRange minVersion=" " severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i38" id="{B7082FAA-CB62-4872-9106-E42DD88EDE45}">
|
||||
<versionRange minVersion="0.1" maxVersion="3.3.0.*" severity="0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
<versionRange minVersion="3.3.1" maxVersion="*" severity="0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="5.0a1" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i19" id="{46551EC9-40F0-4e47-8E18-8E5CF550CFB8}">
|
||||
<versionRange minVersion="1.1b1" maxVersion="1.1b1" severity="0">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i16" id="{27182e60-b5f3-411c-b545-b44205977502}">
|
||||
<versionRange minVersion="1.0" maxVersion="1.0" severity="0">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i10" id="{8CE11043-9A15-4207-A565-0C94C42D590D}">
|
||||
</emItem>
|
||||
<emItem blockID="i1" id="mozilla_cc@internetdownloadmanager.com">
|
||||
<versionRange minVersion="2.1" maxVersion="3.3" severity="0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
<versionRange minVersion=" " maxVersion="6.9.8" severity="0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1pre" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i18" id="msntoolbar@msn.com">
|
||||
<versionRange minVersion=" " maxVersion="6.*" severity="0">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i13" id="{E8E88AB0-7182-11DF-904E-6045E0D72085}">
|
||||
</emItem>
|
||||
<emItem blockID="i4" id="{4B3803EA-5230-4DC3-A7FC-33638F3D3542}">
|
||||
<versionRange minVersion="1.2" maxVersion="1.2" severity="0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i23" id="firefox@bandoo.com">
|
||||
<versionRange minVersion="5.0" maxVersion="5.0" severity="1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1pre" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i22" id="ShopperReports@ShopperReports.com">
|
||||
<versionRange minVersion="3.1.22.0" maxVersion="3.1.22.0" severity="0">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i2" id="fdm_ffext@freedownloadmanager.org">
|
||||
<versionRange minVersion="1.0" maxVersion="1.3.1" severity="0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i5" id="support@daemon-tools.cc">
|
||||
<versionRange minVersion=" " maxVersion="1.0.0.5" severity="0">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i6" id="{3f963a5b-e555-4543-90e2-c3908898db71}">
|
||||
<versionRange minVersion=" " maxVersion="8.5" severity="0">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i12" id="masterfiler@gmail.com">
|
||||
<versionRange severity="3">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i20" id="{AB2CE124-6272-4b12-94A9-7303C7397BD1}">
|
||||
<versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i11" id="yslow@yahoo-inc.com">
|
||||
<versionRange minVersion="2.0.5" maxVersion="2.0.5" severity="0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.5.7" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i17" id="{3252b9ae-c69a-4eaf-9502-dc9c1f6c009e}">
|
||||
<versionRange minVersion="2.2" maxVersion="2.2" severity="0">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i3" id="langpack-vi-VN@firefox.mozilla.org">
|
||||
<versionRange minVersion="2.0" maxVersion="2.0" severity="0">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i7" id="{2224e955-00e9-4613-a844-ce69fccaae91}">
|
||||
</emItem>
|
||||
<emItem blockID="i24" id="{6E19037A-12E3-4295-8915-ED48BC341614}">
|
||||
<versionRange minVersion="0.1" maxVersion="1.3.328.4" severity="1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1pre" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i15" id="personas@christopher.beard">
|
||||
<versionRange minVersion="1.6" maxVersion="1.6" severity="0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.6" maxVersion="3.6.*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i21" id="support@update-firefox.com">
|
||||
</emItem>
|
||||
</emItems>
|
||||
|
||||
<pluginItems>
|
||||
<pluginItem blockID="p26">
|
||||
<match name="name" exp="^Yahoo Application State Plugin$" /> <match name="description" exp="^Yahoo Application State Plugin$" /> <match name="filename" exp="npYState.dll" /> <versionRange severity="0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="3.*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p27">
|
||||
<match name="name" exp="QuickTime Plug-in 7[.]1[.]" /> <match name="filename" exp="npqtplugin.?[.]dll" /> <versionRange severity="0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="3.*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p28">
|
||||
<match name="filename" exp="NPFFAddOn.dll" /> <versionRange severity="0">
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p31">
|
||||
<match name="filename" exp="NPMySrch.dll" /> <versionRange severity="0">
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p32">
|
||||
<match name="filename" exp="npViewpoint.dll" /> <versionRange severity="0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p33">
|
||||
<match name="name" exp="[0-6]\.0\.[01]\d{2}\.\d+" /> <match name="filename" exp="npdeploytk.dll" /> <versionRange severity="1">
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p34">
|
||||
<match name="filename" exp="[Nn][Pp][Jj][Pp][Ii]1[56]0_[0-9]+\.[Dd][Ll][Ll]" /> <versionRange severity="0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.6a1pre" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
</pluginItems>
|
||||
|
||||
<gfxItems>
|
||||
<gfxBlacklistEntry blockID="g35">
|
||||
<os>WINNT 6.1</os>
|
||||
<vendor>0x10de</vendor>
|
||||
<devices>
|
||||
<device>0x0a6c</device>
|
||||
</devices>
|
||||
<feature>DIRECT2D</feature>
|
||||
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
|
||||
<driverVersion>8.17.12.5896</driverVersion>
|
||||
<driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
|
||||
</gfxBlacklistEntry>
|
||||
<gfxBlacklistEntry blockID="g36">
|
||||
<os>WINNT 6.1</os>
|
||||
<vendor>0x10de</vendor>
|
||||
<devices>
|
||||
<device>0x0a6c</device>
|
||||
</devices>
|
||||
<feature>DIRECT3D_9_LAYERS</feature>
|
||||
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
|
||||
<driverVersion>8.17.12.5896</driverVersion>
|
||||
<driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
|
||||
</gfxBlacklistEntry>
|
||||
<gfxBlacklistEntry blockID="g37">
|
||||
<os>WINNT 5.1</os>
|
||||
<vendor>0x10de</vendor>
|
||||
<feature>DIRECT3D_9_LAYERS</feature>
|
||||
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
|
||||
<driverVersion>7.0.0.0</driverVersion>
|
||||
<driverVersionComparator>GREATER_THAN_OR_EQUAL</driverVersionComparator>
|
||||
</gfxBlacklistEntry>
|
||||
</gfxItems>
|
||||
|
||||
|
||||
</blocklist>
|
@ -38,9 +38,6 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = Components.classes;
|
||||
|
||||
const kTestString = " hello hello \n world\nworld ";
|
||||
|
||||
var gTests = [
|
||||
@ -87,8 +84,7 @@ function test_paste(aCurrentTest) {
|
||||
var inputListener = {
|
||||
test: aCurrentTest,
|
||||
handleEvent: function(event) {
|
||||
var element = event.target;
|
||||
element.removeEventListener("input", this, false);
|
||||
element.removeEventListener(event.type, this, false);
|
||||
|
||||
is(element.value, this.test.expected, this.test.desc);
|
||||
|
||||
|
@ -2,10 +2,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
|
@ -52,16 +52,6 @@ waitForExplicitFinish();
|
||||
const TEST_IDENTIFIER = "ui-perf-test";
|
||||
const TEST_SUITE = "places";
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
|
||||
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Ci.nsIWindowMediator);
|
||||
var win = wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
|
||||
getService(Ci.nsINavHistoryService);
|
||||
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
|
||||
@ -112,7 +102,7 @@ ptests.push({
|
||||
visit_date_microsec -= 86400 * 1000 * 1000; // remove a day
|
||||
var spec = "http://example.com/" + visit_date_microsec;
|
||||
for (var j = 0; j < visits_per_day; j++) {
|
||||
var uri = ios.newURI(spec + j, null, null);
|
||||
var uri = Services.io.newURI(spec + j, null, null);
|
||||
add_visit(uri, visit_date_microsec);
|
||||
}
|
||||
}
|
||||
@ -132,7 +122,7 @@ ptests.push({
|
||||
visit_date_microsec -= 86400 * 1000 * 1000; // remove a day
|
||||
var spec = "http://example.com/" + visit_date_microsec;
|
||||
for (var j = 0; j < visits_per_day; j++) {
|
||||
var uri = ios.newURI(spec + j, null, null);
|
||||
var uri = Services.io.newURI(spec + j, null, null);
|
||||
if (bookmark_counter < bookmarks_per_day) {
|
||||
add_bookmark(uri);
|
||||
bookmark_counter++;
|
||||
|
@ -47,16 +47,6 @@ waitForExplicitFinish();
|
||||
const TEST_IDENTIFIER = "ui-perf-test";
|
||||
const TEST_SUITE = "places";
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
|
||||
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Ci.nsIWindowMediator);
|
||||
var win = wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
|
||||
getService(Ci.nsINavHistoryService);
|
||||
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
|
||||
|
@ -44,16 +44,6 @@ Tests the performance of opening the history menu.
|
||||
const TEST_IDENTIFIER = "ui-perf-test";
|
||||
const TEST_SUITE = "places";
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
|
||||
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Ci.nsIWindowMediator);
|
||||
var win = wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
|
||||
getService(Ci.nsINavHistoryService);
|
||||
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
|
||||
|
@ -47,15 +47,6 @@ waitForExplicitFinish();
|
||||
const TEST_IDENTIFIER = "ui-perf-test";
|
||||
const TEST_SUITE = "places";
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
|
||||
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Ci.nsIWindowMediator);
|
||||
var win = wm.getMostRecentWindow("navigator:browser");
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
|
||||
getService(Ci.nsINavHistoryService);
|
||||
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
|
||||
|
@ -47,15 +47,6 @@ waitForExplicitFinish();
|
||||
const TEST_IDENTIFIER = "ui-perf-test";
|
||||
const TEST_SUITE = "places";
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
|
||||
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Ci.nsIWindowMediator);
|
||||
var win = wm.getMostRecentWindow("navigator:browser");
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
|
||||
getService(Ci.nsINavHistoryService);
|
||||
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
|
||||
|
@ -47,15 +47,6 @@ waitForExplicitFinish();
|
||||
const TEST_IDENTIFIER = "ui-perf-test";
|
||||
const TEST_SUITE = "places";
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
|
||||
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Ci.nsIWindowMediator);
|
||||
var win = wm.getMostRecentWindow("navigator:browser");
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
|
||||
getService(Ci.nsINavHistoryService);
|
||||
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
|
||||
|
@ -46,24 +46,12 @@ waitForExplicitFinish();
|
||||
const TEST_IDENTIFIER = "ui-perf-test";
|
||||
const TEST_SUITE = "places";
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
|
||||
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Ci.nsIWindowMediator);
|
||||
var win = wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
|
||||
getService(Ci.nsINavHistoryService);
|
||||
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
|
||||
getService(Ci.nsINavBookmarksService);
|
||||
var prefs = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
|
||||
var maxResults = prefs.getIntPref("browser.urlbar.maxRichResults");
|
||||
var maxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
|
||||
var onSearchComplete = gURLBar.onSearchComplete;
|
||||
|
||||
function add_visit(aURI, aDate) {
|
||||
|
@ -53,14 +53,9 @@
|
||||
<!ENTITY netInterrupt.longDesc "&sharedLongDesc;">
|
||||
|
||||
<!ENTITY netOffline.title "Offline mode">
|
||||
<!-- LOCALIZATION NOTE (netOffline.overrideLongDesc) - This string should
|
||||
indicate that "Work Offline" is a menu item without being too specific,
|
||||
since it could be in either the normal menu (Mac/Linux) or the Firefox button
|
||||
menu (Windows).
|
||||
-->
|
||||
<!ENTITY netOffline.overrideLongDesc "
|
||||
<!ENTITY netOffline.longDesc2 "
|
||||
<ul>
|
||||
<li>Uncheck the "Work Offline" menu item, then try again.</li>
|
||||
<li>Press "Try Again" to switch to online mode and reload the page.</li>
|
||||
</ul>
|
||||
">
|
||||
|
||||
|
@ -1300,7 +1300,9 @@ nsWebSocket::Close()
|
||||
// before calling it
|
||||
nsRefPtr<nsWebSocket> kungfuDeathGrip = this;
|
||||
|
||||
mConnection->FailConnection();
|
||||
if (mConnection) {
|
||||
mConnection->FailConnection();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// this will take strings_to_send.length*5000 ms = 50 sec
|
||||
// this will take strings_to_send.length*500 ms = 5 sec
|
||||
|
||||
var timer = null;
|
||||
var strings_to_send = ["data\r\n\nda", "ta", ":", "de", "layed1\n\n",
|
||||
@ -38,5 +38,5 @@ function handleRequest(request, response)
|
||||
resp = response;
|
||||
|
||||
timer = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer);
|
||||
timer.initWithCallback(sendNextString, 5000, Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
|
||||
timer.initWithCallback(sendNextString, 500, Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
|
||||
}
|
||||
|
@ -19,8 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 338583 **/
|
||||
/** Tests for Bug 338583 **/
|
||||
|
||||
// we test:
|
||||
// 1) the EventSource behaviour
|
||||
@ -33,6 +32,26 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
|
||||
// --
|
||||
|
||||
function runAllTests() {
|
||||
// these tests run asynchronously
|
||||
doTest1(); // this will take 8000 ms
|
||||
doTest2(); // this will take 5000 ms
|
||||
doTest3(); // this will take 1500 ms
|
||||
doTest3_b(); // this will take 1500 ms
|
||||
doTest3_c(); // this will take 1500 ms
|
||||
doTest3_d(); // this will take 1500 ms
|
||||
doTest3_e(); // this will take 1500 ms
|
||||
doTest3_f(); // this will take 1500 ms
|
||||
doTest3_g(); // this will take 1500 ms
|
||||
doTest3_h(); // this will take 1500 ms
|
||||
doTest4(); // this will take 3000 ms
|
||||
doTest4_b(); // this will take 3000 ms
|
||||
doTest5(); // this will take 3000 ms
|
||||
doTest5_b(); // this will take 3000 ms
|
||||
doTest6(); // this will take 2500 ms
|
||||
doTest7(); // this will take 8000 ms
|
||||
}
|
||||
|
||||
function fn_onmessage(e) {
|
||||
if (e.currentTarget == e.target && e.target.hits != null)
|
||||
e.target.hits['fn_onmessage']++;
|
||||
@ -53,9 +72,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
|
||||
var gEventSourceObj1 = null;
|
||||
var gEventSourceObj2 = null;
|
||||
var gEventSourceObj3 = null;
|
||||
var gEventSourceObj4 = null;
|
||||
var gEventSourceObj5 = null;
|
||||
var gEventSourceObj3_a = null, gEventSourceObj3_b = null,
|
||||
gEventSourceObj3_c = null, gEventSourceObj3_d = null,
|
||||
gEventSourceObj3_e = null, gEventSourceObj3_f = null,
|
||||
gEventSourceObj3_g = null, gEventSourceObj3_h = null;
|
||||
var gEventSourceObj4_a = null, gEventSourceObj4_b = null;
|
||||
var gEventSourceObj5_a = null, gEventSourceObj5_b = null;
|
||||
var gEventSourceObj6 = null;
|
||||
var gEventSourceObj7 = null;
|
||||
var stress_factor; // used in the setTimeouts in order to help
|
||||
@ -92,13 +114,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
gEventSourceObj1.hits['fn_other_event_name'] = 0;
|
||||
gEventSourceObj1.addEventListener('other_event_name', fn_other_event_name, true);
|
||||
|
||||
// the eventsources.res always use a retry of 0.5 second, so for four hits a timeout of 3 seconds is enough
|
||||
// the eventsources.res always use a retry of 0.5 second, so for four hits a timeout of 6 seconds is enough
|
||||
setTimeout(function(){
|
||||
bhits = hasBeenHitFor1And2(gEventSourceObj1, 4);
|
||||
ok(bhits, "Test 1.b failed.");
|
||||
|
||||
doTest1_c();
|
||||
}, parseInt(3000*stress_factor));
|
||||
}, parseInt(6000*stress_factor));
|
||||
}
|
||||
|
||||
function doTest1_c() {
|
||||
@ -117,8 +139,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
bhits = hasBeenHitFor1And2(gEventSourceObj1, 1);
|
||||
ok(!bhits, "Test 1.d failed.");
|
||||
gEventSourceObj1.close();
|
||||
|
||||
doTest2();
|
||||
}, parseInt(2000*stress_factor));
|
||||
}
|
||||
|
||||
@ -138,13 +158,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
setTimeout(function(){ // just to clean...
|
||||
gEventSourceObj2.close();
|
||||
}, parseInt(5000*stress_factor));
|
||||
|
||||
doTest3();
|
||||
}
|
||||
|
||||
// in order to test (3)
|
||||
// a) XSite domain error test
|
||||
// b) protocol file:/// test
|
||||
// b) protocol file:// test
|
||||
// c) protocol javascript: test
|
||||
// d) wrong Content-Type test
|
||||
// e) bad http response code test
|
||||
@ -153,32 +171,33 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
// h) DNS error
|
||||
|
||||
function doTest3() {
|
||||
gEventSourceObj3 = new EventSource("http://example.org/tests/content/base/test/eventsource.resource");
|
||||
gEventSourceObj3_a = new EventSource("http://example.org/tests/content/base/test/eventsource.resource");
|
||||
|
||||
gEventSourceObj3.onmessage = fn_onmessage;
|
||||
gEventSourceObj3.hits = [];
|
||||
gEventSourceObj3.hits['fn_onmessage'] = 0;
|
||||
gEventSourceObj3_a.onmessage = fn_onmessage;
|
||||
gEventSourceObj3_a.hits = [];
|
||||
gEventSourceObj3_a.hits['fn_onmessage'] = 0;
|
||||
|
||||
setTimeout(function() {
|
||||
ok(gEventSourceObj3.hits['fn_onmessage'] == 0, "Test 3.a failed");
|
||||
gEventSourceObj3.close();
|
||||
|
||||
doTest3_b();
|
||||
ok(gEventSourceObj3_a.hits['fn_onmessage'] == 0, "Test 3.a failed");
|
||||
gEventSourceObj3_a.close();
|
||||
}, parseInt(1500*stress_factor));
|
||||
}
|
||||
|
||||
function doTest3_b() {
|
||||
gEventSourceObj3 = new EventSource("file:///home/wellington/src/content/base/test/eventsource.resource");
|
||||
var xhr = new XMLHttpRequest;
|
||||
xhr.open("GET", "/dynamic/getMyDirectory.sjs", false);
|
||||
xhr.send();
|
||||
var basePath = xhr.responseText;
|
||||
|
||||
gEventSourceObj3.onmessage = fn_onmessage;
|
||||
gEventSourceObj3.hits = [];
|
||||
gEventSourceObj3.hits['fn_onmessage'] = 0;
|
||||
gEventSourceObj3_b = new EventSource("file://" + basePath + "eventsource.resource");
|
||||
|
||||
gEventSourceObj3_b.onmessage = fn_onmessage;
|
||||
gEventSourceObj3_b.hits = [];
|
||||
gEventSourceObj3_b.hits['fn_onmessage'] = 0;
|
||||
|
||||
setTimeout(function() {
|
||||
ok(gEventSourceObj3.hits['fn_onmessage'] == 0, "Test 3.b failed");
|
||||
gEventSourceObj3.close();
|
||||
|
||||
doTest3_c();
|
||||
ok(gEventSourceObj3_b.hits['fn_onmessage'] == 0, "Test 3.b failed");
|
||||
gEventSourceObj3_b.close();
|
||||
}, parseInt(1500*stress_factor));
|
||||
}
|
||||
|
||||
@ -189,62 +208,54 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
}
|
||||
|
||||
function doTest3_c() {
|
||||
gEventSourceObj3 = new EventSource("javascript: return jsEvtSource()");
|
||||
gEventSourceObj3_c = new EventSource("javascript: return jsEvtSource()");
|
||||
|
||||
gEventSourceObj3.onmessage = fn_onmessage;
|
||||
gEventSourceObj3.hits = [];
|
||||
gEventSourceObj3.hits['fn_onmessage'] = 0;
|
||||
gEventSourceObj3_c.onmessage = fn_onmessage;
|
||||
gEventSourceObj3_c.hits = [];
|
||||
gEventSourceObj3_c.hits['fn_onmessage'] = 0;
|
||||
|
||||
setTimeout(function() {
|
||||
ok(gEventSourceObj3.hits['fn_onmessage'] == 0, "Test 3.c failed");
|
||||
gEventSourceObj3.close();
|
||||
|
||||
doTest3_d();
|
||||
ok(gEventSourceObj3_c.hits['fn_onmessage'] == 0, "Test 3.c failed");
|
||||
gEventSourceObj3_c.close();
|
||||
}, parseInt(1500*stress_factor));
|
||||
}
|
||||
|
||||
function doTest3_d() {
|
||||
gEventSourceObj3 = new EventSource("badContentType.eventsource");
|
||||
gEventSourceObj3_d = new EventSource("badContentType.eventsource");
|
||||
|
||||
gEventSourceObj3.onmessage = fn_onmessage;
|
||||
gEventSourceObj3.hits = [];
|
||||
gEventSourceObj3.hits['fn_onmessage'] = 0;
|
||||
gEventSourceObj3_d.onmessage = fn_onmessage;
|
||||
gEventSourceObj3_d.hits = [];
|
||||
gEventSourceObj3_d.hits['fn_onmessage'] = 0;
|
||||
|
||||
setTimeout(function() {
|
||||
ok(gEventSourceObj3.hits['fn_onmessage'] == 0, "Test 3.d failed");
|
||||
gEventSourceObj3.close();
|
||||
|
||||
doTest3_e();
|
||||
ok(gEventSourceObj3_d.hits['fn_onmessage'] == 0, "Test 3.d failed");
|
||||
gEventSourceObj3_d.close();
|
||||
}, parseInt(1500*stress_factor));
|
||||
}
|
||||
|
||||
function doTest3_e() {
|
||||
gEventSourceObj3 = new EventSource("badHTTPResponseCode.eventsource");
|
||||
gEventSourceObj3_e = new EventSource("badHTTPResponseCode.eventsource");
|
||||
|
||||
gEventSourceObj3.onmessage = fn_onmessage;
|
||||
gEventSourceObj3.hits = [];
|
||||
gEventSourceObj3.hits['fn_onmessage'] = 0;
|
||||
gEventSourceObj3_e.onmessage = fn_onmessage;
|
||||
gEventSourceObj3_e.hits = [];
|
||||
gEventSourceObj3_e.hits['fn_onmessage'] = 0;
|
||||
|
||||
setTimeout(function() {
|
||||
ok(gEventSourceObj3.hits['fn_onmessage'] == 0, "Test 3.e failed");
|
||||
gEventSourceObj3.close();
|
||||
|
||||
doTest3_f();
|
||||
ok(gEventSourceObj3_e.hits['fn_onmessage'] == 0, "Test 3.e failed");
|
||||
gEventSourceObj3_e.close();
|
||||
}, parseInt(1500*stress_factor));
|
||||
}
|
||||
|
||||
function doTest3_f() {
|
||||
gEventSourceObj3 = new EventSource("badMessageEvent.eventsource");
|
||||
gEventSourceObj3_f = new EventSource("badMessageEvent.eventsource");
|
||||
|
||||
gEventSourceObj3.onmessage = fn_onmessage;
|
||||
gEventSourceObj3.hits = [];
|
||||
gEventSourceObj3.hits['fn_onmessage'] = 0;
|
||||
gEventSourceObj3_f.onmessage = fn_onmessage;
|
||||
gEventSourceObj3_f.hits = [];
|
||||
gEventSourceObj3_f.hits['fn_onmessage'] = 0;
|
||||
|
||||
setTimeout(function() {
|
||||
ok(gEventSourceObj3.hits['fn_onmessage'] == 0, "Test 3.f failed");
|
||||
gEventSourceObj3.close();
|
||||
|
||||
doTest3_g();
|
||||
ok(gEventSourceObj3_f.hits['fn_onmessage'] == 0, "Test 3.f failed");
|
||||
gEventSourceObj3_f.close();
|
||||
}, parseInt(1500*stress_factor));
|
||||
}
|
||||
|
||||
@ -253,31 +264,27 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
}
|
||||
|
||||
function doTest3_g() {
|
||||
gEventSourceObj3 = new EventSource("badEventFieldName.eventsource");
|
||||
gEventSourceObj3_g = new EventSource("badEventFieldName.eventsource");
|
||||
|
||||
fnInvalidNCName.hits = 0;
|
||||
gEventSourceObj3.addEventListener('message event', fnInvalidNCName, true);
|
||||
gEventSourceObj3_g.addEventListener('message event', fnInvalidNCName, true);
|
||||
|
||||
setTimeout(function() {
|
||||
ok(fnInvalidNCName.hits != 0, "Test 3.g failed");
|
||||
gEventSourceObj3.close();
|
||||
|
||||
doTest3_h();
|
||||
gEventSourceObj3_g.close();
|
||||
}, parseInt(1500*stress_factor));
|
||||
}
|
||||
|
||||
function doTest3_h() {
|
||||
gEventSourceObj3 = new EventSource("http://hdfskjghsbg.jtiyoejowe.dafsgbhjab.com");
|
||||
gEventSourceObj3_h = new EventSource("http://hdfskjghsbg.jtiyoejowe.dafsgbhjab.com");
|
||||
|
||||
gEventSourceObj3.onmessage = fn_onmessage;
|
||||
gEventSourceObj3.hits = [];
|
||||
gEventSourceObj3.hits['fn_onmessage'] = 0;
|
||||
gEventSourceObj3_h.onmessage = fn_onmessage;
|
||||
gEventSourceObj3_h.hits = [];
|
||||
gEventSourceObj3_h.hits['fn_onmessage'] = 0;
|
||||
|
||||
setTimeout(function() {
|
||||
ok(gEventSourceObj3.hits['fn_onmessage'] == 0, "Test 3.h failed");
|
||||
gEventSourceObj3.close();
|
||||
|
||||
doTest4();
|
||||
ok(gEventSourceObj3_h.hits['fn_onmessage'] == 0, "Test 3.h failed");
|
||||
gEventSourceObj3_h.close();
|
||||
}, parseInt(1500*stress_factor));
|
||||
}
|
||||
|
||||
@ -288,44 +295,40 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
|
||||
function fn_onmessage4_a(e)
|
||||
{
|
||||
if (e.data > gEventSourceObj4.lastData)
|
||||
gEventSourceObj4.lastData = e.data;
|
||||
if (e.data > gEventSourceObj4_a.lastData)
|
||||
gEventSourceObj4_a.lastData = e.data;
|
||||
if (e.data == 2)
|
||||
gEventSourceObj4.close();
|
||||
gEventSourceObj4_a.close();
|
||||
}
|
||||
|
||||
function fn_onmessage4_b(e)
|
||||
{
|
||||
if (e.data > gEventSourceObj4.lastData)
|
||||
gEventSourceObj4.lastData = e.data;
|
||||
if (e.data > gEventSourceObj4_b.lastData)
|
||||
gEventSourceObj4_b.lastData = e.data;
|
||||
if (e.data == 2)
|
||||
gEventSourceObj4.removeEventListener('message', fn_onmessage4_b, true);
|
||||
gEventSourceObj4_b.removeEventListener('message', fn_onmessage4_b, true);
|
||||
}
|
||||
|
||||
function doTest4() {
|
||||
gEventSourceObj4 = new EventSource("forRemoval.resource");
|
||||
gEventSourceObj4.lastData = 0;
|
||||
gEventSourceObj4.onmessage = fn_onmessage4_a;
|
||||
gEventSourceObj4_a = new EventSource("forRemoval.resource");
|
||||
gEventSourceObj4_a.lastData = 0;
|
||||
gEventSourceObj4_a.onmessage = fn_onmessage4_a;
|
||||
|
||||
setTimeout(function() {
|
||||
ok(gEventSourceObj4.lastData == 2, "Test 4.a failed");
|
||||
gEventSourceObj4.close();
|
||||
|
||||
doTest4_b();
|
||||
ok(gEventSourceObj4_a.lastData == 2, "Test 4.a failed");
|
||||
gEventSourceObj4_a.close();
|
||||
}, parseInt(3000*stress_factor));
|
||||
}
|
||||
|
||||
function doTest4_b()
|
||||
{
|
||||
gEventSourceObj4 = new EventSource("forRemoval.resource");
|
||||
gEventSourceObj4.lastData = 0;
|
||||
gEventSourceObj4.addEventListener('message', fn_onmessage4_b, true);
|
||||
gEventSourceObj4_b = new EventSource("forRemoval.resource");
|
||||
gEventSourceObj4_b.lastData = 0;
|
||||
gEventSourceObj4_b.addEventListener('message', fn_onmessage4_b, true);
|
||||
|
||||
setTimeout(function() {
|
||||
ok(gEventSourceObj4.lastData == 2, "Test 4.b failed");
|
||||
gEventSourceObj4.close();
|
||||
|
||||
doTest5();
|
||||
ok(gEventSourceObj4_b.lastData == 2, "Test 4.b failed");
|
||||
gEventSourceObj4_b.close();
|
||||
}, parseInt(3000*stress_factor));
|
||||
}
|
||||
|
||||
@ -335,33 +338,29 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
|
||||
function doTest5()
|
||||
{
|
||||
gEventSourceObj5 = new EventSource("http://example.org/tests/content/base/test/accesscontrol.resource");
|
||||
gEventSourceObj5_a = new EventSource("http://example.org/tests/content/base/test/accesscontrol.resource");
|
||||
|
||||
gEventSourceObj5.onmessage = fn_onmessage;
|
||||
gEventSourceObj5.hits = [];
|
||||
gEventSourceObj5.hits['fn_onmessage'] = 0;
|
||||
gEventSourceObj5_a.onmessage = fn_onmessage;
|
||||
gEventSourceObj5_a.hits = [];
|
||||
gEventSourceObj5_a.hits['fn_onmessage'] = 0;
|
||||
|
||||
setTimeout(function() {
|
||||
ok(gEventSourceObj5.hits['fn_onmessage'] == 0, "Test 5.a failed");
|
||||
gEventSourceObj5.close();
|
||||
|
||||
doTest5_b();
|
||||
ok(gEventSourceObj5_a.hits['fn_onmessage'] == 0, "Test 5.a failed");
|
||||
gEventSourceObj5_a.close();
|
||||
}, parseInt(3000*stress_factor));
|
||||
}
|
||||
|
||||
function doTest5_b()
|
||||
{
|
||||
gEventSourceObj5 = new EventSource("http://example.org/tests/content/base/test/invalid_accesscontrol.resource");
|
||||
gEventSourceObj5_b = new EventSource("http://example.org/tests/content/base/test/invalid_accesscontrol.resource");
|
||||
|
||||
gEventSourceObj5.onmessage = fn_onmessage;
|
||||
gEventSourceObj5.hits = [];
|
||||
gEventSourceObj5.hits['fn_onmessage'] = 0;
|
||||
gEventSourceObj5_b.onmessage = fn_onmessage;
|
||||
gEventSourceObj5_b.hits = [];
|
||||
gEventSourceObj5_b.hits['fn_onmessage'] = 0;
|
||||
|
||||
setTimeout(function() {
|
||||
ok(gEventSourceObj5.hits['fn_onmessage'] == 0, "Test 5.b failed");
|
||||
gEventSourceObj5.close();
|
||||
|
||||
doTest6();
|
||||
ok(gEventSourceObj5_b.hits['fn_onmessage'] == 0, "Test 5.b failed");
|
||||
gEventSourceObj5_b.close();
|
||||
}, parseInt(3000*stress_factor));
|
||||
}
|
||||
|
||||
@ -388,8 +387,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
|
||||
setTimeout(function() {
|
||||
gEventSourceObj6.close();
|
||||
|
||||
doTest7();
|
||||
}, parseInt(2500*stress_factor));
|
||||
}
|
||||
|
||||
@ -412,7 +409,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
SpecialPowers.setBoolPref("dom.server-events.enabled", oldPrefVal);
|
||||
document.getElementById('waitSpan').innerHTML = '';
|
||||
SimpleTest.finish();
|
||||
}, parseInt(50000*stress_factor));
|
||||
}, parseInt(8000*stress_factor));
|
||||
}
|
||||
|
||||
function doTest()
|
||||
@ -435,7 +432,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
stress_factor = ((new Date()).getTime()-begin_time)*1/589;
|
||||
stress_factor *= 1.10; // also, a margin of 10%
|
||||
|
||||
doTest1();
|
||||
runAllTests();
|
||||
}
|
||||
}
|
||||
f.i = 0;
|
||||
|
@ -8,8 +8,6 @@
|
||||
<!ENTITY % netErrorDTD
|
||||
SYSTEM "chrome://global/locale/netError.dtd">
|
||||
%netErrorDTD;
|
||||
<!-- Fallback in case netOffline.overrideLongDesc is not defined -->
|
||||
<!ENTITY netOffline.overrideLongDesc "&netOffline.longDesc;">
|
||||
<!ENTITY % globalDTD
|
||||
SYSTEM "chrome://global/locale/global.dtd">
|
||||
%globalDTD;
|
||||
@ -42,6 +40,7 @@
|
||||
- Jeff Walden <jwalden+code@mit.edu>
|
||||
- Johnathan Nightingale <johnath@mozilla.com>
|
||||
- Ehsan Akhgari <ehsan.akhgari@gmail.com>
|
||||
- Steffen Wilberg <steffen.wilberg@web.de>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@ -115,6 +114,13 @@
|
||||
|
||||
function retryThis(buttonEl)
|
||||
{
|
||||
// If this is the "Offline mode" page, go online!
|
||||
if (getErrorCode() == "netOffline") {
|
||||
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIDOMWindowUtils)
|
||||
.goOnline();
|
||||
}
|
||||
|
||||
// Session history has the URL of the page that failed
|
||||
// to load, not the one of the error page. So, just call
|
||||
// reload(), which will also repost POST data correctly.
|
||||
@ -342,7 +348,7 @@
|
||||
<div id="ed_redirectLoop">&redirectLoop.longDesc;</div>
|
||||
<div id="ed_unknownSocketType">&unknownSocketType.longDesc;</div>
|
||||
<div id="ed_netReset">&netReset.longDesc;</div>
|
||||
<div id="ed_netOffline">&netOffline.overrideLongDesc;</div>
|
||||
<div id="ed_netOffline">&netOffline.longDesc2;</div>
|
||||
<div id="ed_netInterrupt">&netInterrupt.longDesc;</div>
|
||||
<div id="ed_deniedPortAccess">&deniedPortAccess.longDesc;</div>
|
||||
<div id="ed_proxyResolveFailure">&proxyResolveFailure.longDesc;</div>
|
||||
|
@ -50,6 +50,7 @@ _BROWSER_TEST_FILES = \
|
||||
browser_bug349769.js \
|
||||
browser_bug388121-1.js \
|
||||
browser_bug388121-2.js \
|
||||
browser_bug435325.js \
|
||||
browser_bug441169.js \
|
||||
browser_bug420605.js \
|
||||
file_bug420605.html \
|
||||
|
49
docshell/test/browser/browser_bug435325.js
Normal file
49
docshell/test/browser/browser_bug435325.js
Normal file
@ -0,0 +1,49 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* Ensure that clicking the button in the Offline mode neterror page makes the browser go online. See bug 435325. */
|
||||
/* TEST_PATH=docshell/test/browser/browser_bug435325.js make -C $(OBJDIR) mochitest-browser-chrome */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
window.addEventListener("DOMContentLoaded", checkPage, false);
|
||||
|
||||
// Go offline and disable the cache, then try to load the test URL.
|
||||
Services.io.offline = true;
|
||||
gPrefService.setBoolPref("browser.cache.disk.enable", false);
|
||||
gPrefService.setBoolPref("browser.cache.memory.enable", false);
|
||||
content.location = "http://example.com/";
|
||||
}
|
||||
|
||||
function checkPage() {
|
||||
if(content.location == "about:blank") {
|
||||
info("got about:blank, which is expected once, so return");
|
||||
return;
|
||||
}
|
||||
|
||||
window.removeEventListener("DOMContentLoaded", checkPage, false);
|
||||
|
||||
ok(Services.io.offline, "Setting Services.io.offline to true.");
|
||||
is(gBrowser.contentDocument.documentURI.substring(0,27),
|
||||
"about:neterror?e=netOffline", "Loading the Offline mode neterror page.");
|
||||
|
||||
// Now press the "Try Again" button
|
||||
ok(gBrowser.contentDocument.getElementById("errorTryAgain"),
|
||||
"The error page has got a #errorTryAgain element");
|
||||
gBrowser.contentDocument.getElementById("errorTryAgain").click();
|
||||
|
||||
ok(!Services.io.offline, "After clicking the Try Again button, we're back "
|
||||
+" online. This depends on Components.interfaces.nsIDOMWindowUtils being "
|
||||
+"available from untrusted content (bug 435325).");
|
||||
|
||||
finish();
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
gPrefService.setBoolPref("browser.cache.disk.enable", true);
|
||||
gPrefService.setBoolPref("browser.cache.memory.enable", true);
|
||||
Services.io.offline = false;
|
||||
gBrowser.removeCurrentTab();
|
||||
});
|
@ -2,8 +2,6 @@
|
||||
|
||||
// Globals
|
||||
var testPath = "http://mochi.test:8888/browser/docshell/test/navigation/";
|
||||
var Ci = Components.interfaces;
|
||||
var Cc = Components.classes;
|
||||
var ctx = {};
|
||||
|
||||
// Helper function to check if a window is active
|
||||
@ -214,9 +212,8 @@ function step7() {
|
||||
function allDone() {
|
||||
|
||||
// Close the tabs we made
|
||||
gBrowser.removeCurrentTab();
|
||||
gBrowser.tabContainer.advanceSelectedTab(1, true);
|
||||
gBrowser.removeCurrentTab();
|
||||
gBrowser.removeTab(ctx.tab1);
|
||||
gBrowser.removeTab(ctx.tab2);
|
||||
|
||||
// Tell the framework we're done
|
||||
finish();
|
||||
|
@ -81,6 +81,7 @@
|
||||
#include "jsobj.h"
|
||||
|
||||
#include "Layers.h"
|
||||
#include "nsIIOService.h"
|
||||
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
@ -1770,6 +1771,30 @@ nsDOMWindowUtils::GetCursorType(PRInt16 *aCursor)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GoOnline()
|
||||
{
|
||||
// This is only allowed from about:neterror, which is unprivileged, so it
|
||||
// can't access the io-service itself.
|
||||
NS_ENSURE_TRUE(mWindow, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIDocument> doc(do_QueryInterface(mWindow->GetExtantDocument()));
|
||||
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIURI> documentURI;
|
||||
documentURI = doc->GetDocumentURI();
|
||||
|
||||
nsCAutoString spec;
|
||||
documentURI->GetSpec(spec);
|
||||
if (!StringBeginsWith(spec, NS_LITERAL_CSTRING("about:neterror?")))
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
|
||||
nsCOMPtr<nsIIOService> ios = do_GetService("@mozilla.org/network/io-service;1");
|
||||
if (ios) {
|
||||
ios->SetOffline(PR_FALSE); // !offline
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GetDisplayDPI(float *aDPI)
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ interface nsIIDBRequest;
|
||||
interface nsIVariant;
|
||||
|
||||
%{C++
|
||||
#include "jsapi.h"
|
||||
#include "jspubtd.h"
|
||||
%}
|
||||
|
||||
/**
|
||||
|
@ -47,7 +47,7 @@ interface nsIDOMDOMStringList;
|
||||
interface nsIDOMEventListener;
|
||||
|
||||
%{C++
|
||||
#include "jsapi.h"
|
||||
#include "jspubtd.h"
|
||||
%}
|
||||
|
||||
/**
|
||||
|
@ -45,7 +45,7 @@ interface nsIIDBRequest;
|
||||
interface nsIVariant;
|
||||
|
||||
%{C++
|
||||
#include "jsapi.h"
|
||||
#include "jspubtd.h"
|
||||
%}
|
||||
|
||||
/**
|
||||
|
@ -47,7 +47,7 @@ interface nsIVariant;
|
||||
interface nsIDOMDOMStringList;
|
||||
|
||||
%{C++
|
||||
#include "jsapi.h"
|
||||
#include "jspubtd.h"
|
||||
%}
|
||||
|
||||
/**
|
||||
|
@ -66,7 +66,7 @@ interface nsITransferable;
|
||||
interface nsIQueryContentEventResult;
|
||||
interface nsIDOMWindow;
|
||||
|
||||
[scriptable, uuid(663e33d7-eca2-42e8-af92-5df6a5e222df)]
|
||||
[scriptable, uuid(b46050ea-6f18-11e0-bf00-f389b7004a12)]
|
||||
interface nsIDOMWindowUtils : nsISupports {
|
||||
|
||||
/**
|
||||
@ -802,6 +802,13 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||
void suspendTimeouts();
|
||||
void resumeTimeouts();
|
||||
|
||||
/**
|
||||
* Set the network status to online from the Offline mode error page.
|
||||
*
|
||||
* The caller of this method must be about:neterror.
|
||||
*/
|
||||
void goOnline();
|
||||
|
||||
/**
|
||||
* What type of layer manager the widget associated with this window is
|
||||
* using. "Basic" is unaccelerated; other types are accelerated. Throws an
|
||||
|
@ -25,8 +25,7 @@
|
||||
<!ENTITY netInterrupt.longDesc "<p>The browser connected successfully, but the connection was interrupted while transferring information. Please try again.</p><ul><li>Are you unable to browse other sites? Check the computer's network connection.</li><li>Still having trouble? Consult your network administrator or Internet provider for assistance.</li></ul>">
|
||||
|
||||
<!ENTITY netOffline.title "Offline Mode">
|
||||
<!ENTITY netOffline.longDesc "<p>The browser is operating in its offline mode and cannot connect to the requested item.</p><ul><li>Is the computer connected to an active network?</li><li>Place the browser in online mode and try again.</li></ul>">
|
||||
<!ENTITY netOffline.overrideLongDesc "<p>The browser is operating in its offline mode and cannot connect to the requested item.</p><ul><li>Is the computer connected to an active network?</li><li>Place the browser in online mode and try again.</li></ul>">
|
||||
<!ENTITY netOffline.longDesc2 "<p>The browser is operating in its offline mode and cannot connect to the requested item.</p><ul><li>Is the computer connected to an active network?</li><li>Press "Try Again" to switch to online mode and reload the page.</li></ul>">
|
||||
|
||||
<!ENTITY contentEncodingError.title "Content Encoding Error">
|
||||
<!ENTITY contentEncodingError.longDesc "<p>The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.</p><ul><li>Please contact the website owners to inform them of this problem.</li></ul>">
|
||||
|
@ -42,6 +42,23 @@ class NSCursor;
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
|
||||
// The header file QuickdrawAPI.h is missing on OS X 10.7 and up (though the
|
||||
// QuickDraw APIs defined in it are still present) -- so we need to supply the
|
||||
// relevant parts of its contents here. It's likely that Apple will eventually
|
||||
// remove the APIs themselves (probably in OS X 10.8), so we need to make them
|
||||
// weak imports, and test for their presence before using them.
|
||||
#if !defined(__QUICKDRAWAPI__)
|
||||
|
||||
typedef short Bits16[16];
|
||||
struct Cursor {
|
||||
Bits16 data;
|
||||
Bits16 mask;
|
||||
Point hotSpot;
|
||||
};
|
||||
typedef struct Cursor Cursor;
|
||||
|
||||
#endif /* __QUICKDRAWAPI__ */
|
||||
|
||||
namespace mac_plugin_interposing {
|
||||
|
||||
// Class used to serialize NSCursor objects over IPC between processes.
|
||||
|
@ -64,6 +64,18 @@
|
||||
#include <dlfcn.h>
|
||||
#import <Carbon/Carbon.h>
|
||||
|
||||
// The header file QuickdrawAPI.h is missing on OS X 10.7 and up (though the
|
||||
// QuickDraw APIs defined in it are still present) -- so we need to supply the
|
||||
// relevant parts of its contents here. It's likely that Apple will eventually
|
||||
// remove the APIs themselves (probably in OS X 10.8), so we need to make them
|
||||
// weak imports, and test for their presence before using them.
|
||||
#if !defined(__QUICKDRAWAPI__)
|
||||
|
||||
typedef struct Cursor;
|
||||
extern "C" void SetCursor(const Cursor * crsr) __attribute__((weak_import));
|
||||
|
||||
#endif /* __QUICKDRAWAPI__ */
|
||||
|
||||
BOOL (*OnSetThemeCursorPtr) (ThemeCursor) = NULL;
|
||||
BOOL (*OnSetCursorPtr) (const Cursor*) = NULL;
|
||||
BOOL (*OnHideCursorPtr) () = NULL;
|
||||
@ -106,10 +118,12 @@ static OSStatus MacPluginChildSetThemeCursor(ThemeCursor cursor)
|
||||
|
||||
static void MacPluginChildSetCursor(const Cursor* cursor)
|
||||
{
|
||||
if (loadXULPtrs()) {
|
||||
OnSetCursorPtr(cursor);
|
||||
if (::SetCursor) {
|
||||
if (loadXULPtrs()) {
|
||||
OnSetCursorPtr(cursor);
|
||||
}
|
||||
::SetCursor(cursor);
|
||||
}
|
||||
::SetCursor(cursor);
|
||||
}
|
||||
|
||||
static CGError MacPluginChildCGDisplayHideCursor(CGDirectDisplayID display)
|
||||
@ -142,9 +156,13 @@ struct interpose_substitution {
|
||||
__attribute__((used)) static const interpose_substitution substitutions[]
|
||||
__attribute__((section("__DATA, __interpose"))) = {
|
||||
INTERPOSE_FUNCTION(SetThemeCursor),
|
||||
INTERPOSE_FUNCTION(SetCursor),
|
||||
INTERPOSE_FUNCTION(CGDisplayHideCursor),
|
||||
INTERPOSE_FUNCTION(CGDisplayShowCursor),
|
||||
// SetCursor() and other QuickDraw APIs will probably be removed in OS X
|
||||
// 10.8. But this will make 'SetCursor' NULL, which will just stop the OS
|
||||
// from interposing it (tested using an INTERPOSE_FUNCTION_BROKEN macro
|
||||
// that just sets the second address of each tuple to NULL).
|
||||
INTERPOSE_FUNCTION(SetCursor),
|
||||
};
|
||||
|
||||
#endif // !__LP64__
|
||||
|
@ -151,6 +151,7 @@ void Area::ParseCoords(const nsAString& aSpec)
|
||||
mCoords = nsnull;
|
||||
if (*cp == '\0')
|
||||
{
|
||||
nsMemory::Free(cp);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -164,6 +165,7 @@ void Area::ParseCoords(const nsAString& aSpec)
|
||||
}
|
||||
if (*n_str == '\0')
|
||||
{
|
||||
nsMemory::Free(cp);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -248,6 +250,7 @@ void Area::ParseCoords(const nsAString& aSpec)
|
||||
value_list = new nscoord[cnt];
|
||||
if (!value_list)
|
||||
{
|
||||
nsMemory::Free(cp);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -290,7 +293,7 @@ void Area::ParseCoords(const nsAString& aSpec)
|
||||
mNumCoords = cnt;
|
||||
mCoords = value_list;
|
||||
|
||||
NS_Free(cp);
|
||||
nsMemory::Free(cp);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,6 +138,10 @@
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("AddonOptionsLoad", true, false);
|
||||
this.dispatchEvent(event);
|
||||
|
||||
// Also send a notification to match the behavior of desktop Firefox
|
||||
let id = this.id.substring(17); // length of |urn:mozilla:item:|
|
||||
Services.obs.notifyObservers(document, "addon-options-displayed", id);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -352,11 +352,6 @@ let Content = {
|
||||
} else if (ot == errorDoc.getElementById("getMeOutOfHereButton")) {
|
||||
sendAsyncMessage("Browser:CertException", { url: errorDoc.location.href, action: "leave" });
|
||||
}
|
||||
} else if (/^about:neterror\?e=netOffline/.test(errorDoc.documentURI)) {
|
||||
if (ot == errorDoc.getElementById("errorTryAgain")) {
|
||||
// Make sure we're online before attempting to load
|
||||
Util.forceOnline();
|
||||
}
|
||||
} else if (/^about:blocked/.test(errorDoc.documentURI)) {
|
||||
// The event came from a button on a malware/phishing block page
|
||||
// First check whether it's malware or phishing, so that we can
|
||||
|
@ -120,7 +120,11 @@ gTests.push({
|
||||
|
||||
// Create a listener for the opening bookmark
|
||||
waitForPageShow(function() {
|
||||
is(gCurrentTest._currentTab.browser.currentURI.spec, testURL_01, "Opened the right bookmark");
|
||||
if (Services.appinfo.OS == "Android")
|
||||
todo_is(gCurrentTest._currentTab.browser.currentURI.spec, testURL_01, "Opened the right bookmark");
|
||||
else
|
||||
is(gCurrentTest._currentTab.browser.currentURI.spec, testURL_01, "Opened the right bookmark");
|
||||
|
||||
Browser.closeTab(gCurrentTest._currentTab);
|
||||
|
||||
runNextTest();
|
||||
|
@ -53,7 +53,7 @@
|
||||
<!ENTITY netInterrupt.longDesc "&sharedLongDesc;">
|
||||
|
||||
<!ENTITY netOffline.title "Offline mode">
|
||||
<!ENTITY netOffline.overrideLongDesc "
|
||||
<!ENTITY netOffline.longDesc2 "
|
||||
<ul>
|
||||
<li>Try again. &brandShortName; will attempt to open a connection and reload the page.</li>
|
||||
</ul>
|
||||
|
@ -276,10 +276,10 @@ public:
|
||||
nsresult AddSourceData(const char *aBuffer, PRUint32 aCount);
|
||||
|
||||
/* Called after the all the source data has been added with addSourceData. */
|
||||
virtual nsresult SourceDataComplete();
|
||||
nsresult SourceDataComplete();
|
||||
|
||||
/* Called for multipart images when there's a new source image to add. */
|
||||
virtual nsresult NewSourceData();
|
||||
nsresult NewSourceData();
|
||||
|
||||
/**
|
||||
* A hint of the number of bytes of source data that the image contains. If
|
||||
@ -292,7 +292,7 @@ public:
|
||||
* Thus, pre-allocation simplifies code and reduces the total number of
|
||||
* allocations.
|
||||
*/
|
||||
virtual nsresult SetSourceSizeHint(PRUint32 sizeHint);
|
||||
nsresult SetSourceSizeHint(PRUint32 sizeHint);
|
||||
|
||||
// "Blend" method indicates how the current image is combined with the
|
||||
// previous image.
|
||||
|
@ -2349,13 +2349,24 @@ nsHttpChannel::OpenOfflineCacheEntryForWriting()
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Generates the proper cache-key for this instance of nsHttpChannel
|
||||
nsresult
|
||||
nsHttpChannel::GenerateCacheKey(PRUint32 postID, nsACString &cacheKey)
|
||||
{
|
||||
AssembleCacheKey(mFallbackChannel ? mFallbackKey.get() : mSpec.get(),
|
||||
postID, cacheKey);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Assembles a cache-key from the given pieces of information and |mLoadFlags|
|
||||
void
|
||||
nsHttpChannel::AssembleCacheKey(const char *spec, PRUint32 postID,
|
||||
nsACString &cacheKey)
|
||||
{
|
||||
cacheKey.Truncate();
|
||||
|
||||
if (mLoadFlags & LOAD_ANONYMOUS) {
|
||||
cacheKey.AssignLiteral("anon&");
|
||||
cacheKey.AssignLiteral("anon&");
|
||||
}
|
||||
|
||||
if (postID) {
|
||||
@ -2365,17 +2376,15 @@ nsHttpChannel::GenerateCacheKey(PRUint32 postID, nsACString &cacheKey)
|
||||
}
|
||||
|
||||
if (!cacheKey.IsEmpty()) {
|
||||
cacheKey.AppendLiteral("uri=");
|
||||
cacheKey.AppendLiteral("uri=");
|
||||
}
|
||||
|
||||
// Strip any trailing #ref from the URL before using it as the key
|
||||
const char *spec = mFallbackChannel ? mFallbackKey.get() : mSpec.get();
|
||||
const char *p = strchr(spec, '#');
|
||||
if (p)
|
||||
cacheKey.Append(spec, p - spec);
|
||||
else
|
||||
cacheKey.Append(spec);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// UpdateExpirationTime is called when a new response comes in from the server.
|
||||
@ -3317,24 +3326,8 @@ nsHttpChannel::AsyncProcessRedirection(PRUint32 redirectType)
|
||||
LOG(("redirecting to: %s [redirection-limit=%u]\n",
|
||||
location, PRUint32(mRedirectionLimit)));
|
||||
|
||||
nsresult rv;
|
||||
nsresult rv = CreateNewURI(location, getter_AddRefs(mRedirectURI));
|
||||
|
||||
// create a new URI using the location header and the current URL
|
||||
// as a base...
|
||||
nsCOMPtr<nsIIOService> ioService;
|
||||
rv = gHttpHandler->GetIOService(getter_AddRefs(ioService));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// the new uri should inherit the origin charset of the current uri
|
||||
nsCAutoString originCharset;
|
||||
rv = mURI->GetOriginCharset(originCharset);
|
||||
if (NS_FAILED(rv))
|
||||
originCharset.Truncate();
|
||||
|
||||
rv = ioService->NewURI(nsDependentCString(location),
|
||||
originCharset.get(),
|
||||
mURI,
|
||||
getter_AddRefs(mRedirectURI));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (mApplicationCache) {
|
||||
@ -3354,6 +3347,26 @@ nsHttpChannel::AsyncProcessRedirection(PRUint32 redirectType)
|
||||
return ContinueProcessRedirectionAfterFallback(NS_OK);
|
||||
}
|
||||
|
||||
// Creates an URI to the given location using current URI for base and charset
|
||||
nsresult
|
||||
nsHttpChannel::CreateNewURI(const char *loc, nsIURI **newURI)
|
||||
{
|
||||
nsCOMPtr<nsIIOService> ioService;
|
||||
nsresult rv = gHttpHandler->GetIOService(getter_AddRefs(ioService));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// the new uri should inherit the origin charset of the current uri
|
||||
nsCAutoString originCharset;
|
||||
rv = mURI->GetOriginCharset(originCharset);
|
||||
if (NS_FAILED(rv))
|
||||
originCharset.Truncate();
|
||||
|
||||
return ioService->NewURI(nsDependentCString(loc),
|
||||
originCharset.get(),
|
||||
mURI,
|
||||
newURI);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHttpChannel::ContinueProcessRedirectionAfterFallback(nsresult rv)
|
||||
{
|
||||
@ -4975,37 +4988,82 @@ nsHttpChannel::MaybeInvalidateCacheEntryForSubsequentGet()
|
||||
mRequestHead.Method() == nsHttp::Trace ||
|
||||
mRequestHead.Method() == nsHttp::Connect)
|
||||
return;
|
||||
|
||||
|
||||
|
||||
// Invalidate the request-uri.
|
||||
// Pass 0 in first param to get the cache-key for a GET-request.
|
||||
nsCAutoString tmpCacheKey;
|
||||
GenerateCacheKey(0, tmpCacheKey);
|
||||
LOG(("MaybeInvalidateCacheEntryForSubsequentGet [this=%p uri=%s]\n",
|
||||
this, tmpCacheKey.get()));
|
||||
DoInvalidateCacheEntry(tmpCacheKey);
|
||||
|
||||
// Invalidate Location-header if set
|
||||
const char *location = mResponseHead->PeekHeader(nsHttp::Location);
|
||||
if (location) {
|
||||
LOG((" Location-header=%s\n", location));
|
||||
InvalidateCacheEntryForLocation(location);
|
||||
}
|
||||
|
||||
// Invalidate Content-Location-header if set
|
||||
location = mResponseHead->PeekHeader(nsHttp::Content_Location);
|
||||
if (location) {
|
||||
LOG((" Content-Location-header=%s\n", location));
|
||||
InvalidateCacheEntryForLocation(location);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsHttpChannel::InvalidateCacheEntryForLocation(const char *location)
|
||||
{
|
||||
nsCAutoString tmpCacheKey, tmpSpec;
|
||||
nsCOMPtr<nsIURI> resultingURI;
|
||||
nsresult rv = CreateNewURI(location, getter_AddRefs(resultingURI));
|
||||
if (NS_SUCCEEDED(rv) && HostPartIsTheSame(resultingURI)) {
|
||||
if (NS_SUCCEEDED(resultingURI->GetAsciiSpec(tmpSpec))) {
|
||||
location = tmpSpec.get(); //reusing |location|
|
||||
|
||||
// key for a GET-request to |location| with current load-flags
|
||||
AssembleCacheKey(location, 0, tmpCacheKey);
|
||||
DoInvalidateCacheEntry(tmpCacheKey);
|
||||
} else
|
||||
NS_WARNING((" failed getting ascii-spec\n"));
|
||||
} else {
|
||||
LOG((" hosts not matching\n"));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsHttpChannel::DoInvalidateCacheEntry(nsACString &key)
|
||||
{
|
||||
// NOTE:
|
||||
// Following comments 24,32 and 33 in bug #327765, we only care about
|
||||
// the cache in the protocol-handler.
|
||||
// the cache in the protocol-handler, not the application cache.
|
||||
// The logic below deviates from the original logic in OpenCacheEntry on
|
||||
// one point by using only READ_ONLY access-policy. I think this is safe.
|
||||
LOG(("MaybeInvalidateCacheEntryForSubsequentGet [this=%p]\n", this));
|
||||
|
||||
nsCAutoString tmpCacheKey;
|
||||
// passing 0 in first param gives the cache-key for a GET to my resource
|
||||
GenerateCacheKey(0, tmpCacheKey);
|
||||
|
||||
// Now, find the session holding the cache-entry
|
||||
// First, find session holding the cache-entry - use current storage-policy
|
||||
nsCOMPtr<nsICacheSession> session;
|
||||
nsCacheStoragePolicy storagePolicy = DetermineStoragePolicy();
|
||||
|
||||
nsresult rv;
|
||||
rv = gHttpHandler->GetCacheSession(storagePolicy,
|
||||
getter_AddRefs(session));
|
||||
nsresult rv = gHttpHandler->GetCacheSession(storagePolicy,
|
||||
getter_AddRefs(session));
|
||||
|
||||
if (NS_FAILED(rv)) return;
|
||||
if (NS_FAILED(rv))
|
||||
return;
|
||||
|
||||
// Finally, find the actual cache-entry
|
||||
// Now, find the actual cache-entry
|
||||
nsCOMPtr<nsICacheEntryDescriptor> tmpCacheEntry;
|
||||
rv = session->OpenCacheEntry(tmpCacheKey, nsICache::ACCESS_READ,
|
||||
rv = session->OpenCacheEntry(key, nsICache::ACCESS_READ,
|
||||
PR_FALSE,
|
||||
getter_AddRefs(tmpCacheEntry));
|
||||
|
||||
|
||||
// If entry was found, set its expiration-time = 0
|
||||
if(NS_SUCCEEDED(rv)) {
|
||||
tmpCacheEntry->SetExpirationTime(0);
|
||||
tmpCacheEntry->SetExpirationTime(0);
|
||||
LOG((" cache-entry invalidated [key=%s]\n", key.Data()));
|
||||
} else {
|
||||
LOG((" cache-entry not found [key=%s]\n", key.Data()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -273,6 +273,20 @@ private:
|
||||
*/
|
||||
nsresult Hash(const char *buf, nsACString &hash);
|
||||
|
||||
void InvalidateCacheEntryForLocation(const char *location);
|
||||
void AssembleCacheKey(const char *spec, PRUint32 postID, nsACString &key);
|
||||
nsresult CreateNewURI(const char *loc, nsIURI **newURI);
|
||||
void DoInvalidateCacheEntry(nsACString &key);
|
||||
|
||||
// Ref RFC2616 13.10: "invalidation... MUST only be performed if
|
||||
// the host part is the same as in the Request-URI"
|
||||
inline PRBool HostPartIsTheSame(nsIURI *uri) {
|
||||
nsCAutoString tmpHost1, tmpHost2;
|
||||
return (NS_SUCCEEDED(mURI->GetAsciiHost(tmpHost1)) &&
|
||||
NS_SUCCEEDED(uri->GetAsciiHost(tmpHost2)) &&
|
||||
(tmpHost1 == tmpHost2));
|
||||
}
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsISupports> mSecurityInfo;
|
||||
nsCOMPtr<nsICancelable> mProxyRequest;
|
||||
|
@ -1239,9 +1239,10 @@ nsHttpTransaction::DeleteSelfOnConsumerThread()
|
||||
LOG(("nsHttpTransaction::DeleteSelfOnConsumerThread [this=%x]\n", this));
|
||||
|
||||
PRBool val;
|
||||
if (NS_SUCCEEDED(mConsumerTarget->IsOnCurrentThread(&val)) && val)
|
||||
if (!mConsumerTarget ||
|
||||
(NS_SUCCEEDED(mConsumerTarget->IsOnCurrentThread(&val)) && val)) {
|
||||
delete this;
|
||||
else {
|
||||
} else {
|
||||
LOG(("proxying delete to consumer thread...\n"));
|
||||
nsCOMPtr<nsIRunnable> event = new nsDeleteHttpTransaction(this);
|
||||
if (NS_FAILED(mConsumerTarget->Dispatch(event, NS_DISPATCH_NORMAL)))
|
||||
|
117
netwerk/test/unit/test_bug618835.js
Normal file
117
netwerk/test/unit/test_bug618835.js
Normal file
@ -0,0 +1,117 @@
|
||||
//
|
||||
// If a response to a non-safe HTTP request-method contains the Location- or
|
||||
// Content-Location header, we must make sure to invalidate any cached entry
|
||||
// representing the URIs pointed to by either header. RFC 2616 section 13.10
|
||||
//
|
||||
// This test uses 3 URIs: "/post" is the target of a POST-request and always
|
||||
// redirects (301) to "/redirect". The URIs "/redirect" and "/cl" both counts
|
||||
// the number of loads from the server (handler). The response from "/post"
|
||||
// always contains the headers "Location: /redirect" and "Content-Location:
|
||||
// /cl", whose cached entries are to be invalidated. The tests verifies that
|
||||
// "/redirect" and "/cl" are loaded from server the expected number of times.
|
||||
//
|
||||
do_load_httpd_js();
|
||||
|
||||
var httpserv;
|
||||
|
||||
function getCacheService() {
|
||||
return Components.classes["@mozilla.org/network/cache-service;1"]
|
||||
.getService(Components.interfaces.nsICacheService);
|
||||
}
|
||||
|
||||
function setupChannel(path) {
|
||||
var ios =
|
||||
Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
|
||||
return chan = ios.newChannel(path, "", null)
|
||||
.QueryInterface(Ci.nsIHttpChannel);
|
||||
}
|
||||
|
||||
// Verify that Content-Location-URI has been loaded once, load post_target
|
||||
function InitialListener() { }
|
||||
InitialListener.prototype = {
|
||||
onStartRequest: function(request, context) { },
|
||||
onStopRequest: function(request, context, status) {
|
||||
do_check_eq(1, numberOfCLHandlerCalls);
|
||||
do_execute_soon(function() {
|
||||
var channel = setupChannel("http://localhost:4444/post");
|
||||
channel.requestMethod = "post";
|
||||
channel.asyncOpen(new RedirectingListener(), null);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Verify that Location-URI has been loaded once, reload post_target
|
||||
function RedirectingListener() { }
|
||||
RedirectingListener.prototype = {
|
||||
onStartRequest: function(request, context) { },
|
||||
onStopRequest: function(request, context, status) {
|
||||
do_check_eq(1, numberOfHandlerCalls);
|
||||
do_execute_soon(function() {
|
||||
var channel = setupChannel("http://localhost:4444/post");
|
||||
channel.requestMethod = "post";
|
||||
channel.asyncOpen(new VerifyingListener(), null);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Verify that Location-URI has been loaded twice (cached entry invalidated),
|
||||
// reload Content-Location-URI
|
||||
function VerifyingListener() { }
|
||||
VerifyingListener.prototype = {
|
||||
onStartRequest: function(request, context) { },
|
||||
onStopRequest: function(request, context, status) {
|
||||
do_check_eq(2, numberOfHandlerCalls);
|
||||
var channel = setupChannel("http://localhost:4444/cl");
|
||||
channel.asyncOpen(new FinalListener(), null);
|
||||
}
|
||||
};
|
||||
|
||||
// Verify that Location-URI has been loaded twice (cached entry invalidated),
|
||||
// stop test
|
||||
function FinalListener() { }
|
||||
FinalListener.prototype = {
|
||||
onStartRequest: function(request, context) { },
|
||||
onStopRequest: function(request, context, status) {
|
||||
do_check_eq(2, numberOfCLHandlerCalls);
|
||||
httpserv.stop(do_test_finished);
|
||||
}
|
||||
};
|
||||
|
||||
function run_test() {
|
||||
httpserv = new nsHttpServer();
|
||||
httpserv.registerPathHandler("/cl", content_location);
|
||||
httpserv.registerPathHandler("/post", post_target);
|
||||
httpserv.registerPathHandler("/redirect", redirect_target);
|
||||
httpserv.start(4444);
|
||||
|
||||
// Clear cache
|
||||
getCacheService().evictEntries(
|
||||
Components.interfaces.nsICache.STORE_ANYWHERE);
|
||||
|
||||
// Load Content-Location URI into cache and start the chain of loads
|
||||
var channel = setupChannel("http://localhost:4444/cl");
|
||||
channel.asyncOpen(new InitialListener(), null);
|
||||
|
||||
do_test_pending();
|
||||
}
|
||||
|
||||
var numberOfCLHandlerCalls = 0;
|
||||
function content_location(metadata, response) {
|
||||
numberOfCLHandlerCalls++;
|
||||
response.setStatusLine(metadata.httpVersion, 200, "Ok");
|
||||
response.setHeader("Cache-Control", "max-age=360000", false);
|
||||
}
|
||||
|
||||
function post_target(metadata, response) {
|
||||
response.setStatusLine(metadata.httpVersion, 301, "Moved Permanently");
|
||||
response.setHeader("Location", "/redirect", false);
|
||||
response.setHeader("Content-Location", "/cl", false);
|
||||
response.setHeader("Cache-Control", "max-age=360000", false);
|
||||
}
|
||||
|
||||
var numberOfHandlerCalls = 0;
|
||||
function redirect_target(metadata, response) {
|
||||
numberOfHandlerCalls++;
|
||||
response.setStatusLine(metadata.httpVersion, 200, "Ok");
|
||||
response.setHeader("Cache-Control", "max-age=360000", false);
|
||||
}
|
@ -56,6 +56,7 @@ tail =
|
||||
[test_bug586908.js]
|
||||
[test_bug588389.js]
|
||||
[test_bug596443.js]
|
||||
[test_bug618835.js]
|
||||
[test_bug633743.js]
|
||||
[test_bug652761.js]
|
||||
[test_bug651100.js]
|
||||
|
@ -34,9 +34,6 @@
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
let Cc = Components.classes;
|
||||
let Ci = Components.interfaces;
|
||||
let Cr = Components.results;
|
||||
|
||||
function test_visibility_open()
|
||||
|
@ -341,7 +341,10 @@ function internalSave(aURL, aDocument, aDefaultFileName, aContentDisposition,
|
||||
file: file
|
||||
};
|
||||
|
||||
if (!getTargetFile(fpParams, aSkipPrompt))
|
||||
// Find a URI to use for determining last-downloaded-to directory
|
||||
let relatedURI = aReferrer || sourceURI;
|
||||
|
||||
if (!getTargetFile(fpParams, aSkipPrompt, relatedURI))
|
||||
// If the method returned false this is because the user cancelled from
|
||||
// the save file picker dialog.
|
||||
return;
|
||||
@ -551,10 +554,14 @@ function initFileInfo(aFI, aURL, aURLCharset, aDocument,
|
||||
* If false, don't save the file automatically to the user's
|
||||
* default download directory, even if the associated preference
|
||||
* is set, but ask for the target explicitly.
|
||||
* @param aRelatedURI
|
||||
* An nsIURI associated with the download. The last used
|
||||
* directory of the picker is retrieved from/stored in the
|
||||
* Content Pref Service using this URI.
|
||||
* @return true if the user confirmed a filename in the picker or the picker
|
||||
* was not displayed; false if they dismissed the picker.
|
||||
*/
|
||||
function getTargetFile(aFpP, /* optional */ aSkipPrompt)
|
||||
function getTargetFile(aFpP, /* optional */ aSkipPrompt, /* optional */ aRelatedURI)
|
||||
{
|
||||
if (typeof gDownloadLastDir != "object")
|
||||
Components.utils.import("resource://gre/modules/DownloadLastDir.jsm");
|
||||
@ -587,7 +594,7 @@ function getTargetFile(aFpP, /* optional */ aSkipPrompt)
|
||||
// file picker if it is still valid. Otherwise, keep the default of the
|
||||
// user's default downloads directory. If it doesn't exist, it will be
|
||||
// changed to the user's desktop later.
|
||||
var lastDir = gDownloadLastDir.file;
|
||||
var lastDir = gDownloadLastDir.getFile(aRelatedURI);
|
||||
if (lastDir.exists()) {
|
||||
dir = lastDir;
|
||||
dirExists = true;
|
||||
@ -631,7 +638,7 @@ function getTargetFile(aFpP, /* optional */ aSkipPrompt)
|
||||
|
||||
// Do not store the last save directory as a pref inside the private browsing mode
|
||||
var directory = fp.file.parent.QueryInterface(nsILocalFile);
|
||||
gDownloadLastDir.file = directory;
|
||||
gDownloadLastDir.setFile(aRelatedURI, directory);
|
||||
|
||||
fp.file.leafName = validateFileName(fp.file.leafName);
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Geoff Lankow <geoff@darktrojan.net>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@ -57,13 +58,15 @@ const nsILocalFile = Components.interfaces.nsILocalFile;
|
||||
|
||||
var EXPORTED_SYMBOLS = [ "gDownloadLastDir" ];
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Components.utils.import("resource://gre/modules/Dict.jsm");
|
||||
|
||||
let pbSvc = null;
|
||||
if (PBSVC_CID in Components.classes) {
|
||||
pbSvc = Components.classes[PBSVC_CID]
|
||||
.getService(Components.interfaces.nsIPrivateBrowsingService);
|
||||
}
|
||||
let prefSvc = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
|
||||
let observer = {
|
||||
QueryInterface: function (aIID) {
|
||||
@ -78,13 +81,17 @@ let observer = {
|
||||
case "private-browsing":
|
||||
if (aData == "enter")
|
||||
gDownloadLastDirFile = readLastDirPref();
|
||||
else if (aData == "exit")
|
||||
else if (aData == "exit") {
|
||||
gDownloadLastDirFile = null;
|
||||
gDownloadLastDirStore = new Dict();
|
||||
}
|
||||
break;
|
||||
case "browser:purge-session-history":
|
||||
gDownloadLastDirFile = null;
|
||||
if (prefSvc.prefHasUserValue(LAST_DIR_PREF))
|
||||
prefSvc.clearUserPref(LAST_DIR_PREF);
|
||||
if (Services.prefs.prefHasUserValue(LAST_DIR_PREF))
|
||||
Services.prefs.clearUserPref(LAST_DIR_PREF);
|
||||
gDownloadLastDirStore = new Dict();
|
||||
Services.contentPrefs.removePrefsByName(LAST_DIR_PREF);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -97,7 +104,7 @@ os.addObserver(observer, "browser:purge-session-history", true);
|
||||
|
||||
function readLastDirPref() {
|
||||
try {
|
||||
return prefSvc.getComplexValue(LAST_DIR_PREF, nsILocalFile);
|
||||
return Services.prefs.getComplexValue(LAST_DIR_PREF, nsILocalFile);
|
||||
}
|
||||
catch (e) {
|
||||
return null;
|
||||
@ -105,8 +112,28 @@ function readLastDirPref() {
|
||||
}
|
||||
|
||||
let gDownloadLastDirFile = readLastDirPref();
|
||||
let gDownloadLastDirStore = new Dict();
|
||||
let gDownloadLastDir = {
|
||||
get file() {
|
||||
// compat shims
|
||||
get file() { return this.getFile(); },
|
||||
set file(val) { this.setFile(null, val); },
|
||||
getFile: function (aURI) {
|
||||
if (aURI) {
|
||||
let lastDir;
|
||||
if (pbSvc && pbSvc.privateBrowsingEnabled) {
|
||||
let group = Services.contentPrefs.grouper.group(aURI);
|
||||
lastDir = gDownloadLastDirStore.get(group, null);
|
||||
}
|
||||
if (!lastDir) {
|
||||
lastDir = Services.contentPrefs.getPref(aURI, LAST_DIR_PREF);
|
||||
}
|
||||
if (lastDir) {
|
||||
var lastDirFile = Components.classes["@mozilla.org/file/local;1"]
|
||||
.createInstance(Components.interfaces.nsILocalFile);
|
||||
lastDirFile.initWithPath(lastDir);
|
||||
return lastDirFile;
|
||||
}
|
||||
}
|
||||
if (gDownloadLastDirFile && !gDownloadLastDirFile.exists())
|
||||
gDownloadLastDirFile = null;
|
||||
|
||||
@ -115,17 +142,25 @@ let gDownloadLastDir = {
|
||||
else
|
||||
return readLastDirPref();
|
||||
},
|
||||
set file(val) {
|
||||
setFile: function (aURI, aFile) {
|
||||
if (aURI) {
|
||||
if (pbSvc && pbSvc.privateBrowsingEnabled) {
|
||||
let group = Services.contentPrefs.grouper.group(aURI);
|
||||
gDownloadLastDirStore.set(group, aFile.path);
|
||||
} else {
|
||||
Services.contentPrefs.setPref(aURI, LAST_DIR_PREF, aFile.path);
|
||||
}
|
||||
}
|
||||
if (pbSvc && pbSvc.privateBrowsingEnabled) {
|
||||
if (val instanceof Components.interfaces.nsIFile)
|
||||
gDownloadLastDirFile = val.clone();
|
||||
if (aFile instanceof Components.interfaces.nsIFile)
|
||||
gDownloadLastDirFile = aFile.clone();
|
||||
else
|
||||
gDownloadLastDirFile = null;
|
||||
} else {
|
||||
if (val instanceof Components.interfaces.nsIFile)
|
||||
prefSvc.setComplexValue(LAST_DIR_PREF, nsILocalFile, val);
|
||||
else if (prefSvc.prefHasUserValue(LAST_DIR_PREF))
|
||||
prefSvc.clearUserPref(LAST_DIR_PREF);
|
||||
if (aFile instanceof Components.interfaces.nsIFile)
|
||||
Services.prefs.setComplexValue(LAST_DIR_PREF, nsILocalFile, aFile);
|
||||
else if (Services.prefs.prefHasUserValue(LAST_DIR_PREF))
|
||||
Services.prefs.clearUserPref(LAST_DIR_PREF);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -312,9 +312,13 @@ nsUnknownContentTypeDialog.prototype = {
|
||||
.getService(Components.interfaces.nsIDownloadManager);
|
||||
picker.displayDirectory = dnldMgr.userDownloadsDirectory;
|
||||
|
||||
var relatedURI = null;
|
||||
if (aContext.document)
|
||||
relatedURI = aContext.document.documentURIObject;
|
||||
|
||||
// The last directory preference may not exist, which will throw.
|
||||
try {
|
||||
var lastDir = gDownloadLastDir.file;
|
||||
var lastDir = gDownloadLastDir.getFile(relatedURI);
|
||||
if (isUsableDirectory(lastDir))
|
||||
picker.displayDirectory = lastDir;
|
||||
}
|
||||
@ -343,7 +347,7 @@ nsUnknownContentTypeDialog.prototype = {
|
||||
var newDir = result.parent.QueryInterface(Components.interfaces.nsILocalFile);
|
||||
|
||||
// Do not store the last save directory as a pref inside the private browsing mode
|
||||
gDownloadLastDir.file = newDir;
|
||||
gDownloadLastDir.setFile(relatedURI, newDir);
|
||||
|
||||
result = this.validateLeafName(newDir, result.leafName, null);
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ function run_test()
|
||||
let Cc = Components.classes;
|
||||
let Ci = Components.interfaces;
|
||||
let Cu = Components.utils;
|
||||
do_get_profile();
|
||||
Cu.import("resource://gre/modules/DownloadLastDir.jsm");
|
||||
|
||||
function clearHistory() {
|
||||
|
@ -0,0 +1,232 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is DownloadUtils Test Code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Geoff Lankow <geoff@darktrojan.net>.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/DownloadLastDir.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
do_get_profile();
|
||||
|
||||
function run_test() {
|
||||
function clearHistory() {
|
||||
// simulate clearing the private data
|
||||
Services.obs.notifyObservers(null, "browser:purge-session-history", "");
|
||||
}
|
||||
|
||||
do_check_eq(typeof gDownloadLastDir, "object");
|
||||
do_check_eq(gDownloadLastDir.file, null);
|
||||
|
||||
let tmpDir = Services.dirsvc.get("TmpD", Ci.nsILocalFile);
|
||||
|
||||
let uri1 = Services.io.newURI("http://test1.com/", null, null);
|
||||
let uri2 = Services.io.newURI("http://test2.com/", null, null);
|
||||
let uri3 = Services.io.newURI("http://test3.com/", null, null);
|
||||
let uri4 = Services.io.newURI("http://test4.com/", null, null);
|
||||
|
||||
function newDir() {
|
||||
let dir = tmpDir.clone();
|
||||
dir.append("testdir" + Math.floor(Math.random() * 10000));
|
||||
dir.QueryInterface(Ci.nsILocalFile);
|
||||
dir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0700);
|
||||
return dir;
|
||||
}
|
||||
|
||||
let dir1 = newDir();
|
||||
let dir2 = newDir();
|
||||
let dir3 = newDir();
|
||||
|
||||
try {
|
||||
{ // set up last dir
|
||||
gDownloadLastDir.setFile(null, tmpDir);
|
||||
do_check_eq(gDownloadLastDir.file.path, tmpDir.path);
|
||||
do_check_neq(gDownloadLastDir.file, tmpDir);
|
||||
}
|
||||
|
||||
{ // set uri1 to dir1, all should now return dir1
|
||||
// also check that a new object is returned
|
||||
gDownloadLastDir.setFile(uri1, dir1);
|
||||
do_check_eq(gDownloadLastDir.file.path, dir1.path);
|
||||
do_check_neq(gDownloadLastDir.file, dir1);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, dir1.path); // set in CPS
|
||||
do_check_neq(gDownloadLastDir.getFile(uri1), dir1);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri2).path, dir1.path); // fallback
|
||||
do_check_neq(gDownloadLastDir.getFile(uri2), dir1);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri3).path, dir1.path); // fallback
|
||||
do_check_neq(gDownloadLastDir.getFile(uri3), dir1);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri4).path, dir1.path); // fallback
|
||||
do_check_neq(gDownloadLastDir.getFile(uri4), dir1);
|
||||
}
|
||||
|
||||
{ // set uri2 to dir2, all except uri1 should now return dir2
|
||||
gDownloadLastDir.setFile(uri2, dir2);
|
||||
do_check_eq(gDownloadLastDir.file.path, dir2.path);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, dir1.path); // set in CPS
|
||||
do_check_eq(gDownloadLastDir.getFile(uri2).path, dir2.path); // set in CPS
|
||||
do_check_eq(gDownloadLastDir.getFile(uri3).path, dir2.path); // fallback
|
||||
do_check_eq(gDownloadLastDir.getFile(uri4).path, dir2.path); // fallback
|
||||
}
|
||||
|
||||
{ // set uri3 to dir3, all except uri1 and uri2 should now return dir3
|
||||
gDownloadLastDir.setFile(uri3, dir3);
|
||||
do_check_eq(gDownloadLastDir.file.path, dir3.path);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, dir1.path); // set in CPS
|
||||
do_check_eq(gDownloadLastDir.getFile(uri2).path, dir2.path); // set in CPS
|
||||
do_check_eq(gDownloadLastDir.getFile(uri3).path, dir3.path); // set in CPS
|
||||
do_check_eq(gDownloadLastDir.getFile(uri4).path, dir3.path); // fallback
|
||||
}
|
||||
|
||||
{ // set uri1 to dir2, all except uri3 should now return dir2
|
||||
gDownloadLastDir.setFile(uri1, dir2);
|
||||
do_check_eq(gDownloadLastDir.file.path, dir2.path);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, dir2.path); // set in CPS
|
||||
do_check_eq(gDownloadLastDir.getFile(uri2).path, dir2.path); // set in CPS
|
||||
do_check_eq(gDownloadLastDir.getFile(uri3).path, dir3.path); // set in CPS
|
||||
do_check_eq(gDownloadLastDir.getFile(uri4).path, dir2.path); // fallback
|
||||
}
|
||||
|
||||
{ // check clearHistory removes all data
|
||||
clearHistory();
|
||||
do_check_eq(gDownloadLastDir.file, null);
|
||||
do_check_eq(Services.contentPrefs.hasPref(uri1, "lastDownloadDirectory"), false);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1), null);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri2), null);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri3), null);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri4), null);
|
||||
}
|
||||
|
||||
let pb;
|
||||
try {
|
||||
pb = Cc["@mozilla.org/privatebrowsing;1"].getService(Ci.nsIPrivateBrowsingService);
|
||||
} catch (e) {
|
||||
print("PB service is not available, bail out");
|
||||
return;
|
||||
}
|
||||
|
||||
Services.prefs.setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
||||
|
||||
{ // check data set outside PB mode is remembered
|
||||
gDownloadLastDir.setFile(null, tmpDir);
|
||||
pb.privateBrowsingEnabled = true;
|
||||
do_check_eq(gDownloadLastDir.file.path, tmpDir.path);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, tmpDir.path);
|
||||
|
||||
pb.privateBrowsingEnabled = false;
|
||||
do_check_eq(gDownloadLastDir.file.path, tmpDir.path);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, tmpDir.path);
|
||||
|
||||
clearHistory();
|
||||
}
|
||||
|
||||
{ // check data set using CPS outside PB mode is remembered
|
||||
gDownloadLastDir.setFile(uri1, dir1);
|
||||
pb.privateBrowsingEnabled = true;
|
||||
do_check_eq(gDownloadLastDir.file.path, dir1.path);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, dir1.path);
|
||||
|
||||
pb.privateBrowsingEnabled = false;
|
||||
do_check_eq(gDownloadLastDir.file.path, dir1.path);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, dir1.path);
|
||||
|
||||
clearHistory();
|
||||
}
|
||||
|
||||
{ // check data set inside PB mode is forgotten
|
||||
pb.privateBrowsingEnabled = true;
|
||||
gDownloadLastDir.setFile(null, tmpDir);
|
||||
do_check_eq(gDownloadLastDir.file.path, tmpDir.path);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, tmpDir.path);
|
||||
|
||||
pb.privateBrowsingEnabled = false;
|
||||
do_check_eq(gDownloadLastDir.file, null);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1), null);
|
||||
|
||||
clearHistory();
|
||||
}
|
||||
|
||||
{ // check data set using CPS inside PB mode is forgotten
|
||||
pb.privateBrowsingEnabled = true;
|
||||
gDownloadLastDir.setFile(uri1, dir1);
|
||||
do_check_eq(gDownloadLastDir.file.path, dir1.path);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, dir1.path);
|
||||
|
||||
pb.privateBrowsingEnabled = false;
|
||||
do_check_eq(gDownloadLastDir.file, null);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1), null);
|
||||
|
||||
clearHistory();
|
||||
}
|
||||
|
||||
{ // check data set outside PB mode but changed inside is remembered correctly
|
||||
gDownloadLastDir.setFile(uri1, dir1);
|
||||
pb.privateBrowsingEnabled = true;
|
||||
gDownloadLastDir.setFile(uri1, dir2);
|
||||
do_check_eq(gDownloadLastDir.file.path, dir2.path);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, dir2.path);
|
||||
|
||||
pb.privateBrowsingEnabled = false;
|
||||
do_check_eq(gDownloadLastDir.file.path, dir1.path);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, dir1.path);
|
||||
|
||||
// check that the last dir store got cleared
|
||||
pb.privateBrowsingEnabled = true;
|
||||
do_check_eq(gDownloadLastDir.file.path, dir1.path);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1).path, dir1.path);
|
||||
|
||||
pb.privateBrowsingEnabled = false;
|
||||
clearHistory();
|
||||
}
|
||||
|
||||
{ // check clearHistory inside PB mode clears data outside PB mode
|
||||
pb.privateBrowsingEnabled = true;
|
||||
gDownloadLastDir.setFile(uri1, dir2);
|
||||
|
||||
clearHistory();
|
||||
do_check_eq(gDownloadLastDir.file, null);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1), null);
|
||||
|
||||
pb.privateBrowsingEnabled = false;
|
||||
do_check_eq(gDownloadLastDir.file, null);
|
||||
do_check_eq(gDownloadLastDir.getFile(uri1), null);
|
||||
}
|
||||
} finally {
|
||||
dir1.remove(true);
|
||||
dir2.remove(true);
|
||||
dir3.remove(true);
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@ head =
|
||||
tail =
|
||||
|
||||
[test_DownloadLastDir.js]
|
||||
[test_DownloadLastDirWithCPS.js]
|
||||
[test_DownloadPaths.js]
|
||||
[test_DownloadUtils.js]
|
||||
[test_lowMinutes.js]
|
||||
|
@ -2821,6 +2821,22 @@ var gDetailView = {
|
||||
if (this._addon.optionsType != AddonManager.OPTIONS_TYPE_INLINE)
|
||||
return;
|
||||
|
||||
// This function removes and returns the text content of aNode without
|
||||
// removing any child elements. Removing the text nodes ensures any XBL
|
||||
// bindings apply properly.
|
||||
function stripTextNodes(aNode) {
|
||||
var text = '';
|
||||
for (var i = 0; i < aNode.childNodes.length; i++) {
|
||||
if (aNode.childNodes[i].nodeType != document.ELEMENT_NODE) {
|
||||
text += aNode.childNodes[i].textContent;
|
||||
aNode.removeChild(aNode.childNodes[i--]);
|
||||
} else {
|
||||
text += stripTextNodes(aNode.childNodes[i]);
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
var rows = document.getElementById("detail-downloads").parentNode;
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
@ -2830,39 +2846,21 @@ var gDetailView = {
|
||||
var xml = xhr.responseXML;
|
||||
var settings = xml.querySelectorAll(":root > setting");
|
||||
|
||||
// This horrible piece of code fixes two problems. 1) The menulist binding doesn't apply
|
||||
// correctly when it's moved from one document to another (bug 659163), which is solved
|
||||
// by manually cloning the menulist. 2) Labels and controls aligned to the top of a row
|
||||
// looks really bad, so the description is put on a new row to preserve alignment.
|
||||
for (var i = 0; i < settings.length; i++) {
|
||||
var setting = settings[i];
|
||||
if (i == 0)
|
||||
setting.setAttribute("first-row", true);
|
||||
|
||||
// remove menulist controls for replacement later
|
||||
var control = setting.firstElementChild;
|
||||
if (setting.getAttribute("type") == "control" && control && control.localName == "menulist") {
|
||||
setting.removeChild(control);
|
||||
var consoleMessage = Cc["@mozilla.org/scripterror;1"].
|
||||
createInstance(Ci.nsIScriptError);
|
||||
consoleMessage.init("Menulist is not available in the addons-manager yet, due to bug 659163",
|
||||
this._addon.optionsURL, null, null, 0, Ci.nsIScriptError.warningFlag, null);
|
||||
Services.console.logMessage(consoleMessage);
|
||||
continue;
|
||||
}
|
||||
|
||||
// remove setting description, for replacement later
|
||||
var desc = setting.textContent.trim();
|
||||
if (desc)
|
||||
setting.textContent = "";
|
||||
// Remove setting description, for replacement later
|
||||
var desc = stripTextNodes(setting).trim();
|
||||
if (setting.hasAttribute("desc")) {
|
||||
desc = setting.getAttribute("desc");
|
||||
desc = setting.getAttribute("desc").trim();
|
||||
setting.removeAttribute("desc");
|
||||
}
|
||||
|
||||
rows.appendChild(setting);
|
||||
|
||||
// add a new row containing the description
|
||||
// Add a new row containing the description
|
||||
if (desc) {
|
||||
var row = document.createElement("row");
|
||||
var label = document.createElement("label");
|
||||
@ -2872,6 +2870,8 @@ var gDetailView = {
|
||||
rows.appendChild(row);
|
||||
}
|
||||
}
|
||||
|
||||
Services.obs.notifyObservers(document, "addon-options-displayed", this._addon.id);
|
||||
},
|
||||
|
||||
getSelectedAddon: function() {
|
||||
|
@ -5,11 +5,11 @@
|
||||
<setting pref="extensions.inlinesettings1.integer" type="integer" title="Integer"/>
|
||||
<setting pref="extensions.inlinesettings1.string" type="string" title="String"/>
|
||||
<setting type="control" title="Menulist">
|
||||
<menulist sizetopopup="always">
|
||||
<menulist sizetopopup="always" oncommand="window._testValue = this.value;">
|
||||
<menupopup>
|
||||
<menuitem label="Test 1" value="1" />
|
||||
<menuitem label="Test 2" value="2" />
|
||||
<menuitem label="Test 3" value="3" />
|
||||
<menuitem label="Alpha" value="1" />
|
||||
<menuitem label="Bravo" value="2" />
|
||||
<menuitem label="Charlie" value="3" />
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</setting>
|
||||
|
@ -8,6 +8,16 @@ var gManagerWindow;
|
||||
var gCategoryUtilities;
|
||||
var gProvider;
|
||||
|
||||
const SETTINGS_ROWS = 5;
|
||||
|
||||
var observer = {
|
||||
lastData: null,
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "addon-options-displayed")
|
||||
this.lastData = aData;
|
||||
}
|
||||
};
|
||||
|
||||
function installAddon(aCallback) {
|
||||
AddonManager.getInstallForURL(TESTROOT + "addons/browser_inlinesettings1.xpi",
|
||||
function(aInstall) {
|
||||
@ -43,12 +53,16 @@ function test() {
|
||||
gManagerWindow = aWindow;
|
||||
gCategoryUtilities = new CategoryUtilities(gManagerWindow);
|
||||
|
||||
Services.obs.addObserver(observer, "addon-options-displayed", false);
|
||||
|
||||
run_next_test();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function end_test() {
|
||||
Services.obs.removeObserver(observer, "addon-options-displayed");
|
||||
|
||||
close_manager(gManagerWindow, function() {
|
||||
AddonManager.getAddonByID("inlinesettings1@tests.mozilla.org", function(aAddon) {
|
||||
aAddon.uninstall();
|
||||
@ -102,9 +116,11 @@ add_test(function() {
|
||||
EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
|
||||
|
||||
wait_for_view_load(gManagerWindow, function() {
|
||||
is(observer.lastData, "inlinesettings1@tests.mozilla.org", "Observer notification should have fired");
|
||||
|
||||
var grid = gManagerWindow.document.getElementById("detail-grid");
|
||||
var settings = grid.querySelectorAll("rows > setting");
|
||||
is(settings.length, 4, "Grid should have settings children");
|
||||
is(settings.length, SETTINGS_ROWS, "Grid should have settings children");
|
||||
|
||||
// Force bindings to apply
|
||||
settings[0].clientTop;
|
||||
@ -151,10 +167,24 @@ add_test(function() {
|
||||
is(input.value, "bar", "Text box should have updated value");
|
||||
is(Services.prefs.getCharPref("extensions.inlinesettings1.string"), "bar", "String pref should have been updated");
|
||||
|
||||
var button = gManagerWindow.document.getElementById("detail-prefs-btn");
|
||||
is_element_hidden(button, "Preferences button should not be visible");
|
||||
var input = settings[4].firstElementChild;
|
||||
is(input.value, "1", "Menulist should have initial value");
|
||||
input.focus();
|
||||
EventUtils.synthesizeKey("b", {}, gManagerWindow);
|
||||
is(input.value, "2", "Menulist should have updated value");
|
||||
is(gManagerWindow._testValue, "2", "Menulist oncommand handler should've updated the test value");
|
||||
|
||||
gCategoryUtilities.openType("extension", run_next_test);
|
||||
setTimeout(function () {
|
||||
EventUtils.synthesizeKey("c", {}, gManagerWindow);
|
||||
is(input.value, "3", "Menulist should have updated value");
|
||||
is(gManagerWindow._testValue, "3", "Menulist oncommand handler should've updated the test value");
|
||||
delete gManagerWindow._testValue;
|
||||
|
||||
var button = gManagerWindow.document.getElementById("detail-prefs-btn");
|
||||
is_element_hidden(button, "Preferences button should not be visible");
|
||||
|
||||
gCategoryUtilities.openType("extension", run_next_test);
|
||||
}, 1200); // Timeout value from toolkit/content/tests/widgets/test_menulist_keynav.xul
|
||||
});
|
||||
});
|
||||
|
||||
@ -167,9 +197,11 @@ add_test(function() {
|
||||
EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
|
||||
|
||||
wait_for_view_load(gManagerWindow, function() {
|
||||
is(observer.lastData, "inlinesettings2@tests.mozilla.org", "Observer notification should have fired");
|
||||
|
||||
var grid = gManagerWindow.document.getElementById("detail-grid");
|
||||
var settings = grid.querySelectorAll("rows > setting");
|
||||
is(settings.length, 2, "Grid should have settings children");
|
||||
is(settings.length, 3, "Grid should have settings children");
|
||||
|
||||
// Force bindings to apply
|
||||
settings[0].clientTop;
|
||||
@ -192,6 +224,17 @@ add_test(function() {
|
||||
is(node.nodeName, "row", "Setting should be followed by a row node");
|
||||
is(node.textContent, "Description Text Node", "Description should be in this row");
|
||||
|
||||
node = settings[2];
|
||||
is(node.nodeName, "setting", "Should be a setting node");
|
||||
description = gManagerWindow.document.getAnonymousElementByAttribute(node, "class", "preferences-description");
|
||||
is(description.textContent.trim(), "", "Description node should be empty");
|
||||
var button = node.firstElementChild;
|
||||
isnot(button, null, "There should be a button");
|
||||
|
||||
node = node.nextSibling;
|
||||
is(node.nodeName, "row", "Setting should be followed by a row node");
|
||||
is(node.textContent.trim(), "This is a test, all this text should be visible", "Description should be in this row");
|
||||
|
||||
var button = gManagerWindow.document.getElementById("detail-prefs-btn");
|
||||
is_element_hidden(button, "Preferences button should not be visible");
|
||||
|
||||
@ -208,6 +251,8 @@ add_test(function() {
|
||||
EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
|
||||
|
||||
wait_for_view_load(gManagerWindow, function() {
|
||||
is(observer.lastData, "inlinesettings2@tests.mozilla.org", "Observer notification should not have fired");
|
||||
|
||||
var grid = gManagerWindow.document.getElementById("detail-grid");
|
||||
var settings = grid.querySelectorAll("rows > setting");
|
||||
is(settings.length, 0, "Grid should not have settings children");
|
||||
@ -230,7 +275,7 @@ add_test(function() {
|
||||
wait_for_view_load(gManagerWindow, function() {
|
||||
var grid = gManagerWindow.document.getElementById("detail-grid");
|
||||
var settings = grid.querySelectorAll("rows > setting");
|
||||
is(settings.length, 4, "Grid should have settings children");
|
||||
is(settings.length, SETTINGS_ROWS, "Grid should have settings children");
|
||||
|
||||
// disable
|
||||
var button = gManagerWindow.document.getElementById("detail-disable-btn");
|
||||
@ -259,7 +304,7 @@ add_test(function() {
|
||||
EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
|
||||
|
||||
settings = grid.querySelectorAll("rows > setting");
|
||||
is(settings.length, 4, "Grid should have settings children");
|
||||
is(settings.length, SETTINGS_ROWS, "Grid should have settings children");
|
||||
|
||||
gCategoryUtilities.openType("extension", run_next_test);
|
||||
});
|
||||
|
@ -2,7 +2,6 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
Components.utils.import("resource://gre/modules/AddonManager.jsm");
|
||||
Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
var pathParts = gTestPath.split("/");
|
||||
|
@ -2,4 +2,7 @@
|
||||
<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<setting pref="extensions.inlinesettings2.bool1" type="bool" title="Bool 1" desc="Description Attribute"/>
|
||||
<setting pref="extensions.inlinesettings2.bool2" type="bool" title="Bool 2">Description Text Node</setting>
|
||||
<setting type="control" title="Button">
|
||||
This is a test, <button label="button" />all this text should be visible
|
||||
</setting>
|
||||
</vbox>
|
||||
|
@ -26,8 +26,6 @@ function extractChromeRoot(path) {
|
||||
return chromeRootPath;
|
||||
}
|
||||
|
||||
Components.utils.import("resource://gre/modules/AddonManager.jsm");
|
||||
|
||||
/**
|
||||
* This is a test harness designed to handle responding to UI during the process
|
||||
* of installing an XPI. A test can set callbacks to hear about specific parts
|
||||
@ -362,12 +360,7 @@ var Harness = {
|
||||
}
|
||||
},
|
||||
|
||||
QueryInterface: function(iid) {
|
||||
if (iid.equals(Components.interfaces.nsIObserver) ||
|
||||
iid.equals(Components.interfaces.nsIWindowMediatorListener) ||
|
||||
iid.equals(Components.interfaces.nsISupports))
|
||||
return this;
|
||||
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
|
||||
Ci.nsIWindowMediatorListener,
|
||||
Ci.nsISupports])
|
||||
}
|
||||
|
@ -389,19 +389,23 @@ NON_OMNIJAR_FILES += \
|
||||
PACK_OMNIJAR = \
|
||||
rm -f omni.jar components/binary.manifest && \
|
||||
grep -h '^binary-component' components/*.manifest > binary.manifest ; \
|
||||
sed -e 's/^binary-component/\#binary-component/' components/components.manifest > components.manifest && \
|
||||
mv components.manifest components && \
|
||||
zip -r9m omni.jar $(OMNIJAR_FILES) -x $(NON_OMNIJAR_FILES) && \
|
||||
for m in components/*.manifest; do \
|
||||
sed -e 's/^binary-component/\#binary-component/' $$m > tmp.manifest && \
|
||||
mv tmp.manifest $$m; \
|
||||
done; \
|
||||
$(ZIP) -r9m omni.jar $(OMNIJAR_FILES) -x $(NON_OMNIJAR_FILES) && \
|
||||
$(GENERATE_CACHE) && \
|
||||
$(OPTIMIZE_JARS_CMD) --optimize $(JARLOG_DIR_AB_CD) ./ ./ && \
|
||||
mv binary.manifest components && \
|
||||
printf "manifest components/binary.manifest\n" > chrome.manifest
|
||||
UNPACK_OMNIJAR = \
|
||||
$(OPTIMIZE_JARS_CMD) --deoptimize $(JARLOG_DIR_AB_CD) ./ ./ && \
|
||||
unzip -o omni.jar && \
|
||||
$(UNZIP) -o omni.jar && \
|
||||
rm -f components/binary.manifest && \
|
||||
sed -e 's/^\#binary-component/binary-component/' components/components.manifest > components.manifest && \
|
||||
mv components.manifest components
|
||||
for m in components/*.manifest; do \
|
||||
sed -e 's/^\#binary-component/binary-component/' $$m > tmp.manifest && \
|
||||
mv tmp.manifest $$m; \
|
||||
done
|
||||
|
||||
MAKE_PACKAGE = (cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH) && $(PACK_OMNIJAR)) && \
|
||||
(cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH) && $(CREATE_PRECOMPLETE_CMD)) && $(INNER_MAKE_PACKAGE)
|
||||
|
@ -56,7 +56,8 @@ DEFINES += \
|
||||
-DNS_NO_XPCOM \
|
||||
$(NULL)
|
||||
|
||||
ifndef ANDROID
|
||||
# Android doesn't build the updater binary, so it skips the things that test it.
|
||||
ifneq ($(OS_TARGET),Android)
|
||||
DIRS = \
|
||||
chrome \
|
||||
$(NULL)
|
||||
@ -89,9 +90,11 @@ ifeq ($(OS_ARCH),WINNT)
|
||||
USE_STATIC_LIBS = 1
|
||||
DEFINES += -DUNICODE -D_UNICODE
|
||||
endif
|
||||
endif # Not Android
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ifneq ($(OS_TARGET),Android)
|
||||
# TestAUSReadStrings runs during check in the following directory with a Unicode
|
||||
# char in order to test bug 473417 on Windows.
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
@ -107,14 +110,14 @@ check::
|
||||
done
|
||||
$(INSTALL) $(FINAL_TARGET)/TestAUSReadStrings$(BIN_SUFFIX) $(DEPTH)/_tests/updater/$(bug473417dir)/
|
||||
@$(RUN_TEST_PROGRAM) $(DEPTH)/_tests/updater/$(bug473417dir)/TestAUSReadStrings$(BIN_SUFFIX)
|
||||
endif # ANDROID
|
||||
endif # Not Android
|
||||
|
||||
libs:: unit/head_update.js.in
|
||||
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $^ > $(TESTROOT)/unit/head_update.js
|
||||
|
||||
ifndef ANDROID
|
||||
ifneq ($(OS_TARGET),Android)
|
||||
ifndef MOZ_PROFILE_GENERATE
|
||||
libs::
|
||||
$(INSTALL) TestAUSHelper$(BIN_SUFFIX) $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit
|
||||
endif
|
||||
endif # ANDROID
|
||||
endif # Not Android
|
||||
|
@ -1124,7 +1124,7 @@ setting[type="control"] menulist {
|
||||
|
||||
.addon-control:active:hover,
|
||||
setting[type="control"] button:active:hover,
|
||||
setting[type="control"] menulist:hover {
|
||||
setting[type="control"] menulist:active:hover {
|
||||
box-shadow: inset 0 1px 3px rgba(0,0,0,.2), 0 1px rgba(255,255,255,0.25);
|
||||
background-image: -moz-linear-gradient(rgba(45,54,71,0.3), rgba(45,54,71,0.1));
|
||||
border-color: rgba(60,73,97,0.7);
|
||||
|
@ -1168,7 +1168,7 @@ setting[type="control"] menulist {
|
||||
|
||||
.addon-control:active:hover,
|
||||
setting[type="control"] button:active:hover,
|
||||
setting[type="control"] menulist:hover {
|
||||
setting[type="control"] menulist:active:hover {
|
||||
background-color: rgba(61, 76, 92, 0.2);
|
||||
border-color: rgba(39, 53, 68, 0.5);
|
||||
box-shadow: 0 0 3px 1px rgba(39, 53, 68, 0.2) inset;
|
||||
|
Loading…
Reference in New Issue
Block a user