Bug 1425965 P6 Change test_fetch_integrity.html not to expect exact window ID values in console messages. r=asuth
authorBen Kelly <ben@wanderview.com>
Fri, 12 Jan 2018 12:16:06 -0500
changeset 453357 9972008ac10510753a6adda9af0f21b33ee861e8
parent 453356 241b9e419ca4a960144320842839f4ae39be6493
child 453358 d16fe1a6931e5dadaeddafd626ef5bc0bb8bf8ea
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs1425965
milestone59.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 1425965 P6 Change test_fetch_integrity.html not to expect exact window ID values in console messages. r=asuth
dom/workers/test/serviceworkers/test_fetch_integrity.html
--- a/dom/workers/test/serviceworkers/test_fetch_integrity.html
+++ b/dom/workers/test/serviceworkers/test_fetch_integrity.html
@@ -15,25 +15,23 @@
 "use strict";
 
 let security_localizer =
   stringBundleService.createBundle("chrome://global/locale/security/security.properties");
 
 function expect_security_console_message(/* msgId, args, ... */) {
   let expectations = [];
   // process repeated paired arguments of: msgId, args
-  for (let i = 0; i < arguments.length; i += 4) {
+  for (let i = 0; i < arguments.length; i += 3) {
     let msgId = arguments[i];
     let args = arguments[i + 1];
     let filename = arguments[i + 2];
-    let windowId = arguments[i + 3];
     expectations.push({
       errorMessage: security_localizer.formatStringFromName(msgId, args, args.length),
       sourceName: filename,
-      windowID: windowId
     });
   }
   return new Promise(resolve => {
     SimpleTest.monitorConsole(resolve, expectations);
   });
 }
 
 // (This doesn't really need to be its own task, but it allows the actual test
@@ -56,38 +54,31 @@ add_task(async function test_integrity_s
   await waitForState(worker, 'activated');
   worker.postMessage('claim');
   await waitForControlled(window);
 
   info("Test for mNavigationInterceptions.")
   // The client_win will reload to another URL after opening filename2.
   let client_win = window.open(filename2);
 
-  // XXX windowID should be innerWindowID
-  let mainWindowID = SpecialPowers.getDOMWindowUtils(window).outerWindowID;
-  let clientWindowID = SpecialPowers.getDOMWindowUtils(client_win).outerWindowID;
   let expectedMessage = expect_security_console_message(
     "MalformedIntegrityHash",
     ["abc"],
     filename,
-    mainWindowID,
     "NoValidMetadata",
     [""],
     filename,
-    mainWindowID
   );
   let expectedMessage2 = expect_security_console_message(
     "MalformedIntegrityHash",
     ["abc"],
     filename,
-    clientWindowID,
     "NoValidMetadata",
     [""],
     filename,
-    clientWindowID
   );
 
   info("Test for mControlledDocuments and report error message to console.");
   // The fetch will succeed because the integrity value is invalid and we are
   // looking for the console message regarding the bad integrity value.
   await fetch("fail.html");
 
   await wait_for_expected_message(expectedMessage);
@@ -123,38 +114,31 @@ add_task(async function test_integrity_s
         resolve();
       } else {
         reject();
       }
     }
   });
   await waitForBothConnected;
 
-  // XXX windowID should be innerWindowID
-  let mainWindowID = SpecialPowers.getDOMWindowUtils(window).outerWindowID;
-  let clientWindowID = SpecialPowers.getDOMWindowUtils(client_win).outerWindowID;
   let expectedMessage = expect_security_console_message(
     "MalformedIntegrityHash",
     ["abc"],
     filename,
-    mainWindowID,
     "NoValidMetadata",
     [""],
     filename,
-    mainWindowID
   );
   let expectedMessage2 = expect_security_console_message(
     "MalformedIntegrityHash",
     ["abc"],
     filename,
-    clientWindowID,
     "NoValidMetadata",
     [""],
     filename,
-    clientWindowID
   );
 
   info("Start to fetch a URL with wrong integrity.")
   sharedWorker.port.start();
   sharedWorker.port.postMessage("StartFetchWithWrongIntegrity");
 
   let waitForSRIFailed = new Promise((resolve) => {
     sharedWorker.port.onmessage = function (e) {