Bug 1408044 - fix miscellaneous tests that depended on about: existing, r=dao
☠☠ backed out by 19229263df31 ☠ ☠
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 15 Nov 2017 17:19:33 +0000
changeset 436932 5c5152ad910d21ef40f67a61029640985caed7c7
parent 436931 c9a062838c12374b6fdd20f5484438b36198d6b7
child 436933 3a3080a142d01a5440ce7da5f4032a1390f36630
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersdao
bugs1408044
milestone59.0a1
Bug 1408044 - fix miscellaneous tests that depended on about: existing, r=dao MozReview-Commit-ID: EKsaFbRoBc4
accessible/tests/mochitest/events/docload/test_docload_busy.html
accessible/tests/mochitest/events/docload/test_docload_embedded.html
accessible/tests/mochitest/events/docload/test_docload_root.html
accessible/tests/mochitest/name/test_browserui.xul
accessible/tests/mochitest/name/test_general.html
accessible/tests/mochitest/relations/test_embeds.xul
accessible/tests/mochitest/relations/test_tabbrowser.xul
accessible/tests/mochitest/textcaret/test_browserui.xul
accessible/tests/mochitest/textcaret/test_general.html
accessible/tests/mochitest/tree/test_tabbrowser.xul
browser/base/content/test/general/browser_audioTabIcon.js
browser/base/content/test/general/browser_bug537474.js
browser/base/content/test/tabs/browser_navigatePinnedTab.js
browser/components/places/tests/browser/browser_library_left_pane_middleclick.js
browser/components/places/tests/browser/browser_library_middleclick.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js
browser/components/sessionstore/test/browser_350525.js
browser/components/sessionstore/test/browser_367052.js
dom/base/test/chrome/frame_bug814638.xul
js/xpconnect/tests/chrome/test_bug865948.xul
toolkit/mozapps/extensions/test/mochitest/test_bug887098.html
--- a/accessible/tests/mochitest/events/docload/test_docload_busy.html
+++ b/accessible/tests/mochitest/events/docload/test_docload_busy.html
@@ -74,11 +74,11 @@
     Mozilla Bug 658185
   </a>
 
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
-  <div id="testContainer"><iframe id="iframe" src="about:" style="visibility: hidden;"></iframe></div>
+  <div id="testContainer"><iframe id="iframe" src="about:mozilla" style="visibility: hidden;"></iframe></div>
 </body>
 </html>
--- a/accessible/tests/mochitest/events/docload/test_docload_embedded.html
+++ b/accessible/tests/mochitest/events/docload/test_docload_embedded.html
@@ -35,30 +35,30 @@
       this.invoke = () => (this.DOMNode.src = aURL);
 
       this.finalCheck = () =>
         testAccessibleTree(this.DOMNode, {
           role: ROLE_INTERNAL_FRAME,
           children: [
             {
               role: ROLE_DOCUMENT,
-              name: aURL == "about:" ? "About:" : aURL
+              name: aURL == "about:license" ? "Licenses" : aURL
             }
           ]
         });
 
       this.getID = () => `change iframe src on ${aURL}`;
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     function doTests() {
       const gQueue = new eventQueue();
-      gQueue.push(new changeIframeSrc("iframe", "about:"));
+      gQueue.push(new changeIframeSrc("iframe", "about:license"));
       gQueue.push(new changeIframeSrc("iframe", "about:buildconfig"));
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTests);
   </script>
 </head>
--- a/accessible/tests/mochitest/events/docload/test_docload_root.html
+++ b/accessible/tests/mochitest/events/docload/test_docload_root.html
@@ -107,17 +107,17 @@
       this.getID = () => "close dialog";
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     function doTests() {
       const gQueue = new eventQueue();
-      gQueue.push(new openDialogWnd("about:"));
+      gQueue.push(new openDialogWnd("about:about"));
       gQueue.push(new closeDialogWnd());
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTests);
   </script>
 </head>
--- a/accessible/tests/mochitest/name/test_browserui.xul
+++ b/accessible/tests/mochitest/name/test_browserui.xul
@@ -79,17 +79,17 @@
       {
         closeBrowserWindow();
       }
 
       gQueue.invoke();
     }
 
     SimpleTest.waitForExplicitFinish();
-    openBrowserWindow(doTests, "about:");
+    openBrowserWindow(doTests, "about:license");
   ]]>
   </script>
 
   <vbox flex="1" style="overflow: auto;">
   <body xmlns="http://www.w3.org/1999/xhtml">
     <a target="_blank"
        href="https://bugzilla.mozilla.org/show_bug.cgi?id=507382"
        title="focus is fired earlier than root accessible name is changed when switching between tabs">
--- a/accessible/tests/mochitest/name/test_general.html
+++ b/accessible/tests/mochitest/name/test_general.html
@@ -418,17 +418,17 @@
          title="Input your country of origin"/ >
 
   <!-- name from subtree, surround control by spaces to not jamm the text -->
   <label id="insert_spaces_around_control">
     start<input value="value">end
   </label>
 
   <!-- no name from subtree because it holds whitespaces only -->
-  <a id="from_label_ignore_ws_subtree" href="about:" title="about">&nbsp;&nbsp;  </a>
+  <a id="from_label_ignore_ws_subtree" href="about:mozilla" title="about">&nbsp;&nbsp;  </a>
 
   <!-- label element, label contains control -->
   <label>text<button id="btn_label_inside">10</button>text</label>
   <br/>
 
   <!-- label element, label and the button are in the same form -->
   <form>
     <label for="btn_label_inform">in form</label>
--- a/accessible/tests/mochitest/relations/test_embeds.xul
+++ b/accessible/tests/mochitest/relations/test_embeds.xul
@@ -90,29 +90,29 @@
     function doTests()
     {
       testRelation(browserDocument(), RELATION_EMBEDS,
                    getAccessible(currentTabDocument()));
 
       enableLogging("docload");
       gQueue = new eventQueue();
 
-      gQueue.push(new loadURI("about:about"));
+      gQueue.push(new loadURI("about:robots"));
       gQueue.push(new loadOneTab("about:mozilla"));
 
       gQueue.onFinish = function()
       {
         disableLogging();
         closeBrowserWindow();
       }
       gQueue.invoke();
     }
 
     SimpleTest.waitForExplicitFinish();
-    openBrowserWindow(doTests, "about:");
+    openBrowserWindow(doTests, "about:license");
   ]]>
   </script>
 
   <vbox flex="1" style="overflow: auto;">
   <body xmlns="http://www.w3.org/1999/xhtml">
     <a target="_blank"
        href="https://bugzilla.mozilla.org/show_bug.cgi?id=707654"
        title="Embeds relation on root accessible can return not content document">
--- a/accessible/tests/mochitest/relations/test_tabbrowser.xul
+++ b/accessible/tests/mochitest/relations/test_tabbrowser.xul
@@ -30,17 +30,17 @@
     {
       this.eventSeq = [
         new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 0),
         new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 1)
      ];
 
       this.invoke = function testTabRelations_invoke()
       {
-        var docURIs = ["about:", "about:mozilla"];
+        var docURIs = ["about:license", "about:mozilla"];
         tabBrowser().loadTabs(docURIs, {
           inBackground: false,
           replace: true,
           triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
         });
       }
 
       this.finalCheck = function testTabRelations_finalCheck(aEvent)
--- a/accessible/tests/mochitest/textcaret/test_browserui.xul
+++ b/accessible/tests/mochitest/textcaret/test_browserui.xul
@@ -41,17 +41,17 @@
       {
         closeBrowserWindow();
       }
 
       gQueue.invoke();
     }
 
     SimpleTest.waitForExplicitFinish();
-    openBrowserWindow(doTests, "about:");
+    openBrowserWindow(doTests, "about:mozilla");
   ]]>
   </script>
 
   <vbox flex="1" style="overflow: auto;">
   <body xmlns="http://www.w3.org/1999/xhtml">
     <a target="_blank"
        href="https://bugzilla.mozilla.org/show_bug.cgi?id=723833"
        title="IAccessibleText::setCaretOffset on location or search bar causes focus to jump">
--- a/accessible/tests/mochitest/textcaret/test_general.html
+++ b/accessible/tests/mochitest/textcaret/test_general.html
@@ -162,16 +162,16 @@
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <input id="textbox" value="hello"/>
   <textarea id="textarea">text<br>text</textarea>
   <p id="p" contentEditable="true"><span>text</span><br/>text</p>
-  <a id="link" href="about:">about mozilla</a>
+  <a id="link" href="about:mozilla">about mozilla</a>
   <h5 id="heading">heading</h5>
   <iframe id="p2_container"
           src="data:text/html,<p id='p2' contentEditable='true'>a<a id='p2_a' href='mozilla.org'>b</a>c</p>"></iframe>
 
   <div id="eventdump"></div>
 </body>
 </html>
--- a/accessible/tests/mochitest/tree/test_tabbrowser.xul
+++ b/accessible/tests/mochitest/tree/test_tabbrowser.xul
@@ -29,17 +29,17 @@
     {
       this.eventSeq = [
         new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 0),
         new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 1)
       ];
 
       this.invoke = function testTabHierarchy_invoke()
       {
-        var docURIs = ["about:", "about:mozilla"];
+        var docURIs = ["about:license", "about:mozilla"];
         tabBrowser().loadTabs(docURIs, {
           inBackground: false,
           replace: true,
           triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
         });
       }
 
       this.finalCheck = function testTabHierarchy_finalCheck(aEvent)
@@ -61,17 +61,17 @@
 
           tabsAccTree.children.splice(0, 0,
             {
               // xul:toolbarbutton ("Open a new tab")
               role: ROLE_PUSHBUTTON,
               children: []
             },
             {
-              // xul:tab ("about:")
+              // xul:tab ("about:license")
               role: ROLE_PAGETAB,
               children: []
             },
             {
               // tab ("about:mozilla")
               role: ROLE_PAGETAB,
               children: []
             },
@@ -103,17 +103,17 @@
               }
             ];
           }
 
           // NB: The (3) buttons are not visible, unless manually hovered,
           //     probably due to size reduction in this test.
           tabsAccTree.children.splice(0, 0,
             {
-              // xul:tab ("about:")
+              // xul:tab ("about:license")
               role: ROLE_PAGETAB,
               children: [
                 {
                   // xul:text, i.e. the tab label text
                   role: ROLE_TEXT_LEAF,
                   children: []
                 },
                 {
@@ -163,17 +163,17 @@
               // xul:notificationbox
               role: ROLE_PROPERTYPAGE,
               children: [
                 {
                   // xul:browser
                   role: ROLE_INTERNAL_FRAME,
                   children: [
                     {
-                      // #document ("about:")
+                      // #document ("about:license")
                       role: ROLE_DOCUMENT
                       // children: [ ... ] // Ignore document content.
                     }
                   ]
                 }
               ]
             },
             {
--- a/browser/base/content/test/general/browser_audioTabIcon.js
+++ b/browser/base/content/test/general/browser_audioTabIcon.js
@@ -398,17 +398,17 @@ async function test_cross_process_load()
     //   Start playback and wait for it to finish.
     await play(tab);
 
     let soundPlayingStoppedPromise = BrowserTestUtils.waitForEvent(tab, "TabAttrModified", false,
       event => event.detail.changed.includes("soundplaying")
     );
 
     // Go to a different process.
-    browser.loadURI("about:");
+    browser.loadURI("about:mozilla");
     await BrowserTestUtils.browserLoaded(browser);
 
     await soundPlayingStoppedPromise;
 
     ok(!tab.hasAttribute("soundplaying"), "Tab should not be playing sound any more");
     ok(!tab.soundPlaying, "Tab should not be playing sound any more");
   }
 
--- a/browser/base/content/test/general/browser_bug537474.js
+++ b/browser/base/content/test/general/browser_bug537474.js
@@ -1,8 +1,8 @@
 add_task(async function() {
   let browserLoadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-  window.browserDOMWindow.openURI(makeURI("about:"), null,
+  window.browserDOMWindow.openURI(makeURI("about:mozilla"), null,
                                   Ci.nsIBrowserDOMWindow.OPEN_CURRENTWINDOW, null,
                                   Services.scriptSecurityManager.getSystemPrincipal());
   await browserLoadedPromise;
-  is(gBrowser.currentURI.spec, "about:", "page loads in the current content window");
+  is(gBrowser.currentURI.spec, "about:mozilla", "page loads in the current content window");
 });
--- a/browser/base/content/test/tabs/browser_navigatePinnedTab.js
+++ b/browser/base/content/test/tabs/browser_navigatePinnedTab.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 add_task(async function() {
   // Test that changing the URL in a pinned tab works correctly
 
-  let TEST_LINK_INITIAL = "about:";
+  let TEST_LINK_INITIAL = "about:mozilla";
   let TEST_LINK_CHANGED = "about:support";
 
   let appTab = BrowserTestUtils.addTab(gBrowser, TEST_LINK_INITIAL);
   let browser = appTab.linkedBrowser;
   await BrowserTestUtils.browserLoaded(browser);
 
   gBrowser.pinTab(appTab);
   is(appTab.pinned, true, "Tab was successfully pinned");
--- a/browser/components/places/tests/browser/browser_library_left_pane_middleclick.js
+++ b/browser/components/places/tests/browser/browser_library_left_pane_middleclick.js
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
  /**
  * Tests middle-clicking items in the Library.
  */
 
-const URIs = ["about:license", "about:"];
+const URIs = ["about:license", "about:mozilla"];
 
 var gLibrary = null;
 
 add_task(async function test_setup() {
   // Temporary disable history, so we won't record pages navigation.
   await SpecialPowers.pushPrefEnv({set: [
     ["places.history.enabled", false]
   ]});
--- a/browser/components/places/tests/browser/browser_library_middleclick.js
+++ b/browser/components/places/tests/browser/browser_library_middleclick.js
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
  /**
  * Tests middle-clicking items in the Library.
  */
 
-const URIs = ["about:license", "about:"];
+const URIs = ["about:license", "about:mozilla"];
 
 var gLibrary = null;
 var gTests = [];
 
 add_task(async function test_setup() {
   // Increase timeout, this test can be quite slow due to waitForFocus calls.
   requestLongerTimeout(2);
 
@@ -67,17 +67,17 @@ gTests.push({
   }
 });
 
 // ------------------------------------------------------------------------------
 // Open a folder in tabs.
 //
 gTests.push({
   desc: "Open a folder in tabs.",
-  URIs: ["about:buildconfig", "about:"],
+  URIs: ["about:buildconfig", "about:mozilla"],
   _bookmarks: null,
 
   async setup() {
     // Create a new folder.
     let children = this.URIs.map(url => {
       return {
         title: "Title",
         url,
@@ -107,17 +107,17 @@ gTests.push({
   }
 });
 
 // ------------------------------------------------------------------------------
 // Open a query in tabs.
 
 gTests.push({
   desc: "Open a query in tabs.",
-  URIs: ["about:buildconfig", "about:"],
+  URIs: ["about:buildconfig", "about:mozilla"],
   _bookmarks: null,
   _query: null,
 
   async setup() {
     let children = this.URIs.map(url => {
       return {
         title: "Title",
         url,
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // This test makes sure that private browsing turns off doesn't cause zoom
 // settings to be reset on tab switch (bug 464962)
 
 add_task(async function test() {
   let win = (await BrowserTestUtils.openNewBrowserWindow({ private: true }));
-  let tabAbout = (await BrowserTestUtils.openNewForegroundTab(win.gBrowser, "about:"));
-  let tabMozilla = (await BrowserTestUtils.openNewForegroundTab(win.gBrowser, "about:"));
+  let tabAbout = (await BrowserTestUtils.openNewForegroundTab(win.gBrowser, "about:mozilla"));
+  let tabMozilla = (await BrowserTestUtils.openNewForegroundTab(win.gBrowser, "about:mozilla"));
 
   let mozillaZoom = win.ZoomManager.zoom;
 
   // change the zoom on the mozilla page
   win.FullZoom.enlarge();
   // make sure the zoom level has been changed
   isnot(win.ZoomManager.zoom, mozillaZoom, "Zoom level can be changed");
   mozillaZoom = win.ZoomManager.zoom;
--- a/browser/components/sessionstore/test/browser_350525.js
+++ b/browser/components/sessionstore/test/browser_350525.js
@@ -69,17 +69,17 @@ add_task(async function() {
 
   // get closed tab count
   let count = ss.getClosedTabCount(window);
   let max_tabs_undo = gPrefService.getIntPref("browser.sessionstore.max_tabs_undo");
   ok(0 <= count && count <= max_tabs_undo,
      "getClosedTabCount returns zero or at most max_tabs_undo");
 
   // create a new tab
-  let testURL = "about:";
+  let testURL = "about:mozilla";
   tab = BrowserTestUtils.addTab(gBrowser, testURL);
   await promiseBrowserLoaded(tab.linkedBrowser);
 
   // make sure that the next closed tab will increase getClosedTabCount
   gPrefService.setIntPref("browser.sessionstore.max_tabs_undo", max_tabs_undo + 1);
   registerCleanupFunction(() => gPrefService.clearUserPref("browser.sessionstore.max_tabs_undo"));
 
   // remove tab
--- a/browser/components/sessionstore/test/browser_367052.js
+++ b/browser/components/sessionstore/test/browser_367052.js
@@ -11,17 +11,17 @@ add_task(async function() {
   registerCleanupFunction(() => gPrefService.clearUserPref("browser.sessionstore.max_tabs_undo"));
 
   // Empty the list of closed tabs.
   while (ss.getClosedTabCount(window)) {
     ss.forgetClosedTab(window, 0);
   }
 
   // restore a blank tab
-  let tab = BrowserTestUtils.addTab(gBrowser, "about:");
+  let tab = BrowserTestUtils.addTab(gBrowser, "about:mozilla");
   await promiseBrowserLoaded(tab.linkedBrowser);
 
   let count = await promiseSHistoryCount(tab.linkedBrowser);
   ok(count >= 1, "the new tab does have at least one history entry");
 
   await promiseTabState(tab, {entries: []});
 
   // We may have a different sessionHistory object if the tab
--- a/dom/base/test/chrome/frame_bug814638.xul
+++ b/dom/base/test/chrome/frame_bug814638.xul
@@ -5,11 +5,11 @@ https://bugzilla.mozilla.org/show_bug.cg
 -->
 <window title="Mozilla Bug 814638"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <keyset>
     <key key="T" modifiers="control" oncommand="receivedKeyEvent()"/>
   </keyset>
 
-  <iframe flex="1" src="about:"/>
+  <iframe flex="1" src="about:mozilla"/>
 
 </window>
--- a/js/xpconnect/tests/chrome/test_bug865948.xul
+++ b/js/xpconnect/tests/chrome/test_bug865948.xul
@@ -21,16 +21,16 @@ https://bugzilla.mozilla.org/show_bug.cg
   /** Test for Bug 865948 **/
   SimpleTest.waitForExplicitFinish();
   const Cu = Components.utils;
   function go() {
     $('ifr').onload = null;
     var sb = Cu.Sandbox(['http://example.com', 'http://example.org']);
     sb.iwin = $('ifr').contentWindow;
     sb.ok = ok;
-    Cu.evalInSandbox('try { iwin.location = "about:"; ok(false, "didnt throw"); } catch (e) { ok(!!/denied/.exec(e), "threw: " + e); }', sb);
+    Cu.evalInSandbox('try { iwin.location = "about:mozilla"; ok(false, "didnt throw"); } catch (e) { ok(!!/denied/.exec(e), "threw: " + e); }', sb);
     SimpleTest.finish();
   }
 
   ]]>
   </script>
 <iframe id="ifr" type="content" onload="go();" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html" />
 </window>
--- a/toolkit/mozapps/extensions/test/mochitest/test_bug887098.html
+++ b/toolkit/mozapps/extensions/test/mochitest/test_bug887098.html
@@ -16,26 +16,26 @@ https://bugzilla.mozilla.org/show_bug.cg
   /* globals $,evalRef */
 
   function loaded() {
     var iwin = $("ifr").contentWindow;
     var href = SpecialPowers.wrap(iwin).location.href;
     if (/file_empty/.test(href)) {
       window.evalRef = iwin.eval;
       window.installTriggerRef = iwin.InstallTrigger; // Force lazy instantiation.
-      // about: is privileged, so we need to be privileged to load it.
-      SpecialPowers.wrap(iwin).location.href = "about:";
+      // about:mozilla is privileged, so we need to be privileged to load it.
+      SpecialPowers.wrap(iwin).location.href = "about:mozilla";
     } else {
-      is(href, "about:", "Successfully navigated to about:");
+      is(href, "about:mozilla", "Successfully navigated to about:mozilla");
       try {
         evalRef('InstallTrigger.install({URL: "chrome://global/skin/global.css"});');
         ok(false, "Should have thrown when trying to install restricted URI from InstallTrigger");
       } catch (e) {
         // XXXgijs this test broke because of the switch to webidl. I'm told
-        // it has to do with compartments and the fact that we eval in "about:".
+        // it has to do with compartments and the fact that we eval in "about:mozilla".
         // Tracking in bug 1007671
         todo(/permission/.test(e), "We should throw a security exception. Got: " + e);
       }
       SimpleTest.finish();
     }
   }
 
   </script>