Bug 1408044 - fix miscellaneous tests that depended on about: existing, r=dao

MozReview-Commit-ID: EKsaFbRoBc4

--HG--
extra : rebase_source : 3c22ed909437a7fa98e2126b4eb8b9c669f98173
This commit is contained in:
Gijs Kruitbosch 2017-11-15 17:19:33 +00:00
parent ba009dae2f
commit 59ffe6e6ca
25 changed files with 48 additions and 47 deletions

View File

@ -48,12 +48,12 @@ async function runTests(browser, accDoc) {
await onLoadEvents;
onLoadEvents = waitForEvents([
[EVENT_DOCUMENT_LOAD_COMPLETE, urlChecker("about:")],
[EVENT_DOCUMENT_LOAD_COMPLETE, urlChecker("about:about")],
[EVENT_STATE_CHANGE, busyChecker(false)],
[EVENT_REORDER, getAccessible(browser)]
]);
browser.loadURI("about:");
browser.loadURI("about:about");
await onLoadEvents;

View File

@ -79,6 +79,6 @@
<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>

View File

@ -40,7 +40,7 @@
children: [
{
role: ROLE_DOCUMENT,
name: aURL == "about:" ? "About:" : aURL
name: aURL == "about:license" ? "Licenses" : aURL
}
]
});
@ -53,7 +53,7 @@
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();
}

View File

@ -112,7 +112,7 @@
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();
}

View File

@ -84,7 +84,7 @@
}
SimpleTest.waitForExplicitFinish();
openBrowserWindow(doTests, "about:");
openBrowserWindow(doTests, "about:license");
]]>
</script>

View File

@ -423,7 +423,7 @@
</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>

View File

@ -95,7 +95,7 @@
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()
@ -107,7 +107,7 @@
}
SimpleTest.waitForExplicitFinish();
openBrowserWindow(doTests, "about:");
openBrowserWindow(doTests, "about:license");
]]>
</script>

View File

@ -35,7 +35,7 @@
this.invoke = function testTabRelations_invoke()
{
var docURIs = ["about:", "about:mozilla"];
var docURIs = ["about:license", "about:mozilla"];
tabBrowser().loadTabs(docURIs, {
inBackground: false,
replace: true,

View File

@ -46,7 +46,7 @@
}
SimpleTest.waitForExplicitFinish();
openBrowserWindow(doTests, "about:");
openBrowserWindow(doTests, "about:mozilla");
]]>
</script>

View File

@ -167,7 +167,7 @@
<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>

View File

@ -34,7 +34,7 @@
this.invoke = function testTabHierarchy_invoke()
{
var docURIs = ["about:", "about:mozilla"];
var docURIs = ["about:license", "about:mozilla"];
tabBrowser().loadTabs(docURIs, {
inBackground: false,
replace: true,
@ -66,7 +66,7 @@
children: []
},
{
// xul:tab ("about:")
// xul:tab ("about:license")
role: ROLE_PAGETAB,
children: []
},
@ -108,7 +108,7 @@
// probably due to size reduction in this test.
tabsAccTree.children.splice(0, 0,
{
// xul:tab ("about:")
// xul:tab ("about:license")
role: ROLE_PAGETAB,
children: [
{
@ -168,7 +168,7 @@
role: ROLE_INTERNAL_FRAME,
children: [
{
// #document ("about:")
// #document ("about:license")
role: ROLE_DOCUMENT
// children: [ ... ] // Ignore document content.
}

View File

@ -403,7 +403,7 @@ async function test_cross_process_load() {
);
// Go to a different process.
browser.loadURI("about:");
browser.loadURI("about:mozilla");
await BrowserTestUtils.browserLoaded(browser);
await soundPlayingStoppedPromise;

View File

@ -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");
});

View File

@ -6,7 +6,7 @@
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);

View File

@ -7,7 +7,7 @@
* Tests middle-clicking items in the Library.
*/
const URIs = ["about:license", "about:"];
const URIs = ["about:license", "about:mozilla"];
var gLibrary = null;

View File

@ -7,7 +7,7 @@
* Tests middle-clicking items in the Library.
*/
const URIs = ["about:license", "about:"];
const URIs = ["about:license", "about:mozilla"];
var gLibrary = null;
var gTests = [];
@ -72,7 +72,7 @@ gTests.push({
//
gTests.push({
desc: "Open a folder in tabs.",
URIs: ["about:buildconfig", "about:"],
URIs: ["about:buildconfig", "about:mozilla"],
_bookmarks: null,
async setup() {
@ -112,7 +112,7 @@ gTests.push({
gTests.push({
desc: "Open a query in tabs.",
URIs: ["about:buildconfig", "about:"],
URIs: ["about:buildconfig", "about:mozilla"],
_bookmarks: null,
_query: null,

View File

@ -7,8 +7,8 @@
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;

View File

@ -74,7 +74,7 @@ add_task(async function() {
"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);

View File

@ -16,7 +16,7 @@ add_task(async function() {
}
// 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);

View File

@ -10,6 +10,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=814638
<key key="T" modifiers="control" oncommand="receivedKeyEvent()"/>
</keyset>
<iframe flex="1" src="about:"/>
<iframe flex="1" src="about:mozilla"/>
</window>

View File

@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=865948
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();
}

View File

@ -12,7 +12,7 @@ class TestBrowserWindowShortcuts(PuppeteerMixin, MarionetteTestCase):
def test_addons_manager(self):
# If an about:xyz page is visible, no new tab will be opened
with self.marionette.using_context('content'):
self.marionette.navigate('about:')
self.marionette.navigate('about:about')
# TODO: To be moved to the upcoming add-ons library
def opener(tab):

View File

@ -78,8 +78,8 @@ class TestQuitRestart(MarionetteTestCase):
# Use a preference to check that the restart was successful. If its
# value has not been forced, a restart will cause a reset of it.
self.assertNotEqual(self.marionette.get_pref("startup.homepage_welcome_url"),
"about:")
self.marionette.set_pref("startup.homepage_welcome_url", "about:")
"about:about")
self.marionette.set_pref("startup.homepage_welcome_url", "about:about")
def tearDown(self):
# Ensure to restart a session if none exist for clean-up
@ -116,7 +116,7 @@ class TestQuitRestart(MarionetteTestCase):
# A forced restart will cause a new process id
self.assertNotEqual(self.marionette.process_id, self.pid)
self.assertNotEqual(self.marionette.get_pref("startup.homepage_welcome_url"),
"about:")
"about:about")
def test_force_restart(self):
self.marionette.restart()
@ -125,7 +125,7 @@ class TestQuitRestart(MarionetteTestCase):
# A forced restart will cause a new process id
self.assertNotEqual(self.marionette.process_id, self.pid)
self.assertNotEqual(self.marionette.get_pref("startup.homepage_welcome_url"),
"about:")
"about:about")
def test_force_clean_quit(self):
self.marionette.quit(clean=True)
@ -138,7 +138,7 @@ class TestQuitRestart(MarionetteTestCase):
self.assertNotEqual(self.marionette.profile, self.profile)
self.assertNotEqual(self.marionette.session_id, self.session_id)
self.assertNotEqual(self.marionette.get_pref("startup.homepage_welcome_url"),
"about:")
"about:about")
def test_force_quit(self):
self.marionette.quit()
@ -151,7 +151,7 @@ class TestQuitRestart(MarionetteTestCase):
self.assertEqual(self.marionette.profile, self.profile)
self.assertNotEqual(self.marionette.session_id, self.session_id)
self.assertNotEqual(self.marionette.get_pref("startup.homepage_welcome_url"),
"about:")
"about:about")
@skip("Bug 1363368 - Wrong window handles after in_app restarts")
def test_no_in_app_clean_restart(self):
@ -175,7 +175,7 @@ class TestQuitRestart(MarionetteTestCase):
self.assertNotEqual(self.marionette.process_id, self.pid)
self.assertNotEqual(self.marionette.get_pref("startup.homepage_welcome_url"),
"about:")
"about:about")
@skip("Bug 1363368 - Wrong window handles after in_app restarts")
def test_in_app_restart_with_callback(self):
@ -195,7 +195,7 @@ class TestQuitRestart(MarionetteTestCase):
self.assertNotEqual(self.marionette.process_id, self.pid)
self.assertNotEqual(self.marionette.get_pref("startup.homepage_welcome_url"),
"about:")
"about:about")
def test_in_app_restart_safe_mode(self):
if self.marionette.session_capabilities["platformName"] != "linux":
@ -255,7 +255,7 @@ class TestQuitRestart(MarionetteTestCase):
self.assertEqual(self.marionette.profile, self.profile)
self.assertNotEqual(self.marionette.session_id, self.session_id)
self.assertNotEqual(self.marionette.get_pref("startup.homepage_welcome_url"),
"about:")
"about:about")
@skip("Bug 1363368 - Wrong window handles after in_app restarts")
def test_in_app_quit_with_callback(self):
@ -271,7 +271,7 @@ class TestQuitRestart(MarionetteTestCase):
self.assertEqual(self.marionette.profile, self.profile)
self.assertNotEqual(self.marionette.session_id, self.session_id)
self.assertNotEqual(self.marionette.get_pref("startup.homepage_welcome_url"),
"about:")
"about:about")
def test_in_app_quit_with_callback_missing_shutdown(self):
try:

View File

@ -88,7 +88,8 @@ class PuppeteerMixin(object):
with self.marionette.using_context(self.marionette.CONTEXT_CONTENT):
# Bug 1312674 - Navigating to about:blank twice can cause a hang in
# Marionette. So try to always have a known default page loaded.
self.marionette.navigate('about:')
# Bug 1418979 - Update this to a test-framework-specific file.
self.marionette.navigate('about:about')
def tearDown(self, *args, **kwargs):
self.marionette.set_context('chrome')

View File

@ -21,16 +21,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=887098
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);
}