Bug 1339844 P2 Add Client.type to WPT tests. r=asuth
authorBen Kelly <ben@wanderview.com>
Wed, 15 Feb 2017 15:12:37 -0500
changeset 343123 b185531eed21f500813ac04566703eedcaba3004
parent 343122 7430d14ff90f432deee834e227d89f5700fe6de9
child 343124 f45e73d6c9ff8c902f8b989cb89463fe284fc315
push id31369
push userkwierso@gmail.com
push dateThu, 16 Feb 2017 00:18:40 +0000
treeherdermozilla-central@e9b926463f9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs1339844
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1339844 P2 Add Client.type to WPT tests. r=asuth
testing/web-platform/tests/service-workers/service-worker/clients-matchall-client-types.https.html
testing/web-platform/tests/service-workers/service-worker/clients-matchall-include-uncontrolled.https.html
testing/web-platform/tests/service-workers/service-worker/clients-matchall.https.html
testing/web-platform/tests/service-workers/service-worker/resources/clients-matchall-worker.js
--- a/testing/web-platform/tests/service-workers/service-worker/clients-matchall-client-types.https.html
+++ b/testing/web-platform/tests/service-workers/service-worker/clients-matchall-client-types.https.html
@@ -5,27 +5,27 @@
 <script src="resources/test-helpers.sub.js"></script>
 <script>
 var scope = 'resources/clients-matchall-client-types';
 var iframe_url = scope + '-iframe.html';
 var shared_worker_url = scope + '-shared-worker.js';
 
 /* visibilityState, focused, url, frameType */
 var expected_without_type = [
-    ['visible', true, new URL(iframe_url, location).href, 'nested']
+    ['visible', true, new URL(iframe_url, location).href, 'window', 'nested']
 ];
 var expected_with_window = [
-    ['visible', true, new URL(iframe_url, location).href, 'nested']
+    ['visible', true, new URL(iframe_url, location).href, 'window', 'nested']
 ];
 var expected_with_shared_worker = [
-    [,,new URL(shared_worker_url, location).href, 'none']
+    [,,new URL(shared_worker_url, location).href, 'sharedworker', 'none']
 ];
 var expected_with_all = [
-    ['visible', true, new URL(iframe_url, location).href, 'nested'],
-    [,,new URL(shared_worker_url, location).href, 'none']
+    ['visible', true, new URL(iframe_url, location).href, 'window', 'nested'],
+    [,,new URL(shared_worker_url, location).href, 'sharedworker', 'none']
 ];
 
 function test_matchall(frame, expected, query_options) {
   // Make sure the frame gets focus.
   frame.focus();
   expected.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; });
   return new Promise(function(resolve, reject) {
     var channel = new MessageChannel();
--- a/testing/web-platform/tests/service-workers/service-worker/clients-matchall-include-uncontrolled.https.html
+++ b/testing/web-platform/tests/service-workers/service-worker/clients-matchall-include-uncontrolled.https.html
@@ -23,26 +23,26 @@ function create_iframes(scope) {
     .then(function(frame2) {
         frames.push(frame2);
         return frame2;
       })
 }
 
 var expected_without_include_uncontrolled = [
     /* visibilityState, focused, url, frameType */
-    ['visible', false, new URL(scope + '#1', location).toString(), 'nested'],
-    ['visible', true, new URL(scope + '#2', location).toString(), 'nested']
+    ['visible', false, new URL(scope + '#1', location).toString(), 'window', 'nested'],
+    ['visible', true, new URL(scope + '#2', location).toString(), 'window', 'nested']
 ];
 
 var expected_with_include_uncontrolled = [
     /* visibilityState, focused, url, frameType */
-    ['visible', true, location.href, 'top-level'],
-    ['visible', false, new URL(scope + '#1', location).toString(), 'nested'],
-    ['visible', true, new URL(scope + '#2', location).toString(), 'nested'],
-    ['visible', false, new URL(base_url, location).toString(), 'nested']
+    ['visible', true, location.href, 'window', 'top-level'],
+    ['visible', false, new URL(scope + '#1', location).toString(), 'window', 'nested'],
+    ['visible', true, new URL(scope + '#2', location).toString(), 'window', 'nested'],
+    ['visible', false, new URL(base_url, location).toString(), 'window', 'nested']
 ];
 
 function test_matchall(frame, expected, query_options) {
   // Make sure we have focus for '#2' frame and its parent window.
   frame.focus();
   frame.contentWindow.focus();
   expected.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; });
   return new Promise(function(resolve, reject) {
--- a/testing/web-platform/tests/service-workers/service-worker/clients-matchall.https.html
+++ b/testing/web-platform/tests/service-workers/service-worker/clients-matchall.https.html
@@ -26,18 +26,18 @@ t.step(function() {
           frame2.contentWindow.navigator.serviceWorker.controller.postMessage(
               {port:channel.port2}, [channel.port2]);
         })
       .catch(unreached_rejection(t));
   });
 
 var expected = [
     /* visibilityState, focused, url, frameType */
-    ['visible', true, new URL(scope + '#1', location).toString(), 'nested'],
-    ['visible', false, new URL(scope + '#2', location).toString(), 'nested']
+    ['visible', true, new URL(scope + '#1', location).toString(), 'window', 'nested'],
+    ['visible', false, new URL(scope + '#2', location).toString(), 'window', 'nested']
 ];
 
 function onMessage(e) {
   assert_equals(e.data.length, 2);
   assert_array_equals(e.data[0], expected[0]);
   assert_array_equals(e.data[1], expected[1]);
   frames.forEach(function(f) { f.remove(); });
   service_worker_unregister_and_done(t, scope);
--- a/testing/web-platform/tests/service-workers/service-worker/resources/clients-matchall-worker.js
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/clients-matchall-worker.js
@@ -10,15 +10,16 @@ self.onmessage = function(e) {
               client.frameType == 'auxiliary') {
             // The test tab might be opened using window.open() by the test framework.
             // In that case, just pretend it's top-level!
             frame_type = 'top-level';
           }
           message.push([client.visibilityState,
                         client.focused,
                         client.url,
+                        client.type,
                         frame_type]);
         });
       // Sort by url
       message.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; });
       port.postMessage(message);
     });
 };