Bug 1634779 - pt 1. Improvments to browser_httpToFileHistory.js test r=kmag a=pascalc
authorPaul Bone <pbone@mozilla.com>
Mon, 18 May 2020 23:25:37 +0000
changeset 591531 1e4887c20fdb430fdae73393ebfbfddbe1a51e5d
parent 591530 386e1e08a8d0345fd9ce8172717b6806403611ce
child 591532 74caa214ef31b732cc143bed56a13c3fb8b27543
push id13170
push userarchaeopteryx@coole-files.de
push dateWed, 20 May 2020 16:30:31 +0000
treeherdermozilla-beta@bb2ce87358c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, pascalc
bugs1634779
milestone77.0
Bug 1634779 - pt 1. Improvments to browser_httpToFileHistory.js test r=kmag a=pascalc * Navigate in this test in the context of the content * WIP: Fix slice(0, -1) * Remove code that runs this test without document channel Differential Revision: https://phabricator.services.mozilla.com/D75245
toolkit/components/remotebrowserutils/tests/browser/browser_httpToFileHistory.js
--- a/toolkit/components/remotebrowserutils/tests/browser/browser_httpToFileHistory.js
+++ b/toolkit/components/remotebrowserutils/tests/browser/browser_httpToFileHistory.js
@@ -11,28 +11,29 @@ const HISTORY = [
 
 function reversed(list) {
   let copy = list.slice();
   copy.reverse();
   return copy;
 }
 
 function butLast(list) {
-  let copy = list.slice();
-  copy.pop();
-  return copy;
+  return list.slice(0, -1);
 }
 
 async function runTest() {
   await BrowserTestUtils.withNewTab({ gBrowser }, async function(aBrowser) {
     // Perform initial load of each URL in the history.
     let count = 0;
     let index = -1;
     for (let { url } of HISTORY) {
-      BrowserTestUtils.loadURI(aBrowser, url);
+      SpecialPowers.spawn(aBrowser, [url], url => {
+        content.location.href = url;
+      });
+
       await BrowserTestUtils.browserLoaded(aBrowser, false, loaded => {
         return (
           Services.io.newURI(loaded).scheme == Services.io.newURI(url).scheme
         );
       });
 
       count++;
       index++;
@@ -113,25 +114,9 @@ async function runTest() {
           let expect = Services.io.newURI(url);
           is(real.scheme, expect.scheme, "Go Forward URL Scheme");
         }
       );
     }
   });
 }
 
-if (!SpecialPowers.useRemoteSubframes) {
-  add_task(async function prefNotSet() {
-    await SpecialPowers.pushPrefEnv({
-      set: [[DOCUMENT_CHANNEL_PREF, false]],
-    });
-    await runTest();
-    await SpecialPowers.popPrefEnv();
-  });
-}
-
-add_task(async function prefEnabled() {
-  await SpecialPowers.pushPrefEnv({
-    set: [[DOCUMENT_CHANNEL_PREF, true]],
-  });
-  await runTest();
-  await SpecialPowers.popPrefEnv();
-});
+add_task(runTest);