Bug 1278306 - Remove all uses of 'content.location = ' in the webconsole tests; r=bgrins

This commit is contained in:
moby 2016-06-06 13:35:00 +02:00
parent fa87aab90d
commit c4cfe0699b
16 changed files with 23 additions and 20 deletions

View File

@ -42,7 +42,7 @@ add_task(function* () {
yield waitForMessages(msgForLocation1);
// load second url
content.location = TEST_URI2;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI2);
yield loadBrowser(gBrowser.selectedBrowser);
is(hud.outputNode.textContent.indexOf("Permission denied"), -1,

View File

@ -56,7 +56,7 @@ function loadDocument(browser) {
browser.removeEventListener("load", onLoad, true);
deferred.resolve();
}, true);
content.location = TEST_PATH;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_PATH);
return deferred.promise;
}

View File

@ -23,7 +23,7 @@ add_task(function* () {
expectUncaughtException();
}
content.location = TEST_URI;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI);
yield waitForMessages({
webconsole: hud,

View File

@ -28,7 +28,7 @@ add_task(function* () {
hud.jsterm.clearOutput();
let loaded = loadBrowser(browser);
content.location = uri.spec;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, uri.spec);
yield loaded;
yield testMessages();

View File

@ -179,7 +179,7 @@ function testNext() {
startNextTest();
}, true);
content.location = testLocation;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testLocation);
} else {
testEnded = true;
finishTest();

View File

@ -37,7 +37,7 @@ function consoleOpened(hud) {
deferred.resolve();
}
};
content.location = TEST_URI2;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI2);
return deferred.promise;
}

View File

@ -33,7 +33,7 @@ add_task(function* () {
expectUncaughtException();
}
content.location = TEST_URI;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI);
yield loaded;
yield testWebDevLimits();

View File

@ -104,6 +104,6 @@ function test() {
waitForFocus(createDocument, content);
}, true);
content.location = "data:text/html;charset=utf-8,test for highlighter " +
"helper in web console";
BrowserTestUtils.loadURI(gBrowser.selectedBrowser,
"data:text/html;charset=utf-8,test for highlighter helper in web console");
}

View File

@ -30,7 +30,7 @@ add_task(function* () {
});
var testMixedContent = Task.async(function* (hud) {
content.location = TEST_HTTPS_URI;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_HTTPS_URI);
let results = yield waitForMessages({
webconsole: hud,

View File

@ -23,7 +23,7 @@ add_task(function* () {
hud.jsterm.clearOutput();
let loaded = loadBrowser(browser);
content.location = TEST_VIOLATION;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_VIOLATION);
yield loaded;
yield waitForSuccess({

View File

@ -50,10 +50,10 @@ function runTestLoop(theHud) {
if (gCurrentTest.pref) {
SpecialPowers.pushPrefEnv({"set": gCurrentTest.pref},
function () {
content.location = gCurrentTest.url;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, gCurrentTest.url);
});
} else {
content.location = gCurrentTest.url;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, gCurrentTest.url);
}
}

View File

@ -26,7 +26,7 @@ function test() {
const {tab} = yield loadTab("data:text/html;charset=utf8,<p>hello</p>");
const hud = yield openConsole(tab);
content.location = TEST_PAGE_URI;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_PAGE_URI);
let messages = yield waitForMessages({
webconsole: hud,

View File

@ -66,7 +66,7 @@ add_task(function* () {
function* checkForMessage(curTest, hud) {
hud.jsterm.clearOutput();
content.location = curTest.url;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, curTest.url);
let results = yield waitForMessages({
webconsole: hud,

View File

@ -26,7 +26,7 @@ add_task(function* () {
HUDService.lastFinishedRequest.callback = request => requests.push(request);
let loaded = loadBrowser(browser);
content.location = TEST_FILE_URI;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_FILE_URI);
yield loaded;
yield testMessages();

View File

@ -56,7 +56,7 @@ function loadDocument(browser) {
browser.removeEventListener("load", onLoad, true);
deferred.resolve();
}, true);
content.location = TEST_PATH;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_PATH);
return deferred.promise;
}

View File

@ -31,7 +31,8 @@ add_task(function* () {
if (!Services.appinfo.browserTabsRemoteAutostart) {
expectUncaughtException();
}
content.location = "data:text/html;charset=utf8,<script>'use strict';function f(a, a) {};</script>";
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "data:text/html;charset="
+ "utf8,<script>'use strict';function f(a, a) {};</script>");
yield waitForMessages({
webconsole: hud,
@ -47,7 +48,8 @@ add_task(function* () {
if (!Services.appinfo.browserTabsRemoteAutostart) {
expectUncaughtException();
}
content.location = "data:text/html;charset=utf8,<script>'use strict';var o = {get p() {}};o.p = 1;</script>";
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "data:text/html;charset="
+ "utf8,<script>'use strict';var o = {get p() {}};o.p = 1;</script>");
yield waitForMessages({
webconsole: hud,
@ -63,7 +65,8 @@ add_task(function* () {
if (!Services.appinfo.browserTabsRemoteAutostart) {
expectUncaughtException();
}
content.location = "data:text/html;charset=utf8,<script>'use strict';v = 1;</script>";
BrowserTestUtils.loadURI(gBrowser.selectedBrowser,
"data:text/html;charset=utf8,<script>'use strict';v = 1;</script>");
yield waitForMessages({
webconsole: hud,