Bug 1339844 P3 Test for Client.type in mochitest. r=asuth
authorBen Kelly <ben@wanderview.com>
Wed, 15 Feb 2017 15:12:37 -0500
changeset 343144 f45e73d6c9ff8c902f8b989cb89463fe284fc315
parent 343143 b185531eed21f500813ac04566703eedcaba3004
child 343145 6296e675694a4b256dc54f3be1a6c2b182203323
push id37450
push userkwierso@gmail.com
push dateThu, 16 Feb 2017 00:33:57 +0000
treeherderautoland@d8e8cc9d9b68 [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 P3 Test for Client.type in mochitest. r=asuth
dom/workers/test/serviceworkers/match_all_clients/match_all_controlled.html
dom/workers/test/serviceworkers/match_all_properties_worker.js
--- a/dom/workers/test/serviceworkers/match_all_clients/match_all_controlled.html
+++ b/dom/workers/test/serviceworkers/match_all_clients/match_all_controlled.html
@@ -49,16 +49,19 @@
     postResult(result, "Client visibility test. expected=" +document.visibilityState);
 
     result = msg.data.focused === document.hasFocus();
     postResult(result, "Client focus test. expected=" + document.hasFocus());
 
     result = msg.data.frameType === frameType;
     postResult(result, "Client frameType test. expected=" + frameType);
 
+    result = msg.data.type === "window";
+    postResult(result, "Client type test. expected=window");
+
     postResult(true, "DONE");
     window.close();
   };
 </script>
 
 </head>
 <body>
 </body>
--- a/dom/workers/test/serviceworkers/match_all_properties_worker.js
+++ b/dom/workers/test/serviceworkers/match_all_properties_worker.js
@@ -3,16 +3,17 @@ onmessage = function(e) {
   self.clients.matchAll().then(function(res) {
     if (!res.length) {
       dump("ERROR: no clients are currently controlled.\n");
     }
 
     for (i = 0; i < res.length; i++) {
       client = res[i];
       response = {
+        type: client.type,
         id: client.id,
         url: client.url,
         visibilityState: client.visibilityState,
         focused: client.focused,
         frameType: client.frameType
       };
       client.postMessage(response);
     }