зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1362993 - Rewrite gBrowser.addTab() to use BrowserTestUtils.addTab(). r=florian
This commit is contained in:
Родитель
48324979f7
Коммит
e4f38c8d7c
|
@ -35,7 +35,7 @@ function test() {
|
|||
ok(!ALERT_SERVICE.manualDoNotDisturb, "Alert service should not be disabled when test starts");
|
||||
ALERT_SERVICE.manualDoNotDisturb = false;
|
||||
|
||||
tab = gBrowser.addTab(notificationURL);
|
||||
tab = BrowserTestUtils.addTab(gBrowser, notificationURL);
|
||||
gBrowser.selectedTab = tab;
|
||||
tab.linkedBrowser.addEventListener("load", onLoad, true);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ function test() {
|
|||
|
||||
pm.add(makeURI(notificationURL), "desktop-notification", pm.ALLOW_ACTION);
|
||||
|
||||
tab = gBrowser.addTab(notificationURL);
|
||||
tab = BrowserTestUtils.addTab(gBrowser, notificationURL);
|
||||
gBrowser.selectedTab = tab;
|
||||
tab.linkedBrowser.addEventListener("load", onLoad, true);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ add_task(async function checkCaptivePortalCertErrorUI() {
|
|||
let browser;
|
||||
let certErrorLoaded;
|
||||
let errorTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
|
||||
let tab = gBrowser.addTab(BAD_CERT_PAGE);
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, BAD_CERT_PAGE);
|
||||
gBrowser.selectedTab = tab;
|
||||
browser = gBrowser.selectedBrowser;
|
||||
certErrorLoaded = BrowserTestUtils.waitForContentEvent(browser, "DOMContentLoaded");
|
||||
|
|
|
@ -17,7 +17,7 @@ add_task(async function checkReturnToAboutHome() {
|
|||
let browser;
|
||||
let certErrorLoaded;
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
|
||||
gBrowser.selectedTab = gBrowser.addTab(BAD_CERT);
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, BAD_CERT);
|
||||
browser = gBrowser.selectedBrowser;
|
||||
certErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
|
||||
}, false);
|
||||
|
@ -126,7 +126,7 @@ add_task(async function checkWrongSystemTimeWarning() {
|
|||
let browser;
|
||||
let certErrorLoaded;
|
||||
await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
|
||||
gBrowser.selectedTab = gBrowser.addTab(BAD_CERT);
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, BAD_CERT);
|
||||
browser = gBrowser.selectedBrowser;
|
||||
certErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
|
||||
}, false);
|
||||
|
@ -224,7 +224,7 @@ add_task(async function checkAdvancedDetails() {
|
|||
let browser;
|
||||
let certErrorLoaded;
|
||||
await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
|
||||
gBrowser.selectedTab = gBrowser.addTab(BAD_CERT);
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, BAD_CERT);
|
||||
browser = gBrowser.selectedBrowser;
|
||||
certErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
|
||||
}, false);
|
||||
|
@ -286,7 +286,7 @@ add_task(async function checkAdvancedDetailsForHSTS() {
|
|||
let browser;
|
||||
let certErrorLoaded;
|
||||
await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
|
||||
gBrowser.selectedTab = gBrowser.addTab(BAD_STS_CERT);
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, BAD_STS_CERT);
|
||||
browser = gBrowser.selectedBrowser;
|
||||
certErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
|
||||
}, false);
|
||||
|
@ -355,7 +355,7 @@ add_task(async function checkUnknownIssuerLearnMoreLink() {
|
|||
let browser;
|
||||
let certErrorLoaded;
|
||||
await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
|
||||
gBrowser.selectedTab = gBrowser.addTab(UNKNOWN_ISSUER);
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, UNKNOWN_ISSUER);
|
||||
browser = gBrowser.selectedBrowser;
|
||||
certErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
|
||||
}, false);
|
||||
|
|
|
@ -115,7 +115,7 @@ function test() {
|
|||
|
||||
function promiseNewTabLoadEvent(aUrl, aEventType = "load") {
|
||||
return new Promise(resolve => {
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab(aUrl);
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, aUrl);
|
||||
tab.linkedBrowser.addEventListener(aEventType, function(event) {
|
||||
let iframe = tab.linkedBrowser.contentDocument.getElementById("remote-report");
|
||||
iframe.addEventListener("load", function frameLoad(e) {
|
||||
|
|
|
@ -16,7 +16,7 @@ add_task(async function checkReturnToPreviousPage() {
|
|||
let browser;
|
||||
let pageLoaded;
|
||||
await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
|
||||
gBrowser.selectedTab = gBrowser.addTab(LOW_TLS_VERSION);
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, LOW_TLS_VERSION);
|
||||
browser = gBrowser.selectedBrowser;
|
||||
pageLoaded = BrowserTestUtils.waitForErrorPage(browser);
|
||||
}, false);
|
||||
|
|
|
@ -87,8 +87,8 @@ var gNextTest;
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBackgroundTab = gBrowser.addTab();
|
||||
gForegroundTab = gBrowser.addTab();
|
||||
gBackgroundTab = BrowserTestUtils.addTab(gBrowser);
|
||||
gForegroundTab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBackgroundBrowser = gBrowser.getBrowserForTab(gBackgroundTab);
|
||||
gForegroundBrowser = gBrowser.getBrowserForTab(gForegroundTab);
|
||||
gBrowser.selectedTab = gForegroundTab;
|
||||
|
|
|
@ -20,7 +20,7 @@ var tests = [
|
|||
];
|
||||
|
||||
add_task(async function() {
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
browser.stop(); // stop the about:blank load.
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ function test() {
|
|||
waitForExplicitFinish();
|
||||
|
||||
(async function() {
|
||||
gTab1 = gBrowser.addTab();
|
||||
gTab2 = gBrowser.addTab();
|
||||
gTab1 = BrowserTestUtils.addTab(gBrowser);
|
||||
gTab2 = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
await FullZoomHelper.selectTabAndWaitForLocationChange(gTab1);
|
||||
await FullZoomHelper.load(gTab1, TEST_PAGE);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
function test() {
|
||||
var tab = gBrowser.addTab("about:blank", { skipAnimation: true });
|
||||
var tab = BrowserTestUtils.addTab(gBrowser, "about:blank", { skipAnimation: true });
|
||||
gBrowser.removeTab(tab);
|
||||
is(tab.parentNode, null, "tab removed immediately");
|
||||
|
||||
tab = gBrowser.addTab("about:blank", { skipAnimation: true });
|
||||
tab = BrowserTestUtils.addTab(gBrowser, "about:blank", { skipAnimation: true });
|
||||
gBrowser.removeTab(tab, { animate: true });
|
||||
gBrowser.removeTab(tab);
|
||||
is(tab.parentNode, null, "tab removed immediately when calling removeTab again after the animation was kicked off");
|
||||
|
|
|
@ -9,9 +9,9 @@ function test() {
|
|||
waitForExplicitFinish();
|
||||
|
||||
(async function() {
|
||||
gTab1 = gBrowser.addTab(gTestPage);
|
||||
gTab2 = gBrowser.addTab();
|
||||
gTab3 = gBrowser.addTab();
|
||||
gTab1 = BrowserTestUtils.addTab(gBrowser, gTestPage);
|
||||
gTab2 = BrowserTestUtils.addTab(gBrowser);
|
||||
gTab3 = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
await FullZoomHelper.selectTabAndWaitForLocationChange(gTab1);
|
||||
await FullZoomHelper.load(gTab1, gTestPage);
|
||||
|
|
|
@ -20,7 +20,7 @@ function test() {
|
|||
}
|
||||
|
||||
function addTab(aURI, aIndex) {
|
||||
var tab = gBrowser.addTab(aURI);
|
||||
var tab = BrowserTestUtils.addTab(gBrowser, aURI);
|
||||
if (aIndex == 0)
|
||||
gBrowser.removeTab(gBrowser.tabs[0], {skipPermitUnload: true});
|
||||
|
||||
|
@ -46,7 +46,7 @@ function doTabsTest() {
|
|||
gBrowser.removeTab(gBrowser.tabs[0], {skipPermitUnload: true});
|
||||
is(gBrowser.tabs.length, 1, "Related tabs are not closed unexpectedly");
|
||||
|
||||
gBrowser.addTab("about:blank");
|
||||
BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
gBrowser.removeTab(gBrowser.tabs[0], {skipPermitUnload: true});
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ function test() {
|
|||
waitForExplicitFinish();
|
||||
|
||||
(async function() {
|
||||
tabElm = gBrowser.addTab();
|
||||
tabElm = BrowserTestUtils.addTab(gBrowser);
|
||||
await FullZoomHelper.selectTabAndWaitForLocationChange(tabElm);
|
||||
await FullZoomHelper.load(tabElm, "http://mochi.test:8888/browser/browser/base/content/test/general/zoom_test.html");
|
||||
})().then(start_test_prefNotSet, FullZoomHelper.failAndContinue(finish));
|
||||
|
|
|
@ -3,11 +3,11 @@ function test() {
|
|||
|
||||
(async function() {
|
||||
let testPage = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
|
||||
let tab1 = gBrowser.addTab();
|
||||
let tab1 = BrowserTestUtils.addTab(gBrowser);
|
||||
await FullZoomHelper.selectTabAndWaitForLocationChange(tab1);
|
||||
await FullZoomHelper.load(tab1, testPage);
|
||||
|
||||
let tab2 = gBrowser.addTab();
|
||||
let tab2 = BrowserTestUtils.addTab(gBrowser);
|
||||
await FullZoomHelper.load(tab2, testPage);
|
||||
|
||||
FullZoom.enlarge();
|
||||
|
|
|
@ -15,7 +15,7 @@ var intervalID;
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedBrowser.addEventListener("load", test1Setup, true);
|
||||
content.location = testPage;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ function remote(task) {
|
|||
}
|
||||
|
||||
add_task(async function() {
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
let promise = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
|
||||
gBrowser.loadURI("https://nocert.example.com/");
|
||||
|
|
|
@ -43,7 +43,7 @@ function add_bookmark(aURI, aTitle) {
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
waitForStarChange(false, initTest);
|
||||
}, {capture: true, once: true});
|
||||
|
|
|
@ -19,7 +19,7 @@ function test() {
|
|||
Services.prefs.setBoolPref("browser.cache.disk.enable", false);
|
||||
Services.prefs.setBoolPref("browser.cache.memory.enable", false);
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab("http://example.com/");
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "http://example.com/");
|
||||
|
||||
let contentScript = `
|
||||
let listener = function () {
|
||||
|
|
|
@ -15,7 +15,7 @@ function test() {
|
|||
|
||||
(async function() {
|
||||
// Prepare the test tab
|
||||
let tab = gBrowser.addTab();
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
await FullZoomHelper.selectTabAndWaitForLocationChange(tab);
|
||||
|
||||
let testBrowser = tab.linkedBrowser;
|
||||
|
|
|
@ -11,8 +11,8 @@ function focus_in_navbar() {
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
tab1 = gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||
tab2 = gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||
tab1 = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
|
||||
tab2 = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(tab1, {});
|
||||
executeSoon(step2);
|
||||
|
|
|
@ -7,7 +7,7 @@ const iconURLSpec = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAA
|
|||
var testPage = "data:text/plain,test bug 477014";
|
||||
|
||||
add_task(async function() {
|
||||
let tabToDetach = gBrowser.addTab(testPage);
|
||||
let tabToDetach = BrowserTestUtils.addTab(gBrowser, testPage);
|
||||
await waitForDocLoadComplete(tabToDetach.linkedBrowser);
|
||||
|
||||
gBrowser.setIcon(tabToDetach, iconURLSpec,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab(
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser,
|
||||
"http://mochi.test:8888/browser/browser/base/content/test/general/browser_bug479408_sample.html");
|
||||
|
||||
gBrowser.addEventListener("DOMLinkAdded", function(aEvent) {
|
||||
|
|
|
@ -10,12 +10,12 @@ function test() {
|
|||
let newWin, tabA, tabB;
|
||||
|
||||
// test normal close
|
||||
tabA = gBrowser.addTab(testPage);
|
||||
tabA = BrowserTestUtils.addTab(gBrowser, testPage);
|
||||
gBrowser.tabContainer.addEventListener("TabClose", function(firstTabCloseEvent) {
|
||||
ok(!firstTabCloseEvent.detail.adoptedBy, "This was a normal tab close");
|
||||
|
||||
// test tab close by moving
|
||||
tabB = gBrowser.addTab(testPage);
|
||||
tabB = BrowserTestUtils.addTab(gBrowser, testPage);
|
||||
gBrowser.tabContainer.addEventListener("TabClose", function(secondTabCloseEvent) {
|
||||
executeSoon(function() {
|
||||
ok(secondTabCloseEvent.detail.adoptedBy, "This was a tab closed by moving");
|
||||
|
|
|
@ -11,7 +11,7 @@ const URIS = [
|
|||
|
||||
add_task(async function() {
|
||||
for (let uri of URIS) {
|
||||
let tab = gBrowser.addTab();
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
await BrowserTestUtils.loadURI(tab.linkedBrowser, uri);
|
||||
|
||||
let win = gBrowser.replaceTabWithWindow(tab);
|
||||
|
|
|
@ -8,7 +8,7 @@ function test() {
|
|||
tabIndex = gBrowser.tabs.length;
|
||||
gBrowser.addTabsProgressListener(progressListener);
|
||||
gBrowser.tabContainer.addEventListener("TabOpen", TabOpen);
|
||||
gBrowser.addTab("data:text/html,<html><head><link href='about:logo' rel='shortcut icon'>");
|
||||
BrowserTestUtils.addTab(gBrowser, "data:text/html,<html><head><link href='about:logo' rel='shortcut icon'>");
|
||||
}
|
||||
|
||||
function record(aName) {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
function test() {
|
||||
var tab1 = gBrowser.selectedTab;
|
||||
var tab2 = gBrowser.addTab();
|
||||
var tab2 = BrowserTestUtils.addTab(gBrowser);
|
||||
var childTab1;
|
||||
var childTab2;
|
||||
|
||||
childTab1 = gBrowser.addTab("about:blank", { relatedToCurrent: true });
|
||||
childTab1 = BrowserTestUtils.addTab(gBrowser, "about:blank", { relatedToCurrent: true });
|
||||
gBrowser.selectedTab = childTab1;
|
||||
gBrowser.removeTab(gBrowser.selectedTab, { skipPermitUnload: true });
|
||||
is(idx(gBrowser.selectedTab), idx(tab1),
|
||||
"closing a tab next to its parent selects the parent");
|
||||
|
||||
childTab1 = gBrowser.addTab("about:blank", { relatedToCurrent: true });
|
||||
childTab1 = BrowserTestUtils.addTab(gBrowser, "about:blank", { relatedToCurrent: true });
|
||||
gBrowser.selectedTab = tab2;
|
||||
gBrowser.selectedTab = childTab1;
|
||||
gBrowser.removeTab(gBrowser.selectedTab, { skipPermitUnload: true });
|
||||
|
@ -18,8 +18,8 @@ function test() {
|
|||
"closing a tab next to its parent doesn't select the parent if another tab had been selected ad interim");
|
||||
|
||||
gBrowser.selectedTab = tab1;
|
||||
childTab1 = gBrowser.addTab("about:blank", { relatedToCurrent: true });
|
||||
childTab2 = gBrowser.addTab("about:blank", { relatedToCurrent: true });
|
||||
childTab1 = BrowserTestUtils.addTab(gBrowser, "about:blank", { relatedToCurrent: true });
|
||||
childTab2 = BrowserTestUtils.addTab(gBrowser, "about:blank", { relatedToCurrent: true });
|
||||
gBrowser.selectedTab = childTab1;
|
||||
gBrowser.removeTab(gBrowser.selectedTab, { skipPermitUnload: true });
|
||||
is(idx(gBrowser.selectedTab), idx(childTab2),
|
||||
|
|
|
@ -15,8 +15,8 @@ var Clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard
|
|||
var HasFindClipboard = Clipboard.supportsFindClipboard();
|
||||
|
||||
function addTabWithText(aText, aCallback) {
|
||||
let newTab = gBrowser.addTab("data:text/html;charset=utf-8,<h1 id='h1'>" +
|
||||
aText + "</h1>");
|
||||
let newTab = BrowserTestUtils.addTab(gBrowser, "data:text/html;charset=utf-8,<h1 id='h1'>" +
|
||||
aText + "</h1>");
|
||||
tabs.push(newTab);
|
||||
gBrowser.selectedTab = newTab;
|
||||
}
|
||||
|
|
|
@ -437,7 +437,7 @@ function test_restartless() {
|
|||
let triggers = encodeURIComponent(JSON.stringify({
|
||||
"XPI": "restartless.xpi"
|
||||
}));
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
|
||||
await progressPromise;
|
||||
let installDialog = await dialogPromise;
|
||||
|
@ -590,7 +590,7 @@ function test_url() {
|
|||
return (async function() {
|
||||
let progressPromise = waitForProgressNotification();
|
||||
let dialogPromise = waitForInstallDialog();
|
||||
gBrowser.selectedTab = gBrowser.addTab("about:blank");
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
gBrowser.loadURI(TESTROOT + "amosigned.xpi");
|
||||
await progressPromise;
|
||||
|
@ -631,7 +631,7 @@ function test_localFile() {
|
|||
resolve();
|
||||
}, "addon-install-failed");
|
||||
});
|
||||
gBrowser.selectedTab = gBrowser.addTab("about:blank");
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
gBrowser.loadURI(path);
|
||||
await failPromise;
|
||||
|
@ -658,7 +658,7 @@ function test_tabClose() {
|
|||
|
||||
let progressPromise = waitForProgressNotification();
|
||||
let dialogPromise = waitForInstallDialog();
|
||||
gBrowser.selectedTab = gBrowser.addTab("about:blank");
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
gBrowser.loadURI(TESTROOT + "amosigned.xpi");
|
||||
await progressPromise;
|
||||
|
@ -714,7 +714,7 @@ function test_urlBar() {
|
|||
let progressPromise = waitForProgressNotification();
|
||||
let dialogPromise = waitForInstallDialog();
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab("about:blank");
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
gURLBar.value = TESTROOT + "amosigned.xpi";
|
||||
gURLBar.focus();
|
||||
|
@ -744,7 +744,7 @@ function test_urlBar() {
|
|||
function test_wrongHost() {
|
||||
return (async function() {
|
||||
let requestedUrl = TESTROOT2 + "enabled.html";
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, requestedUrl);
|
||||
gBrowser.loadURI(TESTROOT2 + "enabled.html");
|
||||
|
|
|
@ -24,7 +24,7 @@ function testInitialZoom() {
|
|||
gTestZoom = ZoomManager.zoom;
|
||||
isnot(gTestZoom, 1, "zoom level should have changed");
|
||||
|
||||
gBgTab = gBrowser.addTab();
|
||||
gBgTab = BrowserTestUtils.addTab(gBrowser);
|
||||
await FullZoomHelper.load(gBgTab, "http://mochi.test:8888" + TEST_PAGE);
|
||||
})().then(testBackgroundLoad, FullZoomHelper.failAndContinue(finish));
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ function test() {
|
|||
waitForExplicitFinish();
|
||||
|
||||
(async function() {
|
||||
gTestTab = gBrowser.addTab();
|
||||
gTestTab = BrowserTestUtils.addTab(gBrowser);
|
||||
await FullZoomHelper.selectTabAndWaitForLocationChange(gTestTab);
|
||||
await FullZoomHelper.load(gTestTab, "http://example.org" + TEST_PAGE);
|
||||
})().then(testInitialZoom, FullZoomHelper.failAndContinue(finish));
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
let tabSelected = false;
|
||||
|
||||
// Open the base tab
|
||||
let baseTab = gBrowser.addTab(testURL);
|
||||
let baseTab = BrowserTestUtils.addTab(gBrowser, testURL);
|
||||
|
||||
// Wait for the tab to be fully loaded so matching happens correctly
|
||||
await promiseTabLoaded(baseTab);
|
||||
|
@ -15,7 +15,7 @@
|
|||
return;
|
||||
baseTab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
let testTab = gBrowser.addTab();
|
||||
let testTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
// Select the testTab
|
||||
gBrowser.selectedTab = testTab;
|
||||
|
|
|
@ -13,7 +13,7 @@ function test() {
|
|||
let uri = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
|
||||
|
||||
(async function() {
|
||||
tab = gBrowser.addTab();
|
||||
tab = BrowserTestUtils.addTab(gBrowser);
|
||||
await FullZoomHelper.load(tab, uri);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
|
|
@ -40,7 +40,7 @@ function getEmptyFrame() {
|
|||
}
|
||||
|
||||
async function openNewTab(uri, background) {
|
||||
let tab = gBrowser.addTab();
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
let browser = gBrowser.getBrowserForTab(tab);
|
||||
if (!background) {
|
||||
gBrowser.selectedTab = tab;
|
||||
|
|
|
@ -10,8 +10,8 @@ function press(key, expectedPos) {
|
|||
}
|
||||
|
||||
function test() {
|
||||
gBrowser.addTab();
|
||||
gBrowser.addTab();
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
is(gBrowser.tabs.length, 3, "got three tabs");
|
||||
is(gBrowser.tabs[0], gBrowser.selectedTab, "first tab is selected");
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ var waitForTabOpen = async function() {
|
|||
};
|
||||
|
||||
var testLink = async function(aLinkIndexOrFunction, pinTab, expectNewTab, testSubFrame, aURL = TEST_URL) {
|
||||
let appTab = gBrowser.addTab(aURL, {skipAnimation: true});
|
||||
let appTab = BrowserTestUtils.addTab(gBrowser, aURL, {skipAnimation: true});
|
||||
if (pinTab)
|
||||
gBrowser.pinTab(appTab);
|
||||
gBrowser.selectedTab = appTab;
|
||||
|
|
|
@ -10,8 +10,8 @@ function test() {
|
|||
waitForExplicitFinish();
|
||||
|
||||
(async function() {
|
||||
tab1 = gBrowser.addTab();
|
||||
tab2 = gBrowser.addTab();
|
||||
tab1 = BrowserTestUtils.addTab(gBrowser);
|
||||
tab2 = BrowserTestUtils.addTab(gBrowser);
|
||||
await FullZoomHelper.selectTabAndWaitForLocationChange(tab1);
|
||||
await FullZoomHelper.load(tab1, TEST_IMAGE);
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ function test() {
|
|||
|
||||
// Open 2 other tabs, and pin the second one. Like that, the initial tab
|
||||
// should get closed.
|
||||
let testTab1 = gBrowser.addTab();
|
||||
let testTab2 = gBrowser.addTab();
|
||||
let testTab1 = BrowserTestUtils.addTab(gBrowser);
|
||||
let testTab2 = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.pinTab(testTab2);
|
||||
|
||||
// Now execute "Close other Tabs" on the first manually opened tab (tab1).
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function test() {
|
||||
let newTab = gBrowser.addTab();
|
||||
let newTab = BrowserTestUtils.addTab(gBrowser);
|
||||
waitForExplicitFinish();
|
||||
BrowserTestUtils.browserLoaded(newTab.linkedBrowser).then(mainPart);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ function test() {
|
|||
|
||||
testState(false);
|
||||
|
||||
let pinnedTab = gBrowser.addTab("about:blank");
|
||||
let pinnedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
gBrowser.pinTab(pinnedTab);
|
||||
|
||||
// Just pinning the tab shouldn't change the key state.
|
||||
|
|
|
@ -15,7 +15,7 @@ function test() {
|
|||
is(numClosedTabs(), 0, "There should be 0 closed tabs.");
|
||||
ok(!isUndoCloseEnabled(), "Undo Close Tab should be disabled.");
|
||||
|
||||
var tab = gBrowser.addTab("http://mochi.test:8888/");
|
||||
var tab = BrowserTestUtils.addTab(gBrowser, "http://mochi.test:8888/");
|
||||
var browser = gBrowser.getBrowserForTab(tab);
|
||||
BrowserTestUtils.browserLoaded(browser).then(() => {
|
||||
BrowserTestUtils.removeTab(tab).then(() => {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
function test() {
|
||||
// Create a new tab and load about:addons
|
||||
let blanktab = gBrowser.addTab();
|
||||
let blanktab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedTab = blanktab;
|
||||
BrowserOpenAddonsMgr();
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ function test() {
|
|||
});
|
||||
waitForExplicitFinish();
|
||||
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
tab.linkedBrowser.addEventListener("load", (function(event) {
|
||||
let uri = makeURI(testURL);
|
||||
let bmTxn =
|
||||
|
|
|
@ -3,7 +3,7 @@ var tab;
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
tab = gBrowser.addTab();
|
||||
tab = BrowserTestUtils.addTab(gBrowser);
|
||||
isnot(tab.getAttribute("fadein"), "true", "newly opened tab is yet to fade in");
|
||||
|
||||
// Try to remove the tab right before the opening animation's first frame
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
function test() {
|
||||
let tab1 = gBrowser.selectedTab;
|
||||
let tab2 = gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||
gBrowser.addTab();
|
||||
let tab2 = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedTab = tab2;
|
||||
|
||||
gBrowser.removeCurrentTab({animate: true});
|
||||
|
|
|
@ -40,7 +40,7 @@ function test_install_http() {
|
|||
var pm = Services.perms;
|
||||
pm.add(makeURI("http://example.org/"), "install", pm.ALLOW_ACTION);
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab("http://example.org/browser/browser/base/content/test/general/bug592338.html");
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "http://example.org/browser/browser/base/content/test/general/bug592338.html");
|
||||
gBrowser.selectedBrowser.addEventListener("pageshow", function() {
|
||||
if (gBrowser.contentDocument.location.href == "about:blank")
|
||||
return;
|
||||
|
@ -67,7 +67,7 @@ function test_install_lwtheme() {
|
|||
var pm = Services.perms;
|
||||
pm.add(makeURI("https://example.com/"), "install", pm.ALLOW_ACTION);
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab("https://example.com/browser/browser/base/content/test/general/bug592338.html");
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "https://example.com/browser/browser/base/content/test/general/bug592338.html");
|
||||
gBrowser.selectedBrowser.addEventListener("pageshow", function() {
|
||||
if (gBrowser.contentDocument.location.href == "about:blank")
|
||||
return;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function test() {
|
||||
let newTab = gBrowser.addTab("http://example.com");
|
||||
let newTab = BrowserTestUtils.addTab(gBrowser, "http://example.com");
|
||||
waitForExplicitFinish();
|
||||
BrowserTestUtils.browserLoaded(newTab.linkedBrowser).then(mainPart);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ add_task(async function() {
|
|||
ok(gInvalidFormPopup,
|
||||
"The browser should have a popup to show when a form is invalid");
|
||||
|
||||
let tab = gBrowser.addTab();
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
let browser = gBrowser.getBrowserForTab(tab);
|
||||
gBrowser.selectedTab = tab;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ function finishTest() {
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
|
||||
if (BookmarkingUI.status == BookmarkingUI.STATUS_UPDATING) {
|
||||
waitForCondition(() => BookmarkingUI.status != BookmarkingUI.STATUS_UPDATING, finishTest, "BookmarkingUI was updating for too long");
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
// Bug 655584 - awesomebar suggestions don't update after tab is closed
|
||||
|
||||
add_task(async function() {
|
||||
var tab1 = gBrowser.addTab();
|
||||
var tab2 = gBrowser.addTab();
|
||||
var tab1 = BrowserTestUtils.addTab(gBrowser);
|
||||
var tab2 = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
// When urlbar in a new tab is focused, and a tab switch occurs,
|
||||
// the urlbar popup should be closed
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
var tab = gBrowser.addTab();
|
||||
var tab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
tab.addEventListener("TabClose", function() {
|
||||
ok(tab.linkedBrowser, "linkedBrowser should still exist during the TabClose event");
|
||||
|
|
|
@ -160,7 +160,7 @@ function test2() {
|
|||
is(gHistorySwipeAnimation._trackedSnapshots.length, 2, "Length of " +
|
||||
"snapshot array is equal to 2 after loading two pages");
|
||||
let prevTab = tab;
|
||||
tab = gBrowser.addTab("about:newtab");
|
||||
tab = BrowserTestUtils.addTab(gBrowser, "about:newtab");
|
||||
gBrowser.selectedTab = tab;
|
||||
load(tab, HTTPROOT + "browser_bug678392-2.html" /* initial page */,
|
||||
function() {
|
||||
|
|
|
@ -12,8 +12,8 @@ function test() {
|
|||
waitForExplicitFinish();
|
||||
|
||||
(async function() {
|
||||
gTab1 = gBrowser.addTab();
|
||||
gTab2 = gBrowser.addTab();
|
||||
gTab1 = BrowserTestUtils.addTab(gBrowser);
|
||||
gTab2 = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
await FullZoomHelper.selectTabAndWaitForLocationChange(gTab1);
|
||||
await FullZoomHelper.load(gTab1, TEST_PAGE);
|
||||
|
|
|
@ -9,7 +9,7 @@ const DUMMY_PAGE = "http://example.org/browser/browser/base/content/test/general
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let tab = gBrowser.addTab();
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedTab = tab;
|
||||
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, DUMMY_PAGE);
|
||||
|
|
|
@ -31,13 +31,13 @@ function test() {
|
|||
}
|
||||
|
||||
function preparePendingTab(aCallback) {
|
||||
let tab = gBrowser.addTab(URL);
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, URL);
|
||||
|
||||
whenLoaded(tab.linkedBrowser, function() {
|
||||
BrowserTestUtils.removeTab(tab).then(() => {
|
||||
let [{state}] = JSON.parse(SessionStore.getClosedTabData(window));
|
||||
|
||||
tab = gBrowser.addTab("about:blank");
|
||||
tab = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
whenLoaded(tab.linkedBrowser, function() {
|
||||
SessionStore.setTabState(tab, JSON.stringify(state));
|
||||
ok(tab.hasAttribute("pending"), "tab should be pending");
|
||||
|
|
|
@ -7,7 +7,7 @@ var testPage = "<body style='margin: 0'>" +
|
|||
"</body>";
|
||||
|
||||
add_task(async function() {
|
||||
let tab = gBrowser.addTab();
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
let browser = gBrowser.getBrowserForTab(tab);
|
||||
|
||||
gBrowser.selectedTab = tab;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
add_task(async function() {
|
||||
gPrefService.setBoolPref("browser.ctrlTab.previews", true);
|
||||
|
||||
gBrowser.addTab();
|
||||
gBrowser.addTab();
|
||||
gBrowser.addTab();
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
checkTabs(4);
|
||||
|
||||
|
@ -37,7 +37,7 @@ add_task(async function() {
|
|||
await releaseCtrl();
|
||||
}
|
||||
|
||||
gBrowser.addTab();
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
checkTabs(3);
|
||||
await ctrlTabTest([2, 1, 0], 7, 1);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ function setHandlerFunc(aResultFunc) {
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
browser = gBrowser.selectedBrowser;
|
||||
browser.addEventListener("load", function(event) {
|
||||
iconDiscovery();
|
||||
|
|
|
@ -146,7 +146,7 @@ add_task(async function() {
|
|||
["full-screen-api.transition-duration.enter", "0 0"],
|
||||
["full-screen-api.transition-duration.leave", "0 0"]);
|
||||
|
||||
let tab = gBrowser.addTab(kPage);
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, kPage);
|
||||
let browser = tab.linkedBrowser;
|
||||
gBrowser.selectedTab = tab;
|
||||
await waitForDocLoadComplete();
|
||||
|
|
|
@ -37,7 +37,7 @@ function waitForDialogDestroyed(node, callback) {
|
|||
}
|
||||
|
||||
add_task(async function() {
|
||||
testTab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
testTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
await promiseTabLoadEvent(testTab, TEST_PAGE);
|
||||
// XXXgijs the reason this has nesting and callbacks rather than promises is
|
||||
// that DOM promises resolve on the next tick. So they're scheduled
|
||||
|
|
|
@ -31,7 +31,7 @@ function test() {
|
|||
EventUtils.synthesizeKey("VK_ESCAPE", {}, window);
|
||||
|
||||
// now test dragging onto a tab
|
||||
var tab = gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||
var tab = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
|
||||
var browser = gBrowser.getBrowserForTab(tab);
|
||||
|
||||
browser.addEventListener("load", function() {
|
||||
|
|
|
@ -41,7 +41,7 @@ const CANREMOTE = "chrome://mochitests-any" + PATH;
|
|||
const MUSTREMOTE = "chrome://mochitests-content" + PATH;
|
||||
|
||||
add_task(async function init() {
|
||||
gBrowser.selectedTab = gBrowser.addTab("about:blank");
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
});
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
|
|
|
@ -116,7 +116,7 @@ add_task(async function test_navigation() {
|
|||
|
||||
info("1");
|
||||
// Create a tab and load a remote page in it
|
||||
gBrowser.selectedTab = gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
|
||||
let {permanentKey} = gBrowser.selectedBrowser;
|
||||
await waitForLoad("http://example.org/" + DUMMY_PATH);
|
||||
is(gBrowser.selectedBrowser.isRemoteBrowser, expectedRemote, "Remote attribute should be correct");
|
||||
|
@ -193,7 +193,7 @@ add_task(async function test_synchronous() {
|
|||
|
||||
info("1");
|
||||
// Create a tab and load a remote page in it
|
||||
gBrowser.selectedTab = gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
|
||||
let {permanentKey} = gBrowser.selectedBrowser;
|
||||
await waitForLoad("http://example.org/" + DUMMY_PATH);
|
||||
is(gBrowser.selectedBrowser.isRemoteBrowser, expectedRemote, "Remote attribute should be correct");
|
||||
|
@ -233,7 +233,7 @@ add_task(async function test_loadflags() {
|
|||
|
||||
info("1");
|
||||
// Create a tab and load a remote page in it
|
||||
gBrowser.selectedTab = gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
|
||||
await waitForLoadWithFlags("about:robots");
|
||||
is(gBrowser.selectedBrowser.isRemoteBrowser, false, "Remote attribute should be correct");
|
||||
await check_history();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_favicon_change.html"
|
||||
|
||||
add_task(async function() {
|
||||
let extraTab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
let extraTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
extraTab.linkedBrowser.loadURI(TEST_URL);
|
||||
let tabLoaded = BrowserTestUtils.browserLoaded(extraTab.linkedBrowser);
|
||||
let expectedFavicon = "http://example.org/one-icon";
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_favicon_change_not_in_document.html"
|
||||
|
||||
add_task(async function() {
|
||||
let extraTab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
let extraTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
let tabLoaded = promiseTabLoaded(extraTab);
|
||||
extraTab.linkedBrowser.loadURI(TEST_URL);
|
||||
let expectedFavicon = "http://example.org/one-icon";
|
||||
|
|
|
@ -4,7 +4,7 @@ const URL = "http://mochi.test:8888/browser/browser/base/content/test/general/fe
|
|||
|
||||
add_task(async function() {
|
||||
// Open a new tab.
|
||||
gBrowser.selectedTab = gBrowser.addTab(URL);
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, URL);
|
||||
registerCleanupFunction(() => gBrowser.removeCurrentTab());
|
||||
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
|
|
|
@ -7,7 +7,7 @@ var newTab;
|
|||
|
||||
add_task(async function findbar_test() {
|
||||
waitForExplicitFinish();
|
||||
newTab = gBrowser.addTab("about:blank");
|
||||
newTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
|
||||
let promise = ContentTask.spawn(newTab.linkedBrowser, null, async function() {
|
||||
await ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", false);
|
||||
|
|
|
@ -16,7 +16,7 @@ function test() {
|
|||
|
||||
Services.prefs.setBoolPref(PREF_DISABLE_OPEN_NEW_WINDOW, true);
|
||||
|
||||
let newTab = gBrowser.addTab(gHttpTestRoot + TEST_FILE);
|
||||
let newTab = BrowserTestUtils.addTab(gBrowser, gHttpTestRoot + TEST_FILE);
|
||||
gBrowser.selectedTab = newTab;
|
||||
|
||||
whenTabLoaded(newTab, function() {
|
||||
|
|
|
@ -68,7 +68,7 @@ function test() {
|
|||
Services.prefs.setBoolPref("offline-apps.allow_by_default", true);
|
||||
|
||||
// Open a new tab.
|
||||
gBrowser.selectedTab = gBrowser.addTab(URL);
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, URL);
|
||||
registerCleanupFunction(() => gBrowser.removeCurrentTab());
|
||||
|
||||
BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
|
||||
|
|
|
@ -641,7 +641,7 @@ function test_rotateGesturesOnTab() {
|
|||
}
|
||||
|
||||
function test_rotateGestures() {
|
||||
test_imageTab = gBrowser.addTab("chrome://branding/content/about-logo.png");
|
||||
test_imageTab = BrowserTestUtils.addTab(gBrowser, "chrome://branding/content/about-logo.png");
|
||||
gBrowser.selectedTab = test_imageTab;
|
||||
|
||||
gBrowser.selectedBrowser.addEventListener("load", test_rotateGesturesOnTab, true);
|
||||
|
|
|
@ -8,7 +8,7 @@ function test() {
|
|||
waitForExplicitFinish();
|
||||
|
||||
// Add a tab that will get removed and hidden
|
||||
let testTab = gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||
let testTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
|
||||
is(gBrowser.visibleTabs.length, 2, "just added a tab, so 2 tabs");
|
||||
gBrowser.selectedTab = testTab;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ add_task(async function test_keyword_bookmarklet() {
|
|||
let bm = await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
|
||||
title: "bookmarklet",
|
||||
url: "javascript:'1';" });
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
registerCleanupFunction(async function() {
|
||||
gBrowser.removeTab(tab);
|
||||
await PlacesUtils.bookmarks.remove(bm);
|
||||
|
|
|
@ -34,7 +34,7 @@ function test() {
|
|||
|
||||
Services.ww.registerNotification(windowObserver);
|
||||
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
let listener = {
|
||||
onStateChange: function onLocationChange(webProgress, req, flags, status) {
|
||||
|
|
|
@ -19,7 +19,7 @@ var gTests = [
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
let searchObserver = function search_observer(aSubject, aTopic, aData) {
|
||||
let engine = aSubject.QueryInterface(Ci.nsISearchEngine);
|
||||
|
|
|
@ -26,7 +26,7 @@ function test() {
|
|||
|
||||
function step2() {
|
||||
isCurrent(originalTab, "selected tab has the current timestamp");
|
||||
newTab = gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||
newTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
|
||||
nextStep(step3);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ function test() {
|
|||
Services.prefs.setBoolPref("offline-apps.allow_by_default", false);
|
||||
|
||||
// Open a new tab.
|
||||
gBrowser.selectedTab = gBrowser.addTab(URL);
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, URL);
|
||||
registerCleanupFunction(() => gBrowser.removeCurrentTab());
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ function doTest() {
|
|||
var tabMinWidth = parseInt(getComputedStyle(gBrowser.selectedTab, null).minWidth);
|
||||
var tabCountForOverflow = Math.ceil(width(tabstrip) / tabMinWidth * 3);
|
||||
while (tabs.length < tabCountForOverflow)
|
||||
gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||
BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
|
||||
gBrowser.pinTab(tabs[0]);
|
||||
|
||||
tabstrip.addEventListener("overflow", runOverflowTests);
|
||||
|
|
|
@ -27,7 +27,7 @@ function PinUnpinHandler(tab, eventName) {
|
|||
}
|
||||
|
||||
function test() {
|
||||
tabs = [gBrowser.selectedTab, gBrowser.addTab(), gBrowser.addTab(), gBrowser.addTab()];
|
||||
tabs = [gBrowser.selectedTab, BrowserTestUtils.addTab(gBrowser), BrowserTestUtils.addTab(gBrowser), BrowserTestUtils.addTab(gBrowser)];
|
||||
indexTest(0, 0);
|
||||
indexTest(1, 1);
|
||||
indexTest(2, 2);
|
||||
|
|
|
@ -11,7 +11,7 @@ add_task(async function() {
|
|||
// The new tab behaviour is documented in bug 465673
|
||||
let tabs = [];
|
||||
function addTab(aURL, aReferrer) {
|
||||
let tab = gBrowser.addTab(aURL, {referrerURI: aReferrer});
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, aURL, {referrerURI: aReferrer});
|
||||
tabs.push(tab);
|
||||
return BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
function test() {
|
||||
// Add two new tabs after the original tab. Pin the first one.
|
||||
let originalTab = gBrowser.selectedTab;
|
||||
let newTab1 = gBrowser.addTab();
|
||||
gBrowser.addTab();
|
||||
let newTab1 = BrowserTestUtils.addTab(gBrowser);
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.pinTab(newTab1);
|
||||
|
||||
// Check that there is only one closable tab from originalTab to the end
|
||||
|
|
|
@ -102,7 +102,7 @@ var restart = async function(browser) {
|
|||
};
|
||||
|
||||
add_task(async function navigate() {
|
||||
let tab = gBrowser.addTab("about:robots");
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, "about:robots");
|
||||
let browser = tab.linkedBrowser;
|
||||
gBrowser.selectedTab = tab;
|
||||
await waitForDocLoadComplete();
|
||||
|
@ -141,7 +141,7 @@ add_task(async function crash() {
|
|||
if (!gMultiProcessBrowser || !("nsICrashReporter" in Ci))
|
||||
return;
|
||||
|
||||
let tab = gBrowser.addTab(DUMMY);
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, DUMMY);
|
||||
let browser = tab.linkedBrowser;
|
||||
gBrowser.selectedTab = tab;
|
||||
await waitForDocLoadComplete();
|
||||
|
|
|
@ -98,7 +98,7 @@ add_task(async function() {
|
|||
destDir.remove(true);
|
||||
});
|
||||
|
||||
let tab = gBrowser.addTab();
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedTab = tab;
|
||||
let browser = tab.linkedBrowser;
|
||||
info("Loading video tab");
|
||||
|
|
|
@ -16,7 +16,7 @@ function test() {
|
|||
|
||||
function createTabs(count) {
|
||||
for (let n = 0; n < count; n++)
|
||||
gBrowser.addTab();
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
}
|
||||
|
||||
function testKey(key, expectedTab) {
|
||||
|
|
|
@ -16,7 +16,7 @@ add_task(async function test_star_redirect() {
|
|||
gBrowser.removeCurrentTab();
|
||||
});
|
||||
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
// This will add the page to the HSTS cache.
|
||||
await promiseTabLoadEvent(tab, secureURL, secureURL);
|
||||
// This should transparently be redirected to the secure page.
|
||||
|
|
|
@ -5,7 +5,7 @@ function test() {
|
|||
|
||||
let testPath = getRootDirectory(gTestPath);
|
||||
|
||||
let tab = gBrowser.addTab(testPath + "file_bug970276_popup1.html");
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, testPath + "file_bug970276_popup1.html");
|
||||
|
||||
tab.linkedBrowser.addEventListener("load", function() {
|
||||
let expectedIcon = testPath + "file_bug970276_favicon1.ico";
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
add_task(async function() {
|
||||
let initialTabsLength = gBrowser.tabs.length;
|
||||
|
||||
let newTab1 = gBrowser.selectedTab = gBrowser.addTab("about:robots", {skipAnimation: true});
|
||||
let newTab2 = gBrowser.selectedTab = gBrowser.addTab("about:about", {skipAnimation: true});
|
||||
let newTab3 = gBrowser.selectedTab = gBrowser.addTab("about:config", {skipAnimation: true});
|
||||
let newTab1 = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:robots", {skipAnimation: true});
|
||||
let newTab2 = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:about", {skipAnimation: true});
|
||||
let newTab3 = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:config", {skipAnimation: true});
|
||||
registerCleanupFunction(function() {
|
||||
while (gBrowser.tabs.length > initialTabsLength) {
|
||||
gBrowser.removeTab(gBrowser.tabs[initialTabsLength]);
|
||||
|
|
|
@ -9,7 +9,7 @@ add_task(async function() {
|
|||
while (SessionStore.getClosedWindowCount() > 0)
|
||||
SessionStore.forgetClosedWindow(0);
|
||||
|
||||
let tab = gBrowser.addTab();
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
tab.linkedBrowser.loadURI(uri);
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
await TabStateFlusher.flush(tab.linkedBrowser);
|
||||
|
|
|
@ -106,10 +106,10 @@ add_task(async function() {
|
|||
// create a few tabs
|
||||
let tabs = [
|
||||
gBrowser.tabs[0],
|
||||
gBrowser.addTab("about:blank", {skipAnimation: true}),
|
||||
gBrowser.addTab("about:blank", {skipAnimation: true}),
|
||||
gBrowser.addTab("about:blank", {skipAnimation: true}),
|
||||
gBrowser.addTab("about:blank", {skipAnimation: true})
|
||||
BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true}),
|
||||
BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true}),
|
||||
BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true}),
|
||||
BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true})
|
||||
];
|
||||
|
||||
// Initially 0 1 2 3 4
|
||||
|
|
|
@ -127,10 +127,10 @@ function focusElementInChild(elementid, type) {
|
|||
}
|
||||
|
||||
add_task(async function() {
|
||||
tab1 = gBrowser.addTab();
|
||||
tab1 = BrowserTestUtils.addTab(gBrowser);
|
||||
browser1 = gBrowser.getBrowserForTab(tab1);
|
||||
|
||||
tab2 = gBrowser.addTab();
|
||||
tab2 = BrowserTestUtils.addTab(gBrowser);
|
||||
browser2 = gBrowser.getBrowserForTab(tab2);
|
||||
|
||||
await promiseTabLoadEvent(tab1, "data:text/html," + escape(testPage1));
|
||||
|
|
|
@ -40,7 +40,7 @@ function waitForMs(aMs) {
|
|||
add_task(async function() {
|
||||
let url = kTestPage;
|
||||
let originalTab = gBrowser.selectedTab; // test tab
|
||||
let newTab = gBrowser.addTab(url, {skipAnimation: true});
|
||||
let newTab = BrowserTestUtils.addTab(gBrowser, url, {skipAnimation: true});
|
||||
let parentSide, childSide;
|
||||
|
||||
// new tab added but not selected checks
|
||||
|
@ -100,7 +100,7 @@ add_task(async function() {
|
|||
add_task(async function() {
|
||||
let url = "about:about";
|
||||
let originalTab = gBrowser.selectedTab; // test tab
|
||||
let newTab = gBrowser.addTab(url, {skipAnimation: true});
|
||||
let newTab = BrowserTestUtils.addTab(gBrowser, url, {skipAnimation: true});
|
||||
let parentSide, childSide;
|
||||
|
||||
parentSide = getParentTabState(newTab);
|
||||
|
|
|
@ -11,9 +11,9 @@ thisTestLeaksUncaughtRejectionsAndShouldBeFixed("TypeError: gBrowser._finalizeTa
|
|||
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("TypeError: gBrowser._finalizeTabSwitch is not a function");
|
||||
|
||||
function test() {
|
||||
gBrowser.addTab();
|
||||
gBrowser.addTab();
|
||||
gBrowser.addTab();
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
var tabs = gBrowser.tabs;
|
||||
var owner;
|
||||
|
|
|
@ -15,7 +15,7 @@ function waitForNewWindow() {
|
|||
}
|
||||
|
||||
add_task(async function() {
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab(url);
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, url);
|
||||
let browser = tab.linkedBrowser;
|
||||
await promiseTabLoaded(gBrowser.selectedTab);
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ function test_openNewTabWith() {
|
|||
}
|
||||
|
||||
function test_openUILink() {
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
|
||||
is(tab.linkedBrowser.currentURI.spec, "http://example.org/", "example.org loaded");
|
||||
gBrowser.removeCurrentTab();
|
||||
|
|
|
@ -3,7 +3,7 @@ add_task(async function() {
|
|||
"div</div><div style='position: absolute; left: 0px; background: red; width: 200px; height: 200px;'>" +
|
||||
"<span id='s'>div</span></div>";
|
||||
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
await promiseTabLoadEvent(tab, "data:text/html," + escape(childContent));
|
||||
await SimpleTest.promiseFocus(gBrowser.selectedBrowser.contentWindowAsCPOW);
|
||||
|
|
|
@ -9,10 +9,10 @@ add_task(function* () {
|
|||
let [origTab] = gBrowser.visibleTabs;
|
||||
|
||||
// Add a tab that will get pinned
|
||||
let pinned = gBrowser.addTab();
|
||||
let pinned = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.pinTab(pinned);
|
||||
|
||||
let testTab = gBrowser.addTab();
|
||||
let testTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
let visible = gBrowser.visibleTabs;
|
||||
is(visible.length, 3, "3 tabs should be open");
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let tabOne = gBrowser.addTab("about:blank");
|
||||
let tabTwo = gBrowser.addTab("http://mochi.test:8888/");
|
||||
let tabOne = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
let tabTwo = BrowserTestUtils.addTab(gBrowser, "http://mochi.test:8888/");
|
||||
gBrowser.selectedTab = tabTwo;
|
||||
|
||||
let browser = gBrowser.getBrowserForTab(tabTwo);
|
||||
|
|
|
@ -11,11 +11,11 @@ function test() {
|
|||
is(Disabled(), true, "Bookmark All Tabs should be disabled");
|
||||
|
||||
// Add a tab
|
||||
let testTab1 = gBrowser.addTab();
|
||||
let testTab1 = BrowserTestUtils.addTab(gBrowser);
|
||||
is(gBrowser.visibleTabs.length, 2, "2 tabs should be open");
|
||||
is(Disabled(), true, "Bookmark All Tabs should be disabled since there are two tabs with the same address");
|
||||
|
||||
let testTab2 = gBrowser.addTab("about:mozilla");
|
||||
let testTab2 = BrowserTestUtils.addTab(gBrowser, "about:mozilla");
|
||||
is(gBrowser.visibleTabs.length, 3, "3 tabs should be open");
|
||||
// Wait for tab load, the code checks for currentURI.
|
||||
testTab2.linkedBrowser.addEventListener("load", function() {
|
||||
|
@ -28,7 +28,7 @@ function test() {
|
|||
is(Disabled(), true, "Bookmark All Tabs should be disabled as there is only one visible tab");
|
||||
|
||||
// Add a tab that will get pinned
|
||||
let pinned = gBrowser.addTab();
|
||||
let pinned = BrowserTestUtils.addTab(gBrowser);
|
||||
is(gBrowser.visibleTabs.length, 2, "2 tabs should be visible now");
|
||||
is(Disabled(), false, "Bookmark All Tabs should be available as there are two visible tabs");
|
||||
gBrowser.pinTab(pinned);
|
||||
|
|
|
@ -8,7 +8,7 @@ add_task(async function test() {
|
|||
// There should be one tab when we start the test
|
||||
let [origTab] = gBrowser.visibleTabs;
|
||||
is(gBrowser.visibleTabs.length, 1, "there is one visible tab");
|
||||
let testTab = gBrowser.addTab();
|
||||
let testTab = BrowserTestUtils.addTab(gBrowser);
|
||||
is(gBrowser.visibleTabs.length, 2, "there are now two visible tabs");
|
||||
|
||||
// Check the context menu with two tabs
|
||||
|
@ -50,7 +50,7 @@ add_task(async function test() {
|
|||
|
||||
// Add a tab that will get pinned
|
||||
// So now there's one pinned tab, one visible unpinned tab, and one hidden tab
|
||||
let pinned = gBrowser.addTab();
|
||||
let pinned = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.pinTab(pinned);
|
||||
is(gBrowser.visibleTabs.length, 2, "now there are two visible tabs");
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ add_task(function* test() {
|
|||
gPrefService.setBoolPref("browser.ctrlTab.previews", true);
|
||||
|
||||
let [origTab] = gBrowser.visibleTabs;
|
||||
let tabOne = gBrowser.addTab();
|
||||
let tabTwo = gBrowser.addTab();
|
||||
let tabOne = BrowserTestUtils.addTab(gBrowser);
|
||||
let tabTwo = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
// test the ctrlTab.tabList
|
||||
pressCtrlTab();
|
||||
|
|
|
@ -33,7 +33,7 @@ var gTests = [
|
|||
resolve();
|
||||
});
|
||||
|
||||
tab = gBrowser.addTab(HTTP_PATH + HTTP_ENDPOINT + "?generic");
|
||||
tab = BrowserTestUtils.addTab(gBrowser, HTTP_PATH + HTTP_ENDPOINT + "?generic");
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -80,7 +80,7 @@ var gTests = [
|
|||
}
|
||||
});
|
||||
|
||||
tab = gBrowser.addTab(HTTP_PATH + HTTP_ENDPOINT + "?twoway");
|
||||
tab = BrowserTestUtils.addTab(gBrowser, HTTP_PATH + HTTP_ENDPOINT + "?twoway");
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -195,7 +195,7 @@ var gTests = [
|
|||
resolve();
|
||||
});
|
||||
|
||||
tab = gBrowser.addTab(HTTP_PATH + HTTP_ENDPOINT + "?multichannel");
|
||||
tab = BrowserTestUtils.addTab(gBrowser, HTTP_PATH + HTTP_ENDPOINT + "?multichannel");
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
@ -18,7 +18,7 @@ add_task(async function reallyRunTests() {
|
|||
|
||||
// This can't use openNewForegroundTab because if we focus tab2 now, we
|
||||
// won't send a focus event during test 6, further down in this file.
|
||||
let tab2 = gBrowser.addTab(testPage);
|
||||
let tab2 = BrowserTestUtils.addTab(gBrowser, testPage);
|
||||
browser2 = tab2.linkedBrowser;
|
||||
await BrowserTestUtils.browserLoaded(browser2);
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
var gTab = null;
|
||||
|
||||
function load(url, cb) {
|
||||
gTab = gBrowser.addTab(url);
|
||||
gTab = BrowserTestUtils.addTab(gBrowser, url);
|
||||
gBrowser.addEventListener("load", function(event) {
|
||||
if (event.target.location != url)
|
||||
return;
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче