diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index d9681f64a14f..2efecf27b1a8 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -308,6 +308,12 @@ pref("browser.urlbar.suggest.history.onlyTyped", false); pref("browser.urlbar.formatting.enabled", true); pref("browser.urlbar.trimURLs", true); +#if defined(NIGHTLY_BUILD) +pref("browser.urlbar.oneOffSearches", true); +#else +pref("browser.urlbar.oneOffSearches", false); +#endif + pref("browser.altClickSave", false); // Enable logging downloads operations to the Console. diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 51eb4077f029..b137c4235db2 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -152,14 +152,7 @@ noautofocus="true" hidden="true" flip="none" - level="parent"> -#ifdef NIGHTLY_BUILD - - + + +

foobar

+ +
+ diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-03.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-03.html new file mode 100644 index 000000000000..4ff4cc6b0bae --- /dev/null +++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-03.html @@ -0,0 +1,20 @@ + + + +Script changing @charset + + + +
+ diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html new file mode 100644 index 000000000000..2f3ce2368d3f --- /dev/null +++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html @@ -0,0 +1,12 @@ + + +Script is not executed after script thread is shutdown + diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html new file mode 100644 index 000000000000..704e8ed366f2 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html @@ -0,0 +1,18 @@ + + +Script is not executed after script thread is shutdown + + + + diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js new file mode 100644 index 000000000000..ccdf14c0cd47 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js @@ -0,0 +1 @@ +script_executed(); diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/remove-row.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/remove-row.html new file mode 100644 index 000000000000..b0e529f91ec8 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/remove-row.html @@ -0,0 +1,50 @@ + + +Delete Row tests + + + + + + + + + + + + + + + + + + +
First columnSecond column
1.11.2
2.12.2
+ + diff --git a/testing/web-platform/tests/html/tools/update_html5lib_tests.py b/testing/web-platform/tests/html/tools/update_html5lib_tests.py index ae08e82d3e41..2235ddffd1b5 100644 --- a/testing/web-platform/tests/html/tools/update_html5lib_tests.py +++ b/testing/web-platform/tests/html/tools/update_html5lib_tests.py @@ -100,7 +100,7 @@ def write_test_file(script_dir, out_dir, tests, file_name, template_file_name): file_name = os.path.join(out_dir, file_name + ".html") short_name = os.path.split(file_name)[1] - with open(os.path.join(script_dir, template_file_name)) as f: + with open(os.path.join(script_dir, template_file_name), "r") as f: template = MarkupTemplate(f) stream = template.generate(file_name=short_name, tests=tests) diff --git a/testing/web-platform/tests/lint.whitelist b/testing/web-platform/tests/lint.whitelist index debd9f5a8a51..231a9cf50bbd 100644 --- a/testing/web-platform/tests/lint.whitelist +++ b/testing/web-platform/tests/lint.whitelist @@ -26,6 +26,7 @@ INDENT TABS: webaudio/* INDENT TABS: webvtt/* INDENT TABS: XMLHttpRequest/* INDENT TABS: encoding/legacy*/* +INDENT TABS: encrypted-media/polyfill/Makefile TRAILING WHITESPACE: app-uri/* TRAILING WHITESPACE: battery-status/* @@ -109,6 +110,10 @@ CONSOLE:service-workers/service-worker/resources/navigation-redirect-other-origi CONSOLE:service-workers/service-worker/navigation-redirect.https.html CONSOLE:service-workers/service-worker/resources/clients-get-other-origin.html +# use of console in a public library - annotation-model ensures +# it is not actually used +CONSOLE:annotation-model/scripts/ajv.min.js + # Lint doesn't know about sub.svg I guess PARSE-FAILED:content-security-policy/svg/including.sub.svg diff --git a/testing/web-platform/tests/mixed-content/generic/tools/common_paths.py b/testing/web-platform/tests/mixed-content/generic/tools/common_paths.py index 19457475e524..5c2807d2834f 100644 --- a/testing/web-platform/tests/mixed-content/generic/tools/common_paths.py +++ b/testing/web-platform/tests/mixed-content/generic/tools/common_paths.py @@ -24,7 +24,7 @@ test_file_path_pattern = '%(spec_name)s/' + selection_pattern + \ def get_template(basename): - with open(os.path.join(template_directory, basename)) as f: + with open(os.path.join(template_directory, basename), "r") as f: return f.read() @@ -45,7 +45,7 @@ def load_spec_json(path_to_spec = None): path_to_spec = spec_filename re_error_location = re.compile('line ([0-9]+) column ([0-9]+)') - with open(path_to_spec) as f: + with open(path_to_spec, "r") as f: try: return json.load(f) except ValueError, ex: diff --git a/testing/web-platform/tests/payment-request/OWNERS b/testing/web-platform/tests/payment-request/OWNERS new file mode 100644 index 000000000000..35ae0f6c00b5 --- /dev/null +++ b/testing/web-platform/tests/payment-request/OWNERS @@ -0,0 +1 @@ +@halindrome diff --git a/testing/web-platform/tests/pointerevents/OWNERS b/testing/web-platform/tests/pointerevents/OWNERS index af346a9323f0..48ad3aa0ba7a 100644 --- a/testing/web-platform/tests/pointerevents/OWNERS +++ b/testing/web-platform/tests/pointerevents/OWNERS @@ -5,3 +5,4 @@ @plehegar @scottgonzalez @staktrace +@RByers diff --git a/testing/web-platform/tests/pointerevents/README.md b/testing/web-platform/tests/pointerevents/README.md index 07004cf4eace..0cc01909796f 100644 --- a/testing/web-platform/tests/pointerevents/README.md +++ b/testing/web-platform/tests/pointerevents/README.md @@ -1,6 +1,6 @@ Directory for Pointer Events Tests -Latest Editor's Draft: https://dvcs.w3.org/hg/pointerevents/raw-file/tip/pointerEvents.html +Latest Editor's Draft: https://w3c.github.io/pointerevents/ Latest W3C Technical Report: http://www.w3.org/TR/pointerevents/ diff --git a/testing/web-platform/tests/pointerevents/pointerevent_properties_mouse-manual.html b/testing/web-platform/tests/pointerevents/pointerevent_attributes_mouse-manual.html similarity index 67% rename from testing/web-platform/tests/pointerevents/pointerevent_properties_mouse-manual.html rename to testing/web-platform/tests/pointerevents/pointerevent_attributes_mouse-manual.html index adea65b259da..05fad120282b 100644 --- a/testing/web-platform/tests/pointerevents/pointerevent_properties_mouse-manual.html +++ b/testing/web-platform/tests/pointerevents/pointerevent_attributes_mouse-manual.html @@ -11,7 +11,7 @@ - - - - -

Button attribute test for mouse

-

This test is for mouse only

-

- Test Description: This test checks if button attribute for mouse handled properly. -

Put your mouse over the black rectangle

-

-

-

- -

Pointer Events button attribute test for mouse test

-
-

The following pointer types were detected: .

-
-
- - \ No newline at end of file diff --git a/testing/web-platform/tests/pointerevents/pointerevent_multiple_primary_pointers_boundary_events-manual.html b/testing/web-platform/tests/pointerevents/pointerevent_multiple_primary_pointers_boundary_events-manual.html new file mode 100644 index 000000000000..eb758c707387 --- /dev/null +++ b/testing/web-platform/tests/pointerevents/pointerevent_multiple_primary_pointers_boundary_events-manual.html @@ -0,0 +1,145 @@ + + + + Pointer Event: Boundary compatibility events for multiple primary pointers + + + + + + + + + + + +

Pointer Event: Boundary compatibility events for multiple primary pointers

+

+ When more than one primary pointers are active, each will have an independent sequence of pointer boundary events but the compatibilty mouse boundary events have their own sequence. +

+ Instruction: +
    +
  1. Move the mouse directly into Target0 (without going through Target1), and then leave the mouse there unmoved.
  2. +
  3. Tap directly on Target1 with a finger or a stylus, and then lift the finger/stylus off the screen/digitizer without crossing Target1 boundary.
  4. +
  5. Move the mouse into Target0 (if not there already) and move inside it.
  6. +
  7. Click Done (without passing over Target1).
  8. +
+
+ Done +
+
+ Target0 +
+
+ Target1 +
+
+

The following pointer types were detected: .

+

The following events were logged: .

+
+
+ + diff --git a/testing/web-platform/tests/pointerevents/pointerevent_pointerId_scope-manual.html b/testing/web-platform/tests/pointerevents/pointerevent_pointerId_scope-manual.html new file mode 100644 index 000000000000..3640cb6f6bba --- /dev/null +++ b/testing/web-platform/tests/pointerevents/pointerevent_pointerId_scope-manual.html @@ -0,0 +1,82 @@ + + + + + Pointer Events pointerdown tests + + + + + + + + + +

Pointer Events pointerdown tests

+ Complete the following actions: +
    +
  1. Start with your pointing device outside of black box, then move it into black box. If using touch just press in black box and don't release. +
  2. Move your pointing device into purple box (without leaving the digitizer range if you are using hover supported pen or without releasing touch if using touch). Then move it out of the purple box. +
+
+
+ +
+

The following pointer types were detected: .

+

Refresh the page to run the tests again with a different pointer type.

+
+
+ + diff --git a/testing/web-platform/tests/pointerevents/pointerevent_styles.css b/testing/web-platform/tests/pointerevents/pointerevent_styles.css index 70b037a9dda0..d2acf940dc83 100644 --- a/testing/web-platform/tests/pointerevents/pointerevent_styles.css +++ b/testing/web-platform/tests/pointerevents/pointerevent_styles.css @@ -31,6 +31,17 @@ overflow-y: auto; overflow-x: auto; } +.touchActionNone { +touch-action: none; +} + +#innerframe { +width: 90%; +margin: 10px; +margin-left: 10%; +height: 200px; +} + .scroller { width: 700px; height: 430px; @@ -66,6 +77,10 @@ display: none; font-weight: bold; } +#event-log { +font-weight: bold; +} + #listener { background: orange; border: 1px solid orange; diff --git a/testing/web-platform/tests/pointerevents/pointerevent_support.js b/testing/web-platform/tests/pointerevents/pointerevent_support.js index b3fb661f8b74..4067d53dd5da 100644 --- a/testing/web-platform/tests/pointerevents/pointerevent_support.js +++ b/testing/web-platform/tests/pointerevents/pointerevent_support.js @@ -13,9 +13,10 @@ var All_Pointer_Events = [ // Check for conformance to PointerEvent interface // TA: 1.1, 1.2, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 1.12, 1.13 function check_PointerEvent(event) { + var pointerTestName = event.pointerType + ' ' + event.type; test(function () { assert_true(event instanceof PointerEvent, "event is a PointerEvent event"); - }, event.type + " event is a PointerEvent event"); + }, pointerTestName + " event is a PointerEvent event"); // Check attributes for conformance to WebIDL: @@ -37,31 +38,37 @@ function check_PointerEvent(event) { ["readonly", "long", "tiltX"], ["readonly", "long", "tiltY"], ["readonly", "string", "pointerType"], - ["readonly", "boolean", "isPrimary"] + ["readonly", "boolean", "isPrimary"], + ["readonly", "long", "detail", 0] ].forEach(function (attr) { var readonly = attr[0]; var type = attr[1]; var name = attr[2]; - + var value = attr[3]; // existence check test(function () { assert_true(name in event, name + " attribute in " + event.type + " event"); - }, event.type + "." + name + " attribute exists"); - + }, pointerTestName + "." + name + " attribute exists"); // readonly check if (readonly === "readonly") { test(function () { assert_readonly(event.type, name, event.type + "." + name + " cannot be changed"); - }, event.type + "." + name + " is readonly"); + }, pointerTestName + "." + name + " is readonly"); } - // type check test(function () { assert_true(idl_type_check[type](event[name]), name + " attribute of type " + type); - }, event.type + "." + name + " IDL type " + type + " (JS type was " + typeof event[name] + ")"); + }, pointerTestName + "." + name + " IDL type " + type + " (JS type was " + typeof event[name] + ")"); + + // value check if defined + if (value != undefined) { + test(function () { + assert_equals(event[name], value, name + " attribute value"); + }, pointerTestName + "." + name + " value is " + value + "."); + } }); @@ -81,7 +88,7 @@ function check_PointerEvent(event) { assert_equals(event.pressure, 0.5, "pressure is 0.5 for mouse with a button pressed"); } } - }, event.type + ".pressure value is valid"); + }, pointerTestName + ".pressure value is valid"); // Check mouse-specific properties @@ -91,7 +98,7 @@ function check_PointerEvent(event) { assert_equals(event.tiltX, 0, event.type + ".tiltX is 0 for mouse"); assert_equals(event.tiltY, 0, event.type + ".tiltY is 0 for mouse"); assert_true(event.isPrimary, event.type + ".isPrimary is true for mouse"); - }, event.type + " properties for pointerType = mouse"); + }, pointerTestName + " properties for pointerType = mouse"); // Check properties for pointers other than mouse } } @@ -105,6 +112,14 @@ function showPointerTypes() { complete_notice.style.display = "block"; } +function showLoggedEvents() { + var event_log_elem = document.getElementById("event-log"); + event_log_elem.innerHTML = event_log.length ? event_log.join(", ") : "(none)"; + + var complete_notice = document.getElementById("complete-notice"); + complete_notice.style.display = "block"; +} + function log(msg, el) { if (++count > 10){ count = 0; @@ -167,4 +182,4 @@ function rPointerCapture(e) { } catch(e) { } -} \ No newline at end of file +} diff --git a/testing/web-platform/tests/pointerevents/pointerevent_suppress_compat_events_on_click.html b/testing/web-platform/tests/pointerevents/pointerevent_suppress_compat_events_on_click.html new file mode 100644 index 000000000000..71b8a08289ad --- /dev/null +++ b/testing/web-platform/tests/pointerevents/pointerevent_suppress_compat_events_on_click.html @@ -0,0 +1,101 @@ + + + + Pointer Event: Suppress compatibility mouse events on click + + + + + + + + + + + +

Pointer Event: Suppress compatibility mouse events on click

+

+ When a pointerdown is canceled, a click/tap shouldn't fire any compatibility mouse events. +

+
    +
  1. Click or tap on Target0.
  2. +
  3. Click or tap on Target1.
  4. +
  5. Click Done.
  6. +
+
+ Target0 +
+
+ Target1 +
+
+ Done +
+
+

The following pointer types were detected: .

+

The following events were logged: .

+
+
+ + diff --git a/testing/web-platform/tests/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse.html b/testing/web-platform/tests/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse.html new file mode 100644 index 000000000000..02bca85008e9 --- /dev/null +++ b/testing/web-platform/tests/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse.html @@ -0,0 +1,114 @@ + + + + Pointer Event: Suppress compatibility mouse events on drag + + + + + + + + + + + +

Pointer Event: Suppress compatibility mouse events on drag

+

+ When a pointerdown is canceled, a mouse drag shouldn't fire any compatibility mouse events. +

+
    +
  1. Drag mouse within Target0 & release.
  2. +
  3. Drag mouse within Target1 & release.
  4. +
  5. Click Done.
  6. +
+
+ Target0 +
+
+ Target1 +
+
+ Done +
+
+

The following pointer types were detected: .

+

The following events were logged: .

+
+
+ + diff --git a/testing/web-platform/tests/pointerevents/pointerevent_touch-action-button-test_touch-manual.html b/testing/web-platform/tests/pointerevents/pointerevent_touch-action-button-test_touch-manual.html index 01a1c88c1818..c57f869ef63b 100644 --- a/testing/web-platform/tests/pointerevents/pointerevent_touch-action-button-test_touch-manual.html +++ b/testing/web-platform/tests/pointerevents/pointerevent_touch-action-button-test_touch-manual.html @@ -30,7 +30,7 @@

Test Description: Try to scroll black element DOWN moving your touch outside of the red border. Wait for description update.

Note: this test is for touch only

- +

@@ -106,4 +106,4 @@
- \ No newline at end of file + diff --git a/testing/web-platform/tests/pointerevents/pointerevent_touch-action-svg-test_touch-manual.html b/testing/web-platform/tests/pointerevents/pointerevent_touch-action-svg-test_touch-manual.html index 6c9c0b3f68cd..e9dc9d78ee72 100644 --- a/testing/web-platform/tests/pointerevents/pointerevent_touch-action-svg-test_touch-manual.html +++ b/testing/web-platform/tests/pointerevents/pointerevent_touch-action-svg-test_touch-manual.html @@ -23,7 +23,7 @@

Test Description: Try to scroll black element DOWN moving your touch outside of the red border. Wait for description update.

Note: this test is for touch only

- + Sorry, your browser does not support inline SVG. @@ -119,4 +119,4 @@
- \ No newline at end of file + diff --git a/testing/web-platform/tests/pointerevents/resources/pointerevent_pointerId_scope-iframe.html b/testing/web-platform/tests/pointerevents/resources/pointerevent_pointerId_scope-iframe.html new file mode 100644 index 000000000000..ad1a57fb492c --- /dev/null +++ b/testing/web-platform/tests/pointerevents/resources/pointerevent_pointerId_scope-iframe.html @@ -0,0 +1,37 @@ + + + + + Pointer Events pointerdown tests + + + + + +
+
+ + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/idlharness.html b/testing/web-platform/tests/presentation-api/controlling-ua/idlharness.html index 5a7c1ebc6cc8..4de25decd23e 100644 --- a/testing/web-platform/tests/presentation-api/controlling-ua/idlharness.html +++ b/testing/web-platform/tests/presentation-api/controlling-ua/idlharness.html @@ -34,17 +34,19 @@ partial interface Presentation { attribute PresentationRequest? defaultRequest; }; -[Constructor(DOMString url)] +[Constructor(DOMString url), + Constructor(DOMString[] urls)] interface PresentationRequest : EventTarget { - Promise start(); - Promise reconnect(DOMString presentationId); + Promise start(); + Promise reconnect(DOMString presentationId); Promise getAvailability(); + attribute EventHandler onconnectionavailable; }; interface PresentationAvailability : EventTarget { - readonly attribute boolean value; - attribute EventHandler onchange; + readonly attribute boolean value; + attribute EventHandler onchange; }; [Constructor(DOMString type, PresentationConnectionAvailableEventInit eventInitDict)] @@ -70,16 +72,17 @@ enum BinaryType { }; interface PresentationConnection : EventTarget { - readonly attribute DOMString? id; + readonly attribute DOMString? id; readonly attribute PresentationConnectionState state; void close(); void terminate(); - attribute EventHandler onconnect; - attribute EventHandler onclose; - attribute EventHandler onterminate; + attribute EventHandler onconnect; + attribute EventHandler onclose; + attribute EventHandler onterminate; + // Communication - attribute BinaryType binaryType; - attribute EventHandler onmessage; + attribute BinaryType binaryType; + attribute EventHandler onmessage; void send(DOMString message); void send(Blob data); void send(ArrayBuffer data); @@ -95,12 +98,12 @@ enum PresentationConnectionClosedReason { [Constructor(DOMString type, PresentationConnectionClosedEventInit eventInitDict)] interface PresentationConnectionClosedEvent : Event { readonly attribute PresentationConnectionClosedReason reason; - readonly attribute DOMString message; + readonly attribute DOMString message; }; dictionary PresentationConnectionClosedEventInit : EventInit { required PresentationConnectionClosedReason reason; - DOMString message; + DOMString message = ""; }; diff --git a/testing/web-platform/tests/presentation-api/receiving-ua/idlharness.html b/testing/web-platform/tests/presentation-api/receiving-ua/idlharness.html index bc091d495b06..3e39ed8f468f 100644 --- a/testing/web-platform/tests/presentation-api/receiving-ua/idlharness.html +++ b/testing/web-platform/tests/presentation-api/receiving-ua/idlharness.html @@ -58,16 +58,17 @@ enum BinaryType { }; interface PresentationConnection : EventTarget { - readonly attribute DOMString? id; + readonly attribute DOMString? id; readonly attribute PresentationConnectionState state; void close(); void terminate(); - attribute EventHandler onconnect; - attribute EventHandler onclose; - attribute EventHandler onterminate; + attribute EventHandler onconnect; + attribute EventHandler onclose; + attribute EventHandler onterminate; + // Communication - attribute BinaryType binaryType; - attribute EventHandler onmessage; + attribute BinaryType binaryType; + attribute EventHandler onmessage; void send(DOMString message); void send(Blob data); void send(ArrayBuffer data); @@ -83,12 +84,12 @@ enum PresentationConnectionClosedReason { [Constructor(DOMString type, PresentationConnectionClosedEventInit eventInitDict)] interface PresentationConnectionClosedEvent : Event { readonly attribute PresentationConnectionClosedReason reason; - readonly attribute DOMString message; + readonly attribute DOMString message; }; dictionary PresentationConnectionClosedEventInit : EventInit { required PresentationConnectionClosedReason reason; - DOMString message; + DOMString message = ""; }; interface PresentationReceiver { @@ -98,7 +99,7 @@ interface PresentationReceiver { interface PresentationConnectionList : EventTarget { readonly attribute FrozenArray connections; - attribute EventHandler onconnectionavailable; + attribute EventHandler onconnectionavailable; }; diff --git a/testing/web-platform/tests/referrer-policy/generic/subresource/subresource.py b/testing/web-platform/tests/referrer-policy/generic/subresource/subresource.py index fda9ed32258f..7571b32d0fa7 100644 --- a/testing/web-platform/tests/referrer-policy/generic/subresource/subresource.py +++ b/testing/web-platform/tests/referrer-policy/generic/subresource/subresource.py @@ -7,7 +7,7 @@ def get_template(template_basename): "template")) template_filename = os.path.join(template_directory, template_basename); - with open(template_filename) as f: + with open(template_filename, "r") as f: return f.read() # TODO(kristijanburnik): subdomain_prefix is a hardcoded value aligned with diff --git a/testing/web-platform/tests/referrer-policy/generic/tools/common_paths.py b/testing/web-platform/tests/referrer-policy/generic/tools/common_paths.py index 4626223c4c56..dc303f3c1558 100644 --- a/testing/web-platform/tests/referrer-policy/generic/tools/common_paths.py +++ b/testing/web-platform/tests/referrer-policy/generic/tools/common_paths.py @@ -23,7 +23,7 @@ test_file_path_pattern = '%(spec_name)s/' + selection_pattern + \ def get_template(basename): - with open(os.path.join(template_directory, basename)) as f: + with open(os.path.join(template_directory, basename), "r") as f: return f.read() @@ -36,7 +36,7 @@ def read_nth_line(fp, line_number): def load_spec_json(): re_error_location = re.compile('line ([0-9]+) column ([0-9]+)') - with open(spec_filename) as f: + with open(spec_filename, "r") as f: try: spec_json = json.load(f) except ValueError, ex: diff --git a/testing/web-platform/tests/resources/idlharness.js b/testing/web-platform/tests/resources/idlharness.js index b6a16af41502..5002ec50b365 100644 --- a/testing/web-platform/tests/resources/idlharness.js +++ b/testing/web-platform/tests/resources/idlharness.js @@ -307,6 +307,28 @@ IdlArray.prototype.recursively_get_implements = function(interface_name) return ret; }; +function exposed_in(globals) { + if ('document' in self) { + return globals.indexOf("Window") >= 0; + } + if ('DedicatedWorkerGlobalScope' in self && + self instanceof DedicatedWorkerGlobalScope) { + return globals.indexOf("Worker") >= 0 || + globals.indexOf("DedicatedWorker") >= 0; + } + if ('SharedWorkerGlobalScope' in self && + self instanceof SharedWorkerGlobalScope) { + return globals.indexOf("Worker") >= 0 || + globals.indexOf("SharedWorker") >= 0; + } + if ('ServiceWorkerGlobalScope' in self && + self instanceof ServiceWorkerGlobalScope) { + return globals.indexOf("Worker") >= 0 || + globals.indexOf("ServiceWorker") >= 0; + } + throw "Unexpected global object"; +} + //@} IdlArray.prototype.test = function() //@{ @@ -353,6 +375,23 @@ IdlArray.prototype.test = function() } this["implements"] = {}; + Object.getOwnPropertyNames(this.members).forEach(function(memberName) { + var member = this.members[memberName]; + if (!(member instanceof IdlInterface)) { + return; + } + + var exposed = member.extAttrs.filter(function(a) { return a.name == "Exposed" }); + if (exposed.length > 1) { + throw "Unexpected Exposed extended attributes on " + memberName + ": " + exposed; + } + + var globals = exposed.length === 1 + ? exposed[0].rhs.value + : ["Window"]; + member.exposed = exposed_in(globals); + }.bind(this)); + // Now run test() on every member, and test_object() for every object. for (var name in this.members) { @@ -678,6 +717,13 @@ IdlInterface.prototype.test = function() return; } + if (!this.exposed) { + test(function() { + assert_false(this.name in self); + }.bind(this), this.name + " interface: existence and properties of interface object"); + return; + } + if (!this.untested) { // First test things to do with the exception/interface object and @@ -701,7 +747,6 @@ IdlInterface.prototype.test_self = function() test(function() { // This function tests WebIDL as of 2015-01-13. - // TODO: Consider [Exposed]. // "For every interface that is exposed in a given ECMAScript global // environment and: diff --git a/testing/web-platform/tests/resources/testharness.js b/testing/web-platform/tests/resources/testharness.js index ceb3a4b462e4..91dfab58c2b3 100644 --- a/testing/web-platform/tests/resources/testharness.js +++ b/testing/web-platform/tests/resources/testharness.js @@ -471,6 +471,11 @@ policies and contribution forms [3]. self instanceof ServiceWorkerGlobalScope) { return new ServiceWorkerTestEnvironment(); } + if ('WorkerGlobalScope' in self && + self instanceof WorkerGlobalScope) { + return new DedicatedWorkerTestEnvironment(); + } + throw new Error("Unsupported test environment"); } diff --git a/testing/web-platform/tests/service-workers/tools/blink-import.py b/testing/web-platform/tests/service-workers/tools/blink-import.py index 87ca221c1a3a..355df07960c4 100644 --- a/testing/web-platform/tests/service-workers/tools/blink-import.py +++ b/testing/web-platform/tests/service-workers/tools/blink-import.py @@ -152,7 +152,7 @@ def main(): out_dir = os.path.dirname(out_path) if not os.path.exists(out_dir): os.makedirs(out_dir) - with open(os.path.join(test_path, path)) as in_f: + with open(os.path.join(test_path, path), "r") as in_f: data = [] sub = False for line in in_f: @@ -189,7 +189,7 @@ def main(): for path in source_paths(work_path): full_path = os.path.join(work_path, path) - with open(full_path) as f: + with open(full_path, "r") as f: data = sub_changed_filenames(filename_changes, f) with open(full_path, "w") as f: f.write(data) diff --git a/testing/web-platform/tests/shadow-dom/leaktests/html-collection.html b/testing/web-platform/tests/shadow-dom/leaktests/html-collection.html index 4f864fdeb19c..d15656971463 100644 --- a/testing/web-platform/tests/shadow-dom/leaktests/html-collection.html +++ b/testing/web-platform/tests/shadow-dom/leaktests/html-collection.html @@ -11,7 +11,6 @@