Backed out 2 changesets (bug 1362034) for failing damp | inspector/cold-open.js on a CLOSED TREE
Backed out changeset 8c8925b75aa2 (bug 1362034) Backed out changeset ff6b05c96094 (bug 1362034)
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
this.invoke = function addTab_invoke()
|
this.invoke = function addTab_invoke()
|
||||||
{
|
{
|
||||||
tabBrowser().addTrustedTab(aURL);
|
tabBrowser().addTab(aURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getID = function addTab_getID()
|
this.getID = function addTab_getID()
|
||||||
|
|||||||
@@ -247,12 +247,7 @@ var CaptivePortalWatcher = {
|
|||||||
|
|
||||||
// If the tab is gone or going, we need to open a new one.
|
// If the tab is gone or going, we need to open a new one.
|
||||||
if (!tab || tab.closing || !tab.parentNode) {
|
if (!tab || tab.closing || !tab.parentNode) {
|
||||||
tab = gBrowser.addWebTab(this.canonicalURL, {
|
tab = gBrowser.addTab(this.canonicalURL, { ownerTab: gBrowser.selectedTab });
|
||||||
ownerTab: gBrowser.selectedTab,
|
|
||||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({
|
|
||||||
userContextId: gBrowser.contentPrincipal.userContextId,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
this._captivePortalTab = Cu.getWeakReference(tab);
|
this._captivePortalTab = Cu.getWeakReference(tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -308,7 +308,7 @@
|
|||||||
accesskey="&keywordfield.accesskey;"
|
accesskey="&keywordfield.accesskey;"
|
||||||
oncommand="AddKeywordForSearchField();"/>
|
oncommand="AddKeywordForSearchField();"/>
|
||||||
<menuitem id="context-searchselect"
|
<menuitem id="context-searchselect"
|
||||||
oncommand="BrowserSearch.loadSearchFromContext(this.searchTerms, this.principal);"/>
|
oncommand="BrowserSearch.loadSearchFromContext(this.searchTerms);"/>
|
||||||
<menuseparator id="context-sep-sendlinktodevice" class="sync-ui-item"
|
<menuseparator id="context-sep-sendlinktodevice" class="sync-ui-item"
|
||||||
hidden="true"/>
|
hidden="true"/>
|
||||||
<menu id="context-sendlinktodevice"
|
<menu id="context-sendlinktodevice"
|
||||||
|
|||||||
@@ -538,8 +538,7 @@ const gStoragePressureObserver = {
|
|||||||
accessKey: prefStrBundle.getString("spaceAlert.learnMoreButton.accesskey"),
|
accessKey: prefStrBundle.getString("spaceAlert.learnMoreButton.accesskey"),
|
||||||
callback(notificationBar, button) {
|
callback(notificationBar, button) {
|
||||||
let learnMoreURL = Services.urlFormatter.formatURLPref("app.support.baseURL") + "storage-permissions";
|
let learnMoreURL = Services.urlFormatter.formatURLPref("app.support.baseURL") + "storage-permissions";
|
||||||
// This is a content URL, loaded from trusted UX.
|
gBrowser.selectedTab = gBrowser.addTab(learnMoreURL);
|
||||||
gBrowser.selectedTab = gBrowser.addTrustedTab(learnMoreURL);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (usage < USAGE_THRESHOLD_BYTES) {
|
if (usage < USAGE_THRESHOLD_BYTES) {
|
||||||
@@ -3972,11 +3971,8 @@ const BrowserSearch = {
|
|||||||
* @return engine The search engine used to perform a search, or null if no
|
* @return engine The search engine used to perform a search, or null if no
|
||||||
* search was performed.
|
* search was performed.
|
||||||
*/
|
*/
|
||||||
_loadSearch(searchText, useNewTab, purpose, triggeringPrincipal) {
|
_loadSearch(searchText, useNewTab, purpose) {
|
||||||
let engine;
|
let engine;
|
||||||
if (!triggeringPrincipal) {
|
|
||||||
throw new Error("Required argument triggeringPrincipal missing within _loadSearch");
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the search bar is visible, use the current engine, otherwise, fall
|
// If the search bar is visible, use the current engine, otherwise, fall
|
||||||
// back to the default engine.
|
// back to the default engine.
|
||||||
@@ -4000,20 +3996,33 @@ const BrowserSearch = {
|
|||||||
useNewTab ? "tab" : "current",
|
useNewTab ? "tab" : "current",
|
||||||
{ postData: submission.postData,
|
{ postData: submission.postData,
|
||||||
inBackground,
|
inBackground,
|
||||||
relatedToCurrent: true,
|
relatedToCurrent: true });
|
||||||
triggeringPrincipal });
|
|
||||||
|
|
||||||
return engine;
|
return engine;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Just like _loadSearch, but preserving an old API.
|
||||||
|
*
|
||||||
|
* @return string Name of the search engine used to perform a search or null
|
||||||
|
* if a search was not performed.
|
||||||
|
*/
|
||||||
|
loadSearch: function BrowserSearch_search(searchText, useNewTab, purpose) {
|
||||||
|
let engine = BrowserSearch._loadSearch(searchText, useNewTab, purpose);
|
||||||
|
if (!engine) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return engine.name;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a search initiated from the context menu.
|
* Perform a search initiated from the context menu.
|
||||||
*
|
*
|
||||||
* This should only be called from the context menu. See
|
* This should only be called from the context menu. See
|
||||||
* BrowserSearch.loadSearch for the preferred API.
|
* BrowserSearch.loadSearch for the preferred API.
|
||||||
*/
|
*/
|
||||||
loadSearchFromContext(terms, triggeringPrincipal) {
|
loadSearchFromContext(terms) {
|
||||||
let engine = BrowserSearch._loadSearch(terms, true, "contextmenu", triggeringPrincipal);
|
let engine = BrowserSearch._loadSearch(terms, true, "contextmenu");
|
||||||
if (engine) {
|
if (engine) {
|
||||||
BrowserSearch.recordSearchInTelemetry(engine, "contextmenu");
|
BrowserSearch.recordSearchInTelemetry(engine, "contextmenu");
|
||||||
}
|
}
|
||||||
@@ -7380,8 +7389,7 @@ const gAccessibilityServiceIndicator = {
|
|||||||
type === "click") {
|
type === "click") {
|
||||||
let a11yServicesSupportURL =
|
let a11yServicesSupportURL =
|
||||||
Services.urlFormatter.formatURLPref("accessibility.support.url");
|
Services.urlFormatter.formatURLPref("accessibility.support.url");
|
||||||
// This is a known URL coming from trusted UI
|
gBrowser.selectedTab = gBrowser.addTab(a11yServicesSupportURL);
|
||||||
gBrowser.selectedTab = gBrowser.addTrustedTab(a11yServicesSupportURL);
|
|
||||||
Services.telemetry.scalarSet("a11y.indicator_acted_on", true);
|
Services.telemetry.scalarSet("a11y.indicator_acted_on", true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1502,7 +1502,6 @@ nsContextMenu.prototype = {
|
|||||||
|
|
||||||
// Store searchTerms in context menu item so we know what to search onclick
|
// Store searchTerms in context menu item so we know what to search onclick
|
||||||
menuItem.searchTerms = selectedText;
|
menuItem.searchTerms = selectedText;
|
||||||
menuItem.principal = this.principal;
|
|
||||||
|
|
||||||
// Copied to alert.js' prefillAlertInfo().
|
// Copied to alert.js' prefillAlertInfo().
|
||||||
// If the JS character after our truncation point is a trail surrogate,
|
// If the JS character after our truncation point is a trail surrogate,
|
||||||
|
|||||||
@@ -1373,11 +1373,6 @@ window._gBrowser = {
|
|||||||
aName = params.name;
|
aName = params.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// all callers of loadOneTab need to pass a valid triggeringPrincipal.
|
|
||||||
if (!aTriggeringPrincipal) {
|
|
||||||
throw new Error("Required argument triggeringPrincipal missing within loadOneTab");
|
|
||||||
}
|
|
||||||
|
|
||||||
var bgLoad = (aLoadInBackground != null) ? aLoadInBackground :
|
var bgLoad = (aLoadInBackground != null) ? aLoadInBackground :
|
||||||
Services.prefs.getBoolPref("browser.tabs.loadInBackground");
|
Services.prefs.getBoolPref("browser.tabs.loadInBackground");
|
||||||
var owner = bgLoad ? null : this.selectedTab;
|
var owner = bgLoad ? null : this.selectedTab;
|
||||||
@@ -2139,30 +2134,6 @@ window._gBrowser = {
|
|||||||
tab.dispatchEvent(evt);
|
tab.dispatchEvent(evt);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads a tab with a default null principal unless specified
|
|
||||||
*/
|
|
||||||
addWebTab(aURI, params = {}) {
|
|
||||||
if (!params.triggeringPrincipal) {
|
|
||||||
params.triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({
|
|
||||||
userContextId: params.userContextId,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (Services.scriptSecurityManager.isSystemPrincipal(params.triggeringPrincipal)) {
|
|
||||||
throw new Error("System principal should never be passed into addWebTab()");
|
|
||||||
}
|
|
||||||
return this.addTab(aURI, params);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Must only be used sparingly for content that came from Chrome context
|
|
||||||
* If in doubt use addWebTab
|
|
||||||
*/
|
|
||||||
addTrustedTab(aURI, params = {}) {
|
|
||||||
params.triggeringPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
|
||||||
return this.addTab(aURI, params);
|
|
||||||
},
|
|
||||||
|
|
||||||
// eslint-disable-next-line complexity
|
// eslint-disable-next-line complexity
|
||||||
addTab(aURI, {
|
addTab(aURI, {
|
||||||
allowMixedContent,
|
allowMixedContent,
|
||||||
@@ -2198,13 +2169,6 @@ window._gBrowser = {
|
|||||||
recordExecution,
|
recordExecution,
|
||||||
replayExecution,
|
replayExecution,
|
||||||
} = {}) {
|
} = {}) {
|
||||||
// all callers of addTab that pass a params object need to pass
|
|
||||||
// a valid triggeringPrincipal.
|
|
||||||
if (!triggeringPrincipal) {
|
|
||||||
throw new Error("Required argument triggeringPrincipal missing within addTab");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// if we're adding tabs, we're past interrupt mode, ditch the owner
|
// if we're adding tabs, we're past interrupt mode, ditch the owner
|
||||||
if (this.selectedTab.owner) {
|
if (this.selectedTab.owner) {
|
||||||
this.selectedTab.owner = null;
|
this.selectedTab.owner = null;
|
||||||
@@ -2860,9 +2824,7 @@ window._gBrowser = {
|
|||||||
aTab._mouseleave();
|
aTab._mouseleave();
|
||||||
|
|
||||||
if (newTab)
|
if (newTab)
|
||||||
this.addTrustedTab(BROWSER_NEW_TAB_URL, {
|
this.addTab(BROWSER_NEW_TAB_URL, { skipAnimation: true });
|
||||||
skipAnimation: true,
|
|
||||||
});
|
|
||||||
else
|
else
|
||||||
TabBarVisibility.update();
|
TabBarVisibility.update();
|
||||||
|
|
||||||
@@ -3637,7 +3599,7 @@ window._gBrowser = {
|
|||||||
// new tab must have the same usercontextid as the old one
|
// new tab must have the same usercontextid as the old one
|
||||||
params.userContextId = aTab.getAttribute("usercontextid");
|
params.userContextId = aTab.getAttribute("usercontextid");
|
||||||
}
|
}
|
||||||
let newTab = this.addWebTab("about:blank", params);
|
let newTab = this.addTab("about:blank", params);
|
||||||
let newBrowser = this.getBrowserForTab(newTab);
|
let newBrowser = this.getBrowserForTab(newTab);
|
||||||
|
|
||||||
// Stop the about:blank load.
|
// Stop the about:blank load.
|
||||||
@@ -5314,22 +5276,10 @@ var TabContextMenu = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
reopenInContainer(event) {
|
reopenInContainer(event) {
|
||||||
let userContextId = parseInt(event.target.getAttribute("data-usercontextid"));
|
|
||||||
/* Create a triggering principal that is able to load the new tab
|
|
||||||
For codebase principals that are about: chrome: or resource: we need system to load them.
|
|
||||||
Anything other than system principal needs to have the new userContextId.
|
|
||||||
*/
|
|
||||||
let triggeringPrincipal = this.contextTab.linkedBrowser.contentPrincipal;
|
|
||||||
if (triggeringPrincipal.isNullPrincipal) {
|
|
||||||
triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({ userContextId });
|
|
||||||
} else if (triggeringPrincipal.isCodebasePrincipal) {
|
|
||||||
triggeringPrincipal = Services.scriptSecurityManager.createCodebasePrincipal(triggeringPrincipal.URI, { userContextId });
|
|
||||||
}
|
|
||||||
let newTab = gBrowser.addTab(this.contextTab.linkedBrowser.currentURI.spec, {
|
let newTab = gBrowser.addTab(this.contextTab.linkedBrowser.currentURI.spec, {
|
||||||
userContextId,
|
userContextId: parseInt(event.target.getAttribute("data-usercontextid")),
|
||||||
pinned: this.contextTab.pinned,
|
pinned: this.contextTab.pinned,
|
||||||
index: this.contextTab._tPos + 1,
|
index: this.contextTab._tPos + 1,
|
||||||
triggeringPrincipal,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (gBrowser.selectedTab == this.contextTab) {
|
if (gBrowser.selectedTab == this.contextTab) {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ add_task(async function closeWindowWithMultipleTabsIncludingOneBeforeUnload() {
|
|||||||
let newWin = await promiseOpenAndLoadWindow({}, true);
|
let newWin = await promiseOpenAndLoadWindow({}, true);
|
||||||
let firstTab = newWin.gBrowser.selectedTab;
|
let firstTab = newWin.gBrowser.selectedTab;
|
||||||
await promiseTabLoadEvent(firstTab, TEST_PAGE);
|
await promiseTabLoadEvent(firstTab, TEST_PAGE);
|
||||||
await promiseTabLoadEvent(BrowserTestUtils.addTab(newWin.gBrowser), "http://example.com/");
|
await promiseTabLoadEvent(newWin.gBrowser.addTab(), "http://example.com/");
|
||||||
let windowClosedPromise = BrowserTestUtils.domWindowClosed(newWin);
|
let windowClosedPromise = BrowserTestUtils.domWindowClosed(newWin);
|
||||||
expectingDialog = true;
|
expectingDialog = true;
|
||||||
newWin.BrowserTryToCloseWindow();
|
newWin.BrowserTryToCloseWindow();
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ add_task(async function() {
|
|||||||
let tab = win.gBrowser.tabContainer.firstChild;
|
let tab = win.gBrowser.tabContainer.firstChild;
|
||||||
await promiseTabLoadEvent(tab, getRootDirectory(gTestPath) + "test_bug462673.html");
|
await promiseTabLoadEvent(tab, getRootDirectory(gTestPath) + "test_bug462673.html");
|
||||||
|
|
||||||
var newTab = BrowserTestUtils.addTab(win.gBrowser);
|
var newTab = win.gBrowser.addTab();
|
||||||
var newBrowser = newTab.linkedBrowser;
|
var newBrowser = newTab.linkedBrowser;
|
||||||
win.gBrowser.removeTab(tab);
|
win.gBrowser.removeTab(tab);
|
||||||
ok(!win.closed, "Window stays open");
|
ok(!win.closed, "Window stays open");
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
add_task(async function test() {
|
add_task(async function test() {
|
||||||
let win = await BrowserTestUtils.openNewBrowserWindow({private: true});
|
let win = await BrowserTestUtils.openNewBrowserWindow({private: true});
|
||||||
|
|
||||||
let tab = win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser, "about:addons");
|
let tab = win.gBrowser.selectedTab = win.gBrowser.addTab("about:addons");
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
await promiseWaitForFocus(win);
|
await promiseWaitForFocus(win);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ add_task(async function() {
|
|||||||
ok(true, "tests succeeded");
|
ok(true, "tests succeeded");
|
||||||
|
|
||||||
// Create a second tab so that we can move the original one out.
|
// Create a second tab so that we can move the original one out.
|
||||||
BrowserTestUtils.addTab(win.gBrowser, "about:blank", {skipAnimation: true});
|
win.gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||||
|
|
||||||
// Tear off the original tab.
|
// Tear off the original tab.
|
||||||
let browser = win.gBrowser.selectedBrowser;
|
let browser = win.gBrowser.selectedBrowser;
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ add_task(async function testExceptionAddition() {
|
|||||||
testTrackingPageUnblocked();
|
testTrackingPageUnblocked();
|
||||||
|
|
||||||
info("Test that the exception is remembered across tabs in the same private window");
|
info("Test that the exception is remembered across tabs in the same private window");
|
||||||
tab = browser.selectedTab = BrowserTestUtils.addTab(browser);
|
tab = browser.selectedTab = browser.addTab();
|
||||||
|
|
||||||
info("Load a test page containing tracking elements");
|
info("Load a test page containing tracking elements");
|
||||||
await promiseTabLoadEvent(tab, TRACKING_PAGE);
|
await promiseTabLoadEvent(tab, TRACKING_PAGE);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ function test_getBoolPref() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_openNewTabWith() {
|
function test_openNewTabWith() {
|
||||||
openNewTabWith("http://example.com/", null, {triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})});
|
openNewTabWith("http://example.com/");
|
||||||
let tab = gBrowser.selectedTab = gBrowser.tabs[1];
|
let tab = gBrowser.selectedTab = gBrowser.tabs[1];
|
||||||
BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
|
BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
|
||||||
is(tab.linkedBrowser.currentURI.spec, "http://example.com/", "example.com loaded");
|
is(tab.linkedBrowser.currentURI.spec, "http://example.com/", "example.com loaded");
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ add_task(async function multiple_tabs() {
|
|||||||
|
|
||||||
// Add a background tab to cause another page to load *without* putting the
|
// Add a background tab to cause another page to load *without* putting the
|
||||||
// desired URL in a background tab, which results in its timers being throttled.
|
// desired URL in a background tab, which results in its timers being throttled.
|
||||||
BrowserTestUtils.addTab(gBrowser);
|
gBrowser.addTab();
|
||||||
|
|
||||||
// Wait until places has stored the page info
|
// Wait until places has stored the page info
|
||||||
const pageInfo = await waitForPageInfo(TEST_PATH);
|
const pageInfo = await waitForPageInfo(TEST_PATH);
|
||||||
|
|||||||
@@ -303,10 +303,7 @@ async function createTabs(howMany) {
|
|||||||
uris.push("about:blank");
|
uris.push("about:blank");
|
||||||
}
|
}
|
||||||
|
|
||||||
gBrowser.loadTabs(uris, {
|
gBrowser.loadTabs(uris, { inBackground: true });
|
||||||
inBackground: true,
|
|
||||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
|
||||||
});
|
|
||||||
|
|
||||||
await BrowserTestUtils.waitForCondition(() => {
|
await BrowserTestUtils.waitForCondition(() => {
|
||||||
return Array.from(gBrowser.tabs).every(tab => tab._fullyOpen);
|
return Array.from(gBrowser.tabs).every(tab => tab._fullyOpen);
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ function referrerTestCaseLoaded(aTestNumber, aParams) {
|
|||||||
"&cross=" + escape(test.cross || "");
|
"&cross=" + escape(test.cross || "");
|
||||||
let browser = gTestWindow.gBrowser;
|
let browser = gTestWindow.gBrowser;
|
||||||
return BrowserTestUtils.openNewForegroundTab(browser, () => {
|
return BrowserTestUtils.openNewForegroundTab(browser, () => {
|
||||||
browser.selectedTab = BrowserTestUtils.addTab(browser, url, aParams);
|
browser.selectedTab = browser.addTab(url, aParams);
|
||||||
}, false, true);
|
}, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,10 +154,7 @@ async function doTest(aInsertRelatedAfterCurrent, aInsertAfterCurrent) {
|
|||||||
// loadTabs will insertAfterCurrent
|
// loadTabs will insertAfterCurrent
|
||||||
let nextTab = aInsertAfterCurrent ? gBrowser.selectedTab._tPos + 1 : gBrowser.tabs.length;
|
let nextTab = aInsertAfterCurrent ? gBrowser.selectedTab._tPos + 1 : gBrowser.tabs.length;
|
||||||
|
|
||||||
gBrowser.loadTabs(bulkLoad, {
|
gBrowser.loadTabs(bulkLoad, { inBackground: true });
|
||||||
inBackground: true,
|
|
||||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
|
||||||
});
|
|
||||||
await loadPromises;
|
await loadPromises;
|
||||||
for (let i = nextTab, j = 0; j < bulkLoad.length; i++, j++) {
|
for (let i = nextTab, j = 0; j < bulkLoad.length; i++, j++) {
|
||||||
is(gBrowser.tabs[i].linkedBrowser.currentURI.spec, bulkLoad[j], `bulkLoad tab pos ${i} matched`);
|
is(gBrowser.tabs[i].linkedBrowser.currentURI.spec, bulkLoad[j], `bulkLoad tab pos ${i} matched`);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function test() {
|
|||||||
|
|
||||||
testState(false);
|
testState(false);
|
||||||
|
|
||||||
let pinnedTab = BrowserTestUtils.addTab(gBrowser);
|
let pinnedTab = gBrowser.addTab();
|
||||||
gBrowser.pinTab(pinnedTab);
|
gBrowser.pinTab(pinnedTab);
|
||||||
|
|
||||||
// Just pinning the tab shouldn't change the key state.
|
// Just pinning the tab shouldn't change the key state.
|
||||||
@@ -45,7 +45,7 @@ function test() {
|
|||||||
testState(true);
|
testState(true);
|
||||||
|
|
||||||
// Test that accel+w in a pinned tab selects the next tab.
|
// Test that accel+w in a pinned tab selects the next tab.
|
||||||
let pinnedTab2 = BrowserTestUtils.addTab(gBrowser);
|
let pinnedTab2 = gBrowser.addTab();
|
||||||
gBrowser.pinTab(pinnedTab2);
|
gBrowser.pinTab(pinnedTab2);
|
||||||
gBrowser.selectedTab = pinnedTab;
|
gBrowser.selectedTab = pinnedTab;
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,8 @@
|
|||||||
|
|
||||||
var tabs = [];
|
var tabs = [];
|
||||||
|
|
||||||
function addTab(aURL, done) {
|
function addTab(aURL) {
|
||||||
tabs.push(BrowserTestUtils.addTab(gBrowser, aURL, {
|
tabs.push(gBrowser.addTab(aURL, {skipAnimation: true}));
|
||||||
skipAnimation: true,
|
|
||||||
}, done));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchTab(index) {
|
function switchTab(index) {
|
||||||
@@ -22,13 +20,10 @@ function testAttrib(tabIndex, attrib, expected) {
|
|||||||
add_task(async function setup() {
|
add_task(async function setup() {
|
||||||
is(gBrowser.tabs.length, 1, "one tab is open initially");
|
is(gBrowser.tabs.length, 1, "one tab is open initially");
|
||||||
|
|
||||||
await new Promise(r => addTab("http://mochi.test:8888/#0", r));
|
addTab("http://mochi.test:8888/#0");
|
||||||
await new Promise(r => addTab("http://mochi.test:8888/#1", r));
|
addTab("http://mochi.test:8888/#1");
|
||||||
await new Promise(r => addTab("http://mochi.test:8888/#2", r));
|
addTab("http://mochi.test:8888/#2");
|
||||||
await new Promise(r => addTab("http://mochi.test:8888/#3", r));
|
addTab("http://mochi.test:8888/#3");
|
||||||
|
|
||||||
is(gBrowser.tabs.length, 5, "five tabs are open after setup");
|
|
||||||
EventUtils.synthesizeMouse(tabs[1], 1, 1, {type: "mouseover"});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add several new tabs in sequence, hiding some, to ensure that the
|
// Add several new tabs in sequence, hiding some, to ensure that the
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ add_task(async function testShieldAnimation() {
|
|||||||
await UrlClassifierTestUtils.addTestTrackers();
|
await UrlClassifierTestUtils.addTestTrackers();
|
||||||
Services.prefs.setBoolPref(TP_PREF, true);
|
Services.prefs.setBoolPref(TP_PREF, true);
|
||||||
|
|
||||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||||
|
|
||||||
let animationIcon = document.getElementById("tracking-protection-icon-animatable-image");
|
let animationIcon = document.getElementById("tracking-protection-icon-animatable-image");
|
||||||
let noAnimationIcon = document.getElementById("tracking-protection-icon");
|
let noAnimationIcon = document.getElementById("tracking-protection-icon");
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ add_task(async function testNormalBrowsing() {
|
|||||||
await UrlClassifierTestUtils.addTestTrackers();
|
await UrlClassifierTestUtils.addTestTrackers();
|
||||||
|
|
||||||
tabbrowser = gBrowser;
|
tabbrowser = gBrowser;
|
||||||
let tab = tabbrowser.selectedTab = BrowserTestUtils.addTab(tabbrowser);
|
let tab = tabbrowser.selectedTab = tabbrowser.addTab();
|
||||||
|
|
||||||
TrackingProtection = gBrowser.ownerGlobal.TrackingProtection;
|
TrackingProtection = gBrowser.ownerGlobal.TrackingProtection;
|
||||||
ok(TrackingProtection, "TP is attached to the browser window");
|
ok(TrackingProtection, "TP is attached to the browser window");
|
||||||
@@ -252,7 +252,7 @@ add_task(async function testNormalBrowsing() {
|
|||||||
add_task(async function testPrivateBrowsing() {
|
add_task(async function testPrivateBrowsing() {
|
||||||
let privateWin = await BrowserTestUtils.openNewBrowserWindow({private: true});
|
let privateWin = await BrowserTestUtils.openNewBrowserWindow({private: true});
|
||||||
tabbrowser = privateWin.gBrowser;
|
tabbrowser = privateWin.gBrowser;
|
||||||
let tab = tabbrowser.selectedTab = BrowserTestUtils.addTab(tabbrowser);
|
let tab = tabbrowser.selectedTab = tabbrowser.addTab();
|
||||||
|
|
||||||
TrackingProtection = tabbrowser.ownerGlobal.TrackingProtection;
|
TrackingProtection = tabbrowser.ownerGlobal.TrackingProtection;
|
||||||
ok(TrackingProtection, "TP is attached to the private window");
|
ok(TrackingProtection, "TP is attached to the private window");
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ var tests = [
|
|||||||
function loadTabInWindow(win, callback) {
|
function loadTabInWindow(win, callback) {
|
||||||
info("Loading tab");
|
info("Loading tab");
|
||||||
let url = "http://user:pass@example.com/";
|
let url = "http://user:pass@example.com/";
|
||||||
let tab = win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser, url);
|
let tab = win.gBrowser.selectedTab = win.gBrowser.addTab(url);
|
||||||
BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, url).then(() => {
|
BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, url).then(() => {
|
||||||
info("Tab loaded");
|
info("Tab loaded");
|
||||||
is(win.gURLBar.textValue, "example.com", "URL bar had user/pass stripped initially");
|
is(win.gURLBar.textValue, "example.com", "URL bar had user/pass stripped initially");
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ function get_test_function_for_localhost_with_hostname(hostName, isPrivate) {
|
|||||||
browser.removeTab(tab);
|
browser.removeTab(tab);
|
||||||
|
|
||||||
// Now try again with the pref set.
|
// Now try again with the pref set.
|
||||||
tab = browser.selectedTab = BrowserTestUtils.addTab(browser, "about:blank");
|
tab = browser.selectedTab = browser.addTab("about:blank");
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
// In a private window, the notification should appear again.
|
// In a private window, the notification should appear again.
|
||||||
await runURLBarSearchTest({
|
await runURLBarSearchTest({
|
||||||
|
|||||||
@@ -212,9 +212,6 @@ function openWebLinkIn(url, where, params) {
|
|||||||
if (!params.triggeringPrincipal) {
|
if (!params.triggeringPrincipal) {
|
||||||
params.triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({});
|
params.triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({});
|
||||||
}
|
}
|
||||||
if (Services.scriptSecurityManager.isSystemPrincipal(params.triggeringPrincipal)) {
|
|
||||||
throw new Error("System principal should never be passed into openWebLinkIn()");
|
|
||||||
}
|
|
||||||
|
|
||||||
openUILinkIn(url, where, params);
|
openUILinkIn(url, where, params);
|
||||||
}
|
}
|
||||||
@@ -259,8 +256,7 @@ function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI
|
|||||||
|
|
||||||
if (arguments.length == 3 && typeof arguments[2] == "object") {
|
if (arguments.length == 3 && typeof arguments[2] == "object") {
|
||||||
params = aAllowThirdPartyFixup;
|
params = aAllowThirdPartyFixup;
|
||||||
}
|
} else {
|
||||||
if (!params || !params.triggeringPrincipal) {
|
|
||||||
throw new Error("Required argument triggeringPrincipal missing within openUILinkIn");
|
throw new Error("Required argument triggeringPrincipal missing within openUILinkIn");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,11 +54,7 @@ global.tabGetSender = getSender;
|
|||||||
extensions.on("uninstalling", (msg, extension) => {
|
extensions.on("uninstalling", (msg, extension) => {
|
||||||
if (extension.uninstallURL) {
|
if (extension.uninstallURL) {
|
||||||
let browser = windowTracker.topWindow.gBrowser;
|
let browser = windowTracker.topWindow.gBrowser;
|
||||||
browser.addTab(extension.uninstallURL, {
|
browser.addTab(extension.uninstallURL, {relatedToCurrent: true});
|
||||||
disallowInheritPrincipal: true,
|
|
||||||
relatedToCurrent: true,
|
|
||||||
triggeringPrincipal: extension.principal,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -527,8 +527,18 @@ this.tabs = class extends ExtensionAPI {
|
|||||||
}
|
}
|
||||||
}).then(window => {
|
}).then(window => {
|
||||||
let url;
|
let url;
|
||||||
let principal = context.principal;
|
|
||||||
|
|
||||||
|
if (createProperties.url !== null) {
|
||||||
|
url = context.uri.resolve(createProperties.url);
|
||||||
|
|
||||||
|
if (!context.checkLoadURL(url, {dontReportErrors: true})) {
|
||||||
|
return Promise.reject({message: `Illegal URL: ${url}`});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (createProperties.openInReaderMode) {
|
||||||
|
url = `about:reader?url=${encodeURIComponent(url)}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (createProperties.cookieStoreId && !extension.hasPermission("cookies")) {
|
if (createProperties.cookieStoreId && !extension.hasPermission("cookies")) {
|
||||||
return Promise.reject({message: `No permission for cookieStoreId: ${createProperties.cookieStoreId}`});
|
return Promise.reject({message: `No permission for cookieStoreId: ${createProperties.cookieStoreId}`});
|
||||||
@@ -559,19 +569,6 @@ this.tabs = class extends ExtensionAPI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (createProperties.url !== null) {
|
|
||||||
url = context.uri.resolve(createProperties.url);
|
|
||||||
|
|
||||||
if (!context.checkLoadURL(url, {dontReportErrors: true})) {
|
|
||||||
return Promise.reject({message: `Illegal URL: ${url}`});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (createProperties.openInReaderMode) {
|
|
||||||
url = `about:reader?url=${encodeURIComponent(url)}`;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
url = window.BROWSER_NEW_TAB_URL;
|
|
||||||
}
|
|
||||||
// Only set disallowInheritPrincipal on non-discardable urls as it
|
// Only set disallowInheritPrincipal on non-discardable urls as it
|
||||||
// will override creating a lazy browser. Setting triggeringPrincipal
|
// will override creating a lazy browser. Setting triggeringPrincipal
|
||||||
// will ensure other cases are handled, but setting it may prevent
|
// will ensure other cases are handled, but setting it may prevent
|
||||||
@@ -581,11 +578,8 @@ this.tabs = class extends ExtensionAPI {
|
|||||||
// Make sure things like about:blank and data: URIs never inherit,
|
// Make sure things like about:blank and data: URIs never inherit,
|
||||||
// and instead always get a NullPrincipal.
|
// and instead always get a NullPrincipal.
|
||||||
options.disallowInheritPrincipal = true;
|
options.disallowInheritPrincipal = true;
|
||||||
// Falling back to codebase here as about: requires it, however is safe.
|
} else {
|
||||||
principal = Services.scriptSecurityManager.createCodebasePrincipal(Services.io.newURI(url), {
|
options.triggeringPrincipal = context.principal;
|
||||||
userContextId: options.userContextId,
|
|
||||||
privateBrowsingId: PrivateBrowsingUtils.isBrowserPrivate(window.gBrowser) ? 1 : 0,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tabListener.initTabReady();
|
tabListener.initTabReady();
|
||||||
@@ -624,14 +618,13 @@ this.tabs = class extends ExtensionAPI {
|
|||||||
return Promise.reject({message: `Title may only be set for discarded tabs.`});
|
return Promise.reject({message: `Title may only be set for discarded tabs.`});
|
||||||
}
|
}
|
||||||
|
|
||||||
options.triggeringPrincipal = principal;
|
let nativeTab = window.gBrowser.addTab(url || window.BROWSER_NEW_TAB_URL, options);
|
||||||
let nativeTab = window.gBrowser.addTab(url, options);
|
|
||||||
if (createProperties.discarded) {
|
if (createProperties.discarded) {
|
||||||
SessionStore.setTabState(nativeTab, {
|
SessionStore.setTabState(nativeTab, {
|
||||||
entries: [{
|
entries: [{
|
||||||
url: url,
|
url: url,
|
||||||
title: options.title,
|
title: options.title,
|
||||||
triggeringPrincipal_base64: Utils.serializePrincipal(principal),
|
triggeringPrincipal_base64: Utils.serializePrincipal(context.principal),
|
||||||
}],
|
}],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,7 +166,6 @@ skip-if = !e10s || debug || asan
|
|||||||
[browser_ext_tabs_captureVisibleTab.js]
|
[browser_ext_tabs_captureVisibleTab.js]
|
||||||
[browser_ext_tabs_create.js]
|
[browser_ext_tabs_create.js]
|
||||||
skip-if = os == "linux" && debug && bits == 32 # Bug 1350189
|
skip-if = os == "linux" && debug && bits == 32 # Bug 1350189
|
||||||
[browser_ext_tabs_create_url.js]
|
|
||||||
[browser_ext_tabs_create_invalid_url.js]
|
[browser_ext_tabs_create_invalid_url.js]
|
||||||
[browser_ext_tabs_detectLanguage.js]
|
[browser_ext_tabs_detectLanguage.js]
|
||||||
[browser_ext_tabs_discard.js]
|
[browser_ext_tabs_discard.js]
|
||||||
|
|||||||
@@ -175,6 +175,57 @@ add_task(async function test_create_options() {
|
|||||||
BrowserTestUtils.removeTab(tab);
|
BrowserTestUtils.removeTab(tab);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
add_task(async function test_urlbar_focus() {
|
||||||
|
const extension = ExtensionTestUtils.loadExtension({
|
||||||
|
background() {
|
||||||
|
browser.tabs.onUpdated.addListener(function onUpdated(_, info) {
|
||||||
|
if (info.status === "complete") {
|
||||||
|
browser.test.sendMessage("complete");
|
||||||
|
browser.tabs.onUpdated.removeListener(onUpdated);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
browser.test.onMessage.addListener(async (cmd, ...args) => {
|
||||||
|
const result = await browser.tabs[cmd](...args);
|
||||||
|
browser.test.sendMessage("result", result);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
await extension.startup();
|
||||||
|
|
||||||
|
// Test content is focused after opening a regular url
|
||||||
|
extension.sendMessage("create", {url: "https://example.com"});
|
||||||
|
const [tab1] = await Promise.all([
|
||||||
|
extension.awaitMessage("result"),
|
||||||
|
extension.awaitMessage("complete"),
|
||||||
|
]);
|
||||||
|
|
||||||
|
is(document.activeElement.tagName, "browser", "Content focused after opening a web page");
|
||||||
|
|
||||||
|
extension.sendMessage("remove", tab1.id);
|
||||||
|
await extension.awaitMessage("result");
|
||||||
|
|
||||||
|
// Test urlbar is focused after opening an empty tab
|
||||||
|
extension.sendMessage("create", {});
|
||||||
|
const tab2 = await extension.awaitMessage("result");
|
||||||
|
|
||||||
|
const active = document.activeElement;
|
||||||
|
info(`Active element: ${active.tagName}, id: ${active.id}, class: ${active.className}`);
|
||||||
|
|
||||||
|
const parent = active.parentNode;
|
||||||
|
info(`Parent element: ${parent.tagName}, id: ${parent.id}, class: ${parent.className}`);
|
||||||
|
|
||||||
|
info(`After opening an empty tab, gURLBar.focused: ${gURLBar.focused}`);
|
||||||
|
|
||||||
|
is(active.tagName, "html:input", "Input element focused");
|
||||||
|
ok(active.classList.contains("urlbar-input"), "Urlbar focused");
|
||||||
|
|
||||||
|
extension.sendMessage("remove", tab2.id);
|
||||||
|
await extension.awaitMessage("result");
|
||||||
|
|
||||||
|
await extension.unload();
|
||||||
|
});
|
||||||
|
|
||||||
add_task(async function test_create_with_popup() {
|
add_task(async function test_create_with_popup() {
|
||||||
const extension = ExtensionTestUtils.loadExtension({
|
const extension = ExtensionTestUtils.loadExtension({
|
||||||
async background() {
|
async background() {
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
|
||||||
/* vim: set sts=2 sw=2 et tw=80: */
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
add_task(async function test_urlbar_focus() {
|
|
||||||
const extension = ExtensionTestUtils.loadExtension({
|
|
||||||
background() {
|
|
||||||
browser.tabs.onUpdated.addListener(function onUpdated(_, info) {
|
|
||||||
if (info.status === "complete") {
|
|
||||||
browser.test.sendMessage("complete");
|
|
||||||
browser.tabs.onUpdated.removeListener(onUpdated);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
browser.test.onMessage.addListener(async (cmd, ...args) => {
|
|
||||||
const result = await browser.tabs[cmd](...args);
|
|
||||||
browser.test.sendMessage("result", result);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
await extension.startup();
|
|
||||||
|
|
||||||
// Test content is focused after opening a regular url
|
|
||||||
extension.sendMessage("create", {url: "https://example.com"});
|
|
||||||
const [tab1] = await Promise.all([
|
|
||||||
extension.awaitMessage("result"),
|
|
||||||
extension.awaitMessage("complete"),
|
|
||||||
]);
|
|
||||||
|
|
||||||
is(document.activeElement.tagName, "browser", "Content focused after opening a web page");
|
|
||||||
|
|
||||||
extension.sendMessage("remove", tab1.id);
|
|
||||||
await extension.awaitMessage("result");
|
|
||||||
|
|
||||||
// Test urlbar is focused after opening an empty tab
|
|
||||||
extension.sendMessage("create", {});
|
|
||||||
const tab2 = await extension.awaitMessage("result");
|
|
||||||
|
|
||||||
const active = document.activeElement;
|
|
||||||
info(`Active element: ${active.tagName}, id: ${active.id}, class: ${active.className}`);
|
|
||||||
|
|
||||||
const parent = active.parentNode;
|
|
||||||
info(`Parent element: ${parent.tagName}, id: ${parent.id}, class: ${parent.className}`);
|
|
||||||
|
|
||||||
info(`After opening an empty tab, gURLBar.focused: ${gURLBar.focused}`);
|
|
||||||
|
|
||||||
|
|
||||||
is(active.tagName, "html:input", "Input element focused");
|
|
||||||
ok(active.classList.contains("urlbar-input"), "Urlbar focused");
|
|
||||||
|
|
||||||
extension.sendMessage("remove", tab2.id);
|
|
||||||
await extension.awaitMessage("result");
|
|
||||||
|
|
||||||
await extension.unload();
|
|
||||||
});
|
|
||||||
@@ -171,9 +171,7 @@ class TestFirefoxRefresh(MarionetteTestCase):
|
|||||||
});
|
});
|
||||||
let expectedTabs = new Set();
|
let expectedTabs = new Set();
|
||||||
for (let url of expectedURLs) {
|
for (let url of expectedURLs) {
|
||||||
expectedTabs.add(gBrowser.addTab(url, {
|
expectedTabs.add(gBrowser.addTab(url));
|
||||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
// Close any other tabs that might be open:
|
// Close any other tabs that might be open:
|
||||||
let allTabs = Array.from(gBrowser.tabs);
|
let allTabs = Array.from(gBrowser.tabs);
|
||||||
|
|||||||
@@ -2344,7 +2344,7 @@ BrowserGlue.prototype = {
|
|||||||
let tabs = win.gBrowser.tabs;
|
let tabs = win.gBrowser.tabs;
|
||||||
tab = tabs[tabs.length - 1];
|
tab = tabs[tabs.length - 1];
|
||||||
} else {
|
} else {
|
||||||
tab = win.gBrowser.addWebTab(URI.uri);
|
tab = win.gBrowser.addTab(URI.uri);
|
||||||
}
|
}
|
||||||
tab.setAttribute("attention", true);
|
tab.setAttribute("attention", true);
|
||||||
return tab;
|
return tab;
|
||||||
@@ -2424,7 +2424,7 @@ BrowserGlue.prototype = {
|
|||||||
let tabs = win.gBrowser.tabs;
|
let tabs = win.gBrowser.tabs;
|
||||||
tab = tabs[tabs.length - 1];
|
tab = tabs[tabs.length - 1];
|
||||||
} else {
|
} else {
|
||||||
tab = win.gBrowser.addWebTab(url);
|
tab = win.gBrowser.addTab(url);
|
||||||
}
|
}
|
||||||
tab.setAttribute("attention", true);
|
tab.setAttribute("attention", true);
|
||||||
let clickCallback = (subject, topic, data) => {
|
let clickCallback = (subject, topic, data) => {
|
||||||
@@ -2457,7 +2457,7 @@ BrowserGlue.prototype = {
|
|||||||
if (!win) {
|
if (!win) {
|
||||||
this._openURLInNewWindow(url);
|
this._openURLInNewWindow(url);
|
||||||
} else {
|
} else {
|
||||||
win.gBrowser.addWebTab(url);
|
win.gBrowser.addTab(url);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ add_task(async function testNoSessionRestoreButton() {
|
|||||||
(await BrowserTestUtils.openNewBrowserWindow({private: true})).close();
|
(await BrowserTestUtils.openNewBrowserWindow({private: true})).close();
|
||||||
|
|
||||||
let win = await BrowserTestUtils.openNewBrowserWindow({private: true});
|
let win = await BrowserTestUtils.openNewBrowserWindow({private: true});
|
||||||
let tab = BrowserTestUtils.addTab(win.gBrowser, "about:sessionrestore");
|
let tab = win.gBrowser.addTab("about:sessionrestore");
|
||||||
let browser = tab.linkedBrowser;
|
let browser = tab.linkedBrowser;
|
||||||
|
|
||||||
await BrowserTestUtils.browserLoaded(browser);
|
await BrowserTestUtils.browserLoaded(browser);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ function get_cache_for_private_window() {
|
|||||||
|
|
||||||
ok(true, "The private window got loaded");
|
ok(true, "The private window got loaded");
|
||||||
|
|
||||||
let tab = BrowserTestUtils.addTab(win.gBrowser, "http://example.org");
|
let tab = win.gBrowser.addTab("http://example.org");
|
||||||
win.gBrowser.selectedTab = tab;
|
win.gBrowser.selectedTab = tab;
|
||||||
let newTabBrowser = win.gBrowser.getBrowserForTab(tab);
|
let newTabBrowser = win.gBrowser.getBrowserForTab(tab);
|
||||||
|
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ async function assignCookies(aBrowser, aURL, aCookieValue) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function openTab(aBrowser, aURL) {
|
async function openTab(aBrowser, aURL) {
|
||||||
let tab = BrowserTestUtils.addTab(aBrowser, aURL);
|
let tab = aBrowser.addTab(aURL);
|
||||||
|
|
||||||
// Select tab and make sure its browser is focused.
|
// Select tab and make sure its browser is focused.
|
||||||
aBrowser.selectedTab = tab;
|
aBrowser.selectedTab = tab;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ add_task(async function test() {
|
|||||||
|
|
||||||
function checkGeolocation(aPrivateMode, aWindow) {
|
function checkGeolocation(aPrivateMode, aWindow) {
|
||||||
return (async function() {
|
return (async function() {
|
||||||
aWindow.gBrowser.selectedTab = BrowserTestUtils.addTab(aWindow.gBrowser, testPageURL);
|
aWindow.gBrowser.selectedTab = aWindow.gBrowser.addTab(testPageURL);
|
||||||
await BrowserTestUtils.browserLoaded(aWindow.gBrowser.selectedBrowser);
|
await BrowserTestUtils.browserLoaded(aWindow.gBrowser.selectedBrowser);
|
||||||
|
|
||||||
let notification = aWindow.PopupNotifications.getNotification("geolocation");
|
let notification = aWindow.PopupNotifications.getNotification("geolocation");
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
let win = await BrowserTestUtils.openNewBrowserWindow({private: true});
|
let win = await BrowserTestUtils.openNewBrowserWindow({private: true});
|
||||||
|
|
||||||
win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser, page1);
|
win.gBrowser.selectedTab = win.gBrowser.addTab(page1);
|
||||||
let browser = win.gBrowser.selectedBrowser;
|
let browser = win.gBrowser.selectedBrowser;
|
||||||
await BrowserTestUtils.browserLoaded(browser);
|
await BrowserTestUtils.browserLoaded(browser);
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ add_task(async function test() {
|
|||||||
|
|
||||||
// Step 1.
|
// Step 1.
|
||||||
let privateWin = await BrowserTestUtils.openNewBrowserWindow({private: true});
|
let privateWin = await BrowserTestUtils.openNewBrowserWindow({private: true});
|
||||||
let privateBrowser = BrowserTestUtils.addTab(privateWin.gBrowser,
|
let privateBrowser = privateWin.gBrowser.addTab(
|
||||||
prefix + "browser_privatebrowsing_localStorage_before_after_page.html").linkedBrowser;
|
prefix + "browser_privatebrowsing_localStorage_before_after_page.html").linkedBrowser;
|
||||||
await BrowserTestUtils.browserLoaded(privateBrowser);
|
await BrowserTestUtils.browserLoaded(privateBrowser);
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ add_task(async function test() {
|
|||||||
|
|
||||||
// Step 2.
|
// Step 2.
|
||||||
let win = await BrowserTestUtils.openNewBrowserWindow();
|
let win = await BrowserTestUtils.openNewBrowserWindow();
|
||||||
let browser = BrowserTestUtils.addTab(win.gBrowser,
|
let browser = win.gBrowser.addTab(
|
||||||
prefix + "browser_privatebrowsing_localStorage_before_after_page2.html").linkedBrowser;
|
prefix + "browser_privatebrowsing_localStorage_before_after_page2.html").linkedBrowser;
|
||||||
await BrowserTestUtils.browserLoaded(browser);
|
await BrowserTestUtils.browserLoaded(browser);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
add_task(async function test_no_session_restore_menu_option() {
|
add_task(async function test_no_session_restore_menu_option() {
|
||||||
let win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
|
let win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
|
||||||
ok(true, "The first private window got loaded");
|
ok(true, "The first private window got loaded");
|
||||||
BrowserTestUtils.addTab(win.gBrowser, "about:mozilla");
|
win.gBrowser.addTab("about:mozilla");
|
||||||
await BrowserTestUtils.closeWindow(win);
|
await BrowserTestUtils.closeWindow(win);
|
||||||
|
|
||||||
win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
|
win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ add_task(async function test() {
|
|||||||
"browser/components/privatebrowsing/test/browser/browser_privatebrowsing_protocolhandler_page.html";
|
"browser/components/privatebrowsing/test/browser/browser_privatebrowsing_protocolhandler_page.html";
|
||||||
|
|
||||||
let doTest = async function(aIsPrivateMode, aWindow) {
|
let doTest = async function(aIsPrivateMode, aWindow) {
|
||||||
let tab = aWindow.gBrowser.selectedTab = BrowserTestUtils.addTab(aWindow.gBrowser, testURI);
|
let tab = aWindow.gBrowser.selectedTab = aWindow.gBrowser.addTab(testURI);
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
let promiseFinished = PromiseUtils.defer();
|
let promiseFinished = PromiseUtils.defer();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function testWhitelistedPage(window) {
|
|||||||
|
|
||||||
add_task(async function testNormalBrowsing() {
|
add_task(async function testNormalBrowsing() {
|
||||||
tabbrowser = gBrowser;
|
tabbrowser = gBrowser;
|
||||||
let tab = tabbrowser.selectedTab = BrowserTestUtils.addTab(tabbrowser);
|
let tab = tabbrowser.selectedTab = tabbrowser.addTab();
|
||||||
|
|
||||||
info("Load a test page that's whitelisted");
|
info("Load a test page that's whitelisted");
|
||||||
Services.prefs.setCharPref(PREF_WHITELISTED_HOSTNAMES, "example.com,www.ItIsaTrap.org,example.net");
|
Services.prefs.setCharPref(PREF_WHITELISTED_HOSTNAMES, "example.com,www.ItIsaTrap.org,example.net");
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ add_task(async function test() {
|
|||||||
container.addEventListener("TabOpen", tabAdded);
|
container.addEventListener("TabOpen", tabAdded);
|
||||||
|
|
||||||
BrowserTestUtils.addTab(gBrowser, "about:blank");
|
BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||||
BrowserSearch.loadSearchFromContext("mozilla", Services.scriptSecurityManager.getSystemPrincipal());
|
BrowserSearch.loadSearchFromContext("mozilla");
|
||||||
BrowserSearch.loadSearchFromContext("firefox", Services.scriptSecurityManager.getSystemPrincipal());
|
BrowserSearch.loadSearchFromContext("firefox");
|
||||||
|
|
||||||
// Wait for all the tabs to open.
|
// Wait for all the tabs to open.
|
||||||
await tabsLoadedDeferred.promise;
|
await tabsLoadedDeferred.promise;
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ async function testSearchEngine(engineDetails) {
|
|||||||
run() {
|
run() {
|
||||||
// Simulate a contextmenu search
|
// Simulate a contextmenu search
|
||||||
// FIXME: This is a bit "low-level"...
|
// FIXME: This is a bit "low-level"...
|
||||||
BrowserSearch._loadSearch("foo", false, "contextmenu", Services.scriptSecurityManager.getSystemPrincipal());
|
BrowserSearch.loadSearch("foo", false, "contextmenu");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ async function testSearchEngine(engineDetails) {
|
|||||||
run() {
|
run() {
|
||||||
// Simulate a contextmenu search
|
// Simulate a contextmenu search
|
||||||
// FIXME: This is a bit "low-level"...
|
// FIXME: This is a bit "low-level"...
|
||||||
BrowserSearch._loadSearch("foo", false, "contextmenu", Services.scriptSecurityManager.getSystemPrincipal());
|
BrowserSearch.loadSearch("foo", false, "contextmenu");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2431,12 +2431,9 @@ var SessionStoreInternal = {
|
|||||||
|
|
||||||
// Create a new tab.
|
// Create a new tab.
|
||||||
let userContextId = aTab.getAttribute("usercontextid");
|
let userContextId = aTab.getAttribute("usercontextid");
|
||||||
|
let newTab = aTab == aWindow.gBrowser.selectedTab ?
|
||||||
let tabOptions = {
|
aWindow.gBrowser.addTab(null, {relatedToCurrent: true, ownerTab: aTab, userContextId}) :
|
||||||
userContextId,
|
aWindow.gBrowser.addTab(null, {userContextId});
|
||||||
...(aTab == aWindow.gBrowser.selectedTab ? {relatedToCurrent: true, ownerTab: aTab} : {})
|
|
||||||
};
|
|
||||||
let newTab = aWindow.gBrowser.addTrustedTab(null, tabOptions);
|
|
||||||
|
|
||||||
// Start the throbber to pretend we're doing something while actually
|
// Start the throbber to pretend we're doing something while actually
|
||||||
// waiting for data from the frame script.
|
// waiting for data from the frame script.
|
||||||
@@ -2525,7 +2522,7 @@ var SessionStoreInternal = {
|
|||||||
// create a new tab
|
// create a new tab
|
||||||
let tabbrowser = aWindow.gBrowser;
|
let tabbrowser = aWindow.gBrowser;
|
||||||
let tab = tabbrowser.selectedTab =
|
let tab = tabbrowser.selectedTab =
|
||||||
tabbrowser.addTrustedTab(null, {
|
tabbrowser.addTab(null, {
|
||||||
index: pos,
|
index: pos,
|
||||||
pinned: state.pinned,
|
pinned: state.pinned,
|
||||||
userContextId: state.userContextId,
|
userContextId: state.userContextId,
|
||||||
@@ -3495,13 +3492,13 @@ var SessionStoreInternal = {
|
|||||||
// Setting noInitialLabel is a perf optimization. Rendering tab labels
|
// Setting noInitialLabel is a perf optimization. Rendering tab labels
|
||||||
// would make resizing the tabs more expensive as we're adding them.
|
// would make resizing the tabs more expensive as we're adding them.
|
||||||
// Each tab will get its initial label set in restoreTab.
|
// Each tab will get its initial label set in restoreTab.
|
||||||
tab = tabbrowser.addTrustedTab(url,
|
tab = tabbrowser.addTab(url,
|
||||||
{ createLazyBrowser,
|
{ createLazyBrowser,
|
||||||
skipAnimation: true,
|
skipAnimation: true,
|
||||||
noInitialLabel: true,
|
noInitialLabel: true,
|
||||||
userContextId,
|
userContextId,
|
||||||
skipBackgroundNotify: true,
|
skipBackgroundNotify: true,
|
||||||
bulkOrderedOpen: true });
|
bulkOrderedOpen: true });
|
||||||
|
|
||||||
if (select) {
|
if (select) {
|
||||||
let leftoverTab = tabbrowser.selectedTab;
|
let leftoverTab = tabbrowser.selectedTab;
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ function toggleRowChecked(aIx) {
|
|||||||
|
|
||||||
function restoreSingleTab(aIx, aShifted) {
|
function restoreSingleTab(aIx, aShifted) {
|
||||||
var tabbrowser = getBrowserWindow().gBrowser;
|
var tabbrowser = getBrowserWindow().gBrowser;
|
||||||
var newTab = tabbrowser.addWebTab();
|
var newTab = tabbrowser.addTab();
|
||||||
var item = gTreeData[aIx];
|
var item = gTreeData[aIx];
|
||||||
|
|
||||||
var tabState = gStateObject.windows[item.parent.ix]
|
var tabState = gStateObject.windows[item.parent.ix]
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ let setupTest = async function(options, testFunction) {
|
|||||||
* The browser window to load the tabs in
|
* The browser window to load the tabs in
|
||||||
*/
|
*/
|
||||||
function injectTestTabs(win) {
|
function injectTestTabs(win) {
|
||||||
let promises = TEST_URLS.map(url => BrowserTestUtils.addTab(win.gBrowser, url))
|
let promises = TEST_URLS.map(url => win.gBrowser.addTab(url))
|
||||||
.map(tab => BrowserTestUtils.browserLoaded(tab.linkedBrowser));
|
.map(tab => BrowserTestUtils.browserLoaded(tab.linkedBrowser));
|
||||||
return Promise.all(promises);
|
return Promise.all(promises);
|
||||||
}
|
}
|
||||||
@@ -313,7 +313,7 @@ add_task(async function test_open_close_window_and_popup() {
|
|||||||
openDialog(location, "popup2", POPUP_FEATURES, TEST_URLS[1]);
|
openDialog(location, "popup2", POPUP_FEATURES, TEST_URLS[1]);
|
||||||
let popup2 = await popup2Promise;
|
let popup2 = await popup2Promise;
|
||||||
|
|
||||||
BrowserTestUtils.addTab(popup2.gBrowser, TEST_URLS[0]);
|
popup2.gBrowser.addTab(TEST_URLS[0]);
|
||||||
|
|
||||||
let closed = await closeWindowForRestoration(newWin);
|
let closed = await closeWindowForRestoration(newWin);
|
||||||
ok(closed, "Should be able to close the window");
|
ok(closed, "Should be able to close the window");
|
||||||
@@ -378,7 +378,7 @@ add_task(async function test_open_close_only_popup() {
|
|||||||
openDialog(location, "popup", POPUP_FEATURES, TEST_URLS[1]);
|
openDialog(location, "popup", POPUP_FEATURES, TEST_URLS[1]);
|
||||||
popup = await popupPromise;
|
popup = await popupPromise;
|
||||||
|
|
||||||
BrowserTestUtils.addTab(popup.gBrowser, TEST_URLS[0]);
|
popup.gBrowser.addTab(TEST_URLS[0]);
|
||||||
is(popup.gBrowser.browsers.length, 2,
|
is(popup.gBrowser.browsers.length, 2,
|
||||||
"Did not restore to the popup window (2)");
|
"Did not restore to the popup window (2)");
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ add_task(async function new_window() {
|
|||||||
let newWin;
|
let newWin;
|
||||||
try {
|
try {
|
||||||
newWin = await promiseNewWindowLoaded();
|
newWin = await promiseNewWindowLoaded();
|
||||||
let tab = BrowserTestUtils.addTab(newWin.gBrowser, "http://example.com/browser_625016.js?" + Math.random());
|
let tab = newWin.gBrowser.addTab("http://example.com/browser_625016.js?" + Math.random());
|
||||||
await promiseBrowserLoaded(tab.linkedBrowser);
|
await promiseBrowserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
// Double check that we have no closed windows
|
// Double check that we have no closed windows
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ add_task(async function test_3() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
async function promiseTabLoad(win, url) {
|
async function promiseTabLoad(win, url) {
|
||||||
let tab = BrowserTestUtils.addTab(win.gBrowser, url);
|
let tab = win.gBrowser.addTab(url);
|
||||||
await promiseBrowserLoaded(tab.linkedBrowser);
|
await promiseBrowserLoaded(tab.linkedBrowser);
|
||||||
await TabStateFlusher.flush(tab.linkedBrowser);
|
await TabStateFlusher.flush(tab.linkedBrowser);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ function promiseNewWindow() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function createTabWithStorageData(urls, win = window) {
|
async function createTabWithStorageData(urls, win = window) {
|
||||||
let tab = BrowserTestUtils.addTab(win.gBrowser);
|
let tab = win.gBrowser.addTab();
|
||||||
let browser = tab.linkedBrowser;
|
let browser = tab.linkedBrowser;
|
||||||
|
|
||||||
for (let url of urls) {
|
for (let url of urls) {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ add_task(async function test_open_and_close() {
|
|||||||
await promiseBrowserLoaded(newTab2.linkedBrowser);
|
await promiseBrowserLoaded(newTab2.linkedBrowser);
|
||||||
|
|
||||||
let newWin = await promiseNewWindowLoaded();
|
let newWin = await promiseNewWindowLoaded();
|
||||||
let tab = BrowserTestUtils.addTab(newWin.gBrowser, URL_NEWWIN);
|
let tab = newWin.gBrowser.addTab(URL_NEWWIN);
|
||||||
|
|
||||||
await promiseBrowserLoaded(tab.linkedBrowser);
|
await promiseBrowserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ add_task(async function test_revive_all_tabs_from_session_store() {
|
|||||||
// a second window, since only selected tabs will show
|
// a second window, since only selected tabs will show
|
||||||
// about:tabcrashed.
|
// about:tabcrashed.
|
||||||
let win2 = await BrowserTestUtils.openNewBrowserWindow();
|
let win2 = await BrowserTestUtils.openNewBrowserWindow();
|
||||||
let newTab2 = BrowserTestUtils.addTab(win2.gBrowser, PAGE_1, { sameProcessAsFrameLoader: browser.frameLoader });
|
let newTab2 = win2.gBrowser.addTab(PAGE_1, { sameProcessAsFrameLoader: browser.frameLoader });
|
||||||
win2.gBrowser.selectedTab = newTab2;
|
win2.gBrowser.selectedTab = newTab2;
|
||||||
let browser2 = newTab2.linkedBrowser;
|
let browser2 = newTab2.linkedBrowser;
|
||||||
ok(browser2.isRemoteBrowser, "Should be a remote browser");
|
ok(browser2.isRemoteBrowser, "Should be a remote browser");
|
||||||
@@ -407,7 +407,7 @@ add_task(async function test_hide_restore_all_button() {
|
|||||||
// Load up a second window so we can get another tab to show
|
// Load up a second window so we can get another tab to show
|
||||||
// about:tabcrashed
|
// about:tabcrashed
|
||||||
let win2 = await BrowserTestUtils.openNewBrowserWindow();
|
let win2 = await BrowserTestUtils.openNewBrowserWindow();
|
||||||
let newTab3 = BrowserTestUtils.addTab(win2.gBrowser, PAGE_2, { sameProcessAsFrameLoader: browser.frameLoader });
|
let newTab3 = win2.gBrowser.addTab(PAGE_2, { sameProcessAsFrameLoader: browser.frameLoader });
|
||||||
win2.gBrowser.selectedTab = newTab3;
|
win2.gBrowser.selectedTab = newTab3;
|
||||||
let otherWinBrowser = newTab3.linkedBrowser;
|
let otherWinBrowser = newTab3.linkedBrowser;
|
||||||
await promiseBrowserLoaded(otherWinBrowser);
|
await promiseBrowserLoaded(otherWinBrowser);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ add_task(async function test() {
|
|||||||
await promiseBrowserLoaded(win.gBrowser.selectedBrowser);
|
await promiseBrowserLoaded(win.gBrowser.selectedBrowser);
|
||||||
|
|
||||||
// Open a second tab and close the first one.
|
// Open a second tab and close the first one.
|
||||||
let tab = BrowserTestUtils.addTab(win.gBrowser, "about:mozilla");
|
let tab = win.gBrowser.addTab("about:mozilla");
|
||||||
await promiseBrowserLoaded(tab.linkedBrowser);
|
await promiseBrowserLoaded(tab.linkedBrowser);
|
||||||
await TabStateFlusher.flush(tab.linkedBrowser);
|
await TabStateFlusher.flush(tab.linkedBrowser);
|
||||||
await promiseRemoveTabAndSessionState(win.gBrowser.tabs[0]);
|
await promiseRemoveTabAndSessionState(win.gBrowser.tabs[0]);
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ add_task(async function() {
|
|||||||
mm.loadFrameScript(FRAME_SCRIPT, true);
|
mm.loadFrameScript(FRAME_SCRIPT, true);
|
||||||
|
|
||||||
// Create a new tab in the new window that will load the frame script.
|
// Create a new tab in the new window that will load the frame script.
|
||||||
let tab = BrowserTestUtils.addTab(win.gBrowser, "about:mozilla");
|
let tab = win.gBrowser.addTab("about:mozilla");
|
||||||
let browser = tab.linkedBrowser;
|
let browser = tab.linkedBrowser;
|
||||||
await promiseBrowserLoaded(browser);
|
await promiseBrowserLoaded(browser);
|
||||||
await TabStateFlusher.flush(browser);
|
await TabStateFlusher.flush(browser);
|
||||||
@@ -86,7 +86,7 @@ add_task(async function() {
|
|||||||
is(ss.getClosedTabCount(win), 0, "no tabs to restore");
|
is(ss.getClosedTabCount(win), 0, "no tabs to restore");
|
||||||
|
|
||||||
// Create a new tab in the new window that will load the frame script.
|
// Create a new tab in the new window that will load the frame script.
|
||||||
tab = BrowserTestUtils.addTab(win.gBrowser, "about:mozilla");
|
tab = win.gBrowser.addTab("about:mozilla");
|
||||||
browser = tab.linkedBrowser;
|
browser = tab.linkedBrowser;
|
||||||
await promiseBrowserLoaded(browser);
|
await promiseBrowserLoaded(browser);
|
||||||
await TabStateFlusher.flush(browser);
|
await TabStateFlusher.flush(browser);
|
||||||
@@ -109,7 +109,7 @@ add_task(async function() {
|
|||||||
let win = await promiseNewWindowLoaded({private: true});
|
let win = await promiseNewWindowLoaded({private: true});
|
||||||
|
|
||||||
// Create a new tab in the new window that will load the frame script.
|
// Create a new tab in the new window that will load the frame script.
|
||||||
let tab = BrowserTestUtils.addTab(win.gBrowser, "about:mozilla");
|
let tab = win.gBrowser.addTab("about:mozilla");
|
||||||
let browser = tab.linkedBrowser;
|
let browser = tab.linkedBrowser;
|
||||||
await promiseBrowserLoaded(browser);
|
await promiseBrowserLoaded(browser);
|
||||||
await TabStateFlusher.flush(browser);
|
await TabStateFlusher.flush(browser);
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ add_task(async function test_scroll_background_tabs() {
|
|||||||
pushPrefs(["browser.sessionstore.restore_on_demand", true]);
|
pushPrefs(["browser.sessionstore.restore_on_demand", true]);
|
||||||
|
|
||||||
let newWin = await BrowserTestUtils.openNewBrowserWindow();
|
let newWin = await BrowserTestUtils.openNewBrowserWindow();
|
||||||
let tab = BrowserTestUtils.addTab(newWin.gBrowser, URL);
|
let tab = newWin.gBrowser.addTab(URL);
|
||||||
let browser = tab.linkedBrowser;
|
let browser = tab.linkedBrowser;
|
||||||
await BrowserTestUtils.browserLoaded(browser);
|
await BrowserTestUtils.browserLoaded(browser);
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ add_task(async function test_scroll_background_about_reader_tabs() {
|
|||||||
pushPrefs(["browser.sessionstore.restore_on_demand", true]);
|
pushPrefs(["browser.sessionstore.restore_on_demand", true]);
|
||||||
|
|
||||||
let newWin = await BrowserTestUtils.openNewBrowserWindow();
|
let newWin = await BrowserTestUtils.openNewBrowserWindow();
|
||||||
let tab = BrowserTestUtils.addTab(newWin.gBrowser, READER_MODE_URL);
|
let tab = newWin.gBrowser.addTab(READER_MODE_URL);
|
||||||
let browser = tab.linkedBrowser;
|
let browser = tab.linkedBrowser;
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
BrowserTestUtils.browserLoaded(browser),
|
BrowserTestUtils.browserLoaded(browser),
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ add_task(async function() {
|
|||||||
let win = await promiseNewWindowLoaded();
|
let win = await promiseNewWindowLoaded();
|
||||||
|
|
||||||
// Add a new tab.
|
// Add a new tab.
|
||||||
let tab = BrowserTestUtils.addTab(win.gBrowser, "about:blank");
|
let tab = win.gBrowser.addTab("about:blank");
|
||||||
let browser = tab.linkedBrowser;
|
let browser = tab.linkedBrowser;
|
||||||
await promiseBrowserLoaded(browser);
|
await promiseBrowserLoaded(browser);
|
||||||
ok(browser.isRemoteBrowser, "browser is remote");
|
ok(browser.isRemoteBrowser, "browser is remote");
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
ChromeUtils.import("resource:///modules/sessionstore/SessionStore.jsm");
|
ChromeUtils.import("resource:///modules/sessionstore/SessionStore.jsm");
|
||||||
|
|
||||||
async function openAndCloseTab(window, url) {
|
async function openAndCloseTab(window, url) {
|
||||||
let tab = BrowserTestUtils.addTab(window.gBrowser, url);
|
let tab = window.gBrowser.addTab(url);
|
||||||
await promiseBrowserLoaded(tab.linkedBrowser, true, url);
|
await promiseBrowserLoaded(tab.linkedBrowser, true, url);
|
||||||
await TabStateFlusher.flush(tab.linkedBrowser);
|
await TabStateFlusher.flush(tab.linkedBrowser);
|
||||||
await promiseRemoveTabAndSessionState(tab);
|
await promiseRemoveTabAndSessionState(tab);
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ add_task(async function() {
|
|||||||
|
|
||||||
// Create 4 tabs with different userContextId.
|
// Create 4 tabs with different userContextId.
|
||||||
for (let userContextId = 1; userContextId < 5; userContextId++) {
|
for (let userContextId = 1; userContextId < 5; userContextId++) {
|
||||||
let tab = BrowserTestUtils.addTab(win.gBrowser, "http://example.com/", {
|
let tab = win.gBrowser.addTab("http://example.com/", {userContextId});
|
||||||
userContextId,
|
|
||||||
});
|
|
||||||
await promiseBrowserLoaded(tab.linkedBrowser);
|
await promiseBrowserLoaded(tab.linkedBrowser);
|
||||||
await TabStateFlusher.flush(tab.linkedBrowser);
|
await TabStateFlusher.flush(tab.linkedBrowser);
|
||||||
}
|
}
|
||||||
@@ -38,9 +36,7 @@ add_task(async function() {
|
|||||||
// Create tabs with different userContextId, but this time we create them with
|
// Create tabs with different userContextId, but this time we create them with
|
||||||
// fewer tabs and with different order with win.
|
// fewer tabs and with different order with win.
|
||||||
for (let userContextId = 3; userContextId > 0; userContextId--) {
|
for (let userContextId = 3; userContextId > 0; userContextId--) {
|
||||||
let tab = BrowserTestUtils.addTab(win2.gBrowser, "http://example.com/", {
|
let tab = win2.gBrowser.addTab("http://example.com/", {userContextId});
|
||||||
userContextId,
|
|
||||||
});
|
|
||||||
await promiseBrowserLoaded(tab.linkedBrowser);
|
await promiseBrowserLoaded(tab.linkedBrowser);
|
||||||
await TabStateFlusher.flush(tab.linkedBrowser);
|
await TabStateFlusher.flush(tab.linkedBrowser);
|
||||||
}
|
}
|
||||||
@@ -80,9 +76,7 @@ add_task(async function() {
|
|||||||
let win = await BrowserTestUtils.openNewBrowserWindow();
|
let win = await BrowserTestUtils.openNewBrowserWindow();
|
||||||
await TabStateFlusher.flush(win.gBrowser.selectedBrowser);
|
await TabStateFlusher.flush(win.gBrowser.selectedBrowser);
|
||||||
|
|
||||||
let tab = BrowserTestUtils.addTab(win.gBrowser, "http://example.com/", {
|
let tab = win.gBrowser.addTab("http://example.com/", { userContextId: 1 });
|
||||||
userContextId: 1,
|
|
||||||
});
|
|
||||||
await promiseBrowserLoaded(tab.linkedBrowser);
|
await promiseBrowserLoaded(tab.linkedBrowser);
|
||||||
await TabStateFlusher.flush(tab.linkedBrowser);
|
await TabStateFlusher.flush(tab.linkedBrowser);
|
||||||
|
|
||||||
@@ -98,9 +92,7 @@ add_task(async function() {
|
|||||||
|
|
||||||
let win2 = await BrowserTestUtils.openNewBrowserWindow();
|
let win2 = await BrowserTestUtils.openNewBrowserWindow();
|
||||||
|
|
||||||
let tab2 = BrowserTestUtils.addTab(win2.gBrowser, "http://example.com/", {
|
let tab2 = win2.gBrowser.addTab("http://example.com/", { userContextId: 1 });
|
||||||
userContextId: 1,
|
|
||||||
});
|
|
||||||
await promiseBrowserLoaded(tab2.linkedBrowser);
|
await promiseBrowserLoaded(tab2.linkedBrowser);
|
||||||
await TabStateFlusher.flush(tab2.linkedBrowser);
|
await TabStateFlusher.flush(tab2.linkedBrowser);
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ var { helpers, assert } = (function () {
|
|||||||
options.isFirefox = true;
|
options.isFirefox = true;
|
||||||
|
|
||||||
var tabbrowser = options.chromeWindow.gBrowser;
|
var tabbrowser = options.chromeWindow.gBrowser;
|
||||||
options.tab = BrowserTestUtils.addTab(tabbrowser);
|
options.tab = tabbrowser.addTab();
|
||||||
tabbrowser.selectedTab = options.tab;
|
tabbrowser.selectedTab = options.tab;
|
||||||
options.browser = tabbrowser.getBrowserForTab(options.tab);
|
options.browser = tabbrowser.getBrowserForTab(options.tab);
|
||||||
options.target = TargetFactory.forTab(options.tab);
|
options.target = TargetFactory.forTab(options.tab);
|
||||||
@@ -117,7 +117,7 @@ var { helpers, assert } = (function () {
|
|||||||
options.isFirefox = true;
|
options.isFirefox = true;
|
||||||
|
|
||||||
var tabbrowser = options.chromeWindow.gBrowser;
|
var tabbrowser = options.chromeWindow.gBrowser;
|
||||||
options.tab = BrowserTestUtils.addTab(tabbrowser);
|
options.tab = tabbrowser.addTab();
|
||||||
tabbrowser.selectedTab = options.tab;
|
tabbrowser.selectedTab = options.tab;
|
||||||
options.browser = tabbrowser.getBrowserForTab(options.tab);
|
options.browser = tabbrowser.getBrowserForTab(options.tab);
|
||||||
options.target = TargetFactory.forTab(options.tab);
|
options.target = TargetFactory.forTab(options.tab);
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ this.addTab = function addTab(aUrl, aWindow) {
|
|||||||
let targetBrowser = targetWindow.gBrowser;
|
let targetBrowser = targetWindow.gBrowser;
|
||||||
|
|
||||||
targetWindow.focus();
|
targetWindow.focus();
|
||||||
let tab = targetBrowser.selectedTab = BrowserTestUtils.addTab(targetBrowser, aUrl);
|
let tab = targetBrowser.selectedTab = targetBrowser.addTab(aUrl);
|
||||||
let linkedBrowser = tab.linkedBrowser;
|
let linkedBrowser = tab.linkedBrowser;
|
||||||
|
|
||||||
info("Loading frame script with url " + FRAME_SCRIPT_URL + ".");
|
info("Loading frame script with url " + FRAME_SCRIPT_URL + ".");
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||||||
// Used by browser-sets.inc, command
|
// Used by browser-sets.inc, command
|
||||||
openAboutDebugging(gBrowser, hash) {
|
openAboutDebugging(gBrowser, hash) {
|
||||||
const url = "about:debugging" + (hash ? "#" + hash : "");
|
const url = "about:debugging" + (hash ? "#" + hash : "");
|
||||||
gBrowser.selectedTab = gBrowser.addTrustedTab(url);
|
gBrowser.selectedTab = gBrowser.addTab(url);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -293,7 +293,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||||||
*/
|
*/
|
||||||
// Used by browser-sets.inc, command
|
// Used by browser-sets.inc, command
|
||||||
openConnectScreen(gBrowser) {
|
openConnectScreen(gBrowser) {
|
||||||
gBrowser.selectedTab = gBrowser.addTrustedTab("chrome://devtools/content/framework/connect/connect.xhtml");
|
gBrowser.selectedTab = gBrowser.addTab("chrome://devtools/content/framework/connect/connect.xhtml");
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -33,15 +33,8 @@ function openRequestInTab(url, requestPostData) {
|
|||||||
postData.addHeader("Content-Type", "application/x-www-form-urlencoded");
|
postData.addHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||||
postData.setData(stringStream);
|
postData.setData(stringStream);
|
||||||
}
|
}
|
||||||
const userContextId = win.gBrowser.contentPrincipal.userContextId;
|
|
||||||
win.gBrowser.selectedTab = win.gBrowser.addWebTab(url, {
|
win.gBrowser.selectedTab = win.gBrowser.addTab(url, { postData });
|
||||||
// TODO this should be using the original request principal
|
|
||||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({
|
|
||||||
userContextId,
|
|
||||||
}),
|
|
||||||
userContextId,
|
|
||||||
postData,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getInputStreamFromString(data) {
|
function getInputStreamFromString(data) {
|
||||||
|
|||||||
@@ -28,11 +28,7 @@ function receiveProfile(profile) {
|
|||||||
const browser = win.gBrowser;
|
const browser = win.gBrowser;
|
||||||
Services.focus.activeWindow = win;
|
Services.focus.activeWindow = win;
|
||||||
|
|
||||||
const tab = browser.addWebTab("https://perf-html.io/from-addon", {
|
const tab = browser.addTab("https://perf-html.io/from-addon");
|
||||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({
|
|
||||||
userContextId: browser.contentPrincipal.userContextId,
|
|
||||||
})
|
|
||||||
});
|
|
||||||
browser.selectedTab = tab;
|
browser.selectedTab = tab;
|
||||||
const mm = tab.linkedBrowser.messageManager;
|
const mm = tab.linkedBrowser.messageManager;
|
||||||
mm.loadFrameScript(
|
mm.loadFrameScript(
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
const { Ci } = require("chrome");
|
const { Ci } = require("chrome");
|
||||||
const { E10SUtils } = require("resource://gre/modules/E10SUtils.jsm");
|
const { E10SUtils } = require("resource://gre/modules/E10SUtils.jsm");
|
||||||
const { tunnelToInnerBrowser } = require("./tunnel");
|
const { tunnelToInnerBrowser } = require("./tunnel");
|
||||||
const Services = require("Services");
|
|
||||||
|
|
||||||
function debug(msg) {
|
function debug(msg) {
|
||||||
// console.log(`RDM swap: ${msg}`);
|
// console.log(`RDM swap: ${msg}`);
|
||||||
@@ -59,10 +58,7 @@ function swapToInnerBrowser({ tab, containerURL, getInnerBrowser }) {
|
|||||||
browserWindow.addEventListener("TabOpen", event => {
|
browserWindow.addEventListener("TabOpen", event => {
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
}, { capture: true, once: true });
|
}, { capture: true, once: true });
|
||||||
options.triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({
|
return gBrowser.addTab(uri, options);
|
||||||
userContextId: options.userContextId,
|
|
||||||
});
|
|
||||||
return gBrowser.addWebTab(uri, options);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// A version of `gBrowser.swapBrowsersAndCloseOther` that absorbs the `TabClose` event.
|
// A version of `gBrowser.swapBrowsersAndCloseOther` that absorbs the `TabClose` event.
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ var addTab = function(url, win) {
|
|||||||
const targetWindow = win || window;
|
const targetWindow = win || window;
|
||||||
const targetBrowser = targetWindow.gBrowser;
|
const targetBrowser = targetWindow.gBrowser;
|
||||||
|
|
||||||
const tab = targetBrowser.selectedTab = BrowserTestUtils.addTab(targetBrowser, url);
|
const tab = targetBrowser.selectedTab = targetBrowser.addTab(url);
|
||||||
BrowserTestUtils.browserLoaded(targetBrowser.selectedBrowser)
|
BrowserTestUtils.browserLoaded(targetBrowser.selectedBrowser)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
info("URL '" + url + "' loading complete");
|
info("URL '" + url + "' loading complete");
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ add_task(async function() {
|
|||||||
const privateWindow = await openNewBrowserWindow({ private: true });
|
const privateWindow = await openNewBrowserWindow({ private: true });
|
||||||
ok(PrivateBrowsingUtils.isWindowPrivate(privateWindow), "window is private");
|
ok(PrivateBrowsingUtils.isWindowPrivate(privateWindow), "window is private");
|
||||||
const privateBrowser = privateWindow.gBrowser;
|
const privateBrowser = privateWindow.gBrowser;
|
||||||
privateBrowser.selectedTab = BrowserTestUtils.addTab(privateBrowser, PRIVATE_TEST_URI);
|
privateBrowser.selectedTab = privateBrowser.addTab(PRIVATE_TEST_URI);
|
||||||
const privateTab = privateBrowser.selectedTab;
|
const privateTab = privateBrowser.selectedTab;
|
||||||
|
|
||||||
info("private tab opened");
|
info("private tab opened");
|
||||||
|
|||||||
@@ -691,7 +691,7 @@ DevToolsStartup.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set relatedToCurrent: true to open the tab next to the current one.
|
// Set relatedToCurrent: true to open the tab next to the current one.
|
||||||
gBrowser.selectedTab = gBrowser.addTrustedTab(url, {relatedToCurrent: true});
|
gBrowser.selectedTab = gBrowser.addTab(url, {relatedToCurrent: true});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleConsoleFlag: function(cmdLine) {
|
handleConsoleFlag: function(cmdLine) {
|
||||||
|
|||||||
@@ -34,8 +34,7 @@ add_task(async function() {
|
|||||||
await waitForDelayedStartupFinished(win);
|
await waitForDelayedStartupFinished(win);
|
||||||
|
|
||||||
info("Open a new tab on the new window to ensure the focus is on the new window");
|
info("Open a new tab on the new window to ensure the focus is on the new window");
|
||||||
const tab = BrowserTestUtils.addTab(win.gBrowser,
|
const tab = win.gBrowser.addTab("data:text/html;charset=utf-8,<title>foo</title>");
|
||||||
"data:text/html;charset=utf-8,<title>foo</title>");
|
|
||||||
await BrowserTestUtils.browserLoaded(win.gBrowser.getBrowserForTab(tab));
|
await BrowserTestUtils.browserLoaded(win.gBrowser.getBrowserForTab(tab));
|
||||||
|
|
||||||
info("Synthesize a DevTools shortcut, the toolbox should not open on this new window.");
|
info("Synthesize a DevTools shortcut, the toolbox should not open on this new window.");
|
||||||
|
|||||||
@@ -953,7 +953,6 @@ nsDocShell::LoadURI(nsIURI* aURI,
|
|||||||
uint32_t flags = 0;
|
uint32_t flags = 0;
|
||||||
|
|
||||||
if (inheritPrincipal) {
|
if (inheritPrincipal) {
|
||||||
MOZ_ASSERT(!nsContentUtils::IsSystemPrincipal(principalToInherit), "Should not inherit SystemPrincipal");
|
|
||||||
flags |= INTERNAL_LOAD_FLAGS_INHERIT_PRINCIPAL;
|
flags |= INTERNAL_LOAD_FLAGS_INHERIT_PRINCIPAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ function timelineTestOpenUrl(url) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let loadPromise = new Promise(function(resolve, reject) {
|
let loadPromise = new Promise(function(resolve, reject) {
|
||||||
let browser = window.gBrowser;
|
let tab = window.gBrowser.selectedTab = window.gBrowser.addTab(url);
|
||||||
let tab = browser.selectedTab = BrowserTestUtils.addTab(browser, url);
|
|
||||||
let linkedBrowser = tab.linkedBrowser;
|
let linkedBrowser = tab.linkedBrowser;
|
||||||
|
|
||||||
BrowserTestUtils.browserLoaded(linkedBrowser).then(() => resolve(tab));
|
BrowserTestUtils.browserLoaded(linkedBrowser).then(() => resolve(tab));
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const TEST_URI = getRootDirectory(gTestPath).replace("chrome://mochitests/conten
|
|||||||
* Loading an image from https:// should work.
|
* Loading an image from https:// should work.
|
||||||
*/
|
*/
|
||||||
add_task(async function load_image_from_https_test() {
|
add_task(async function load_image_from_https_test() {
|
||||||
let tab = BrowserTestUtils.addTab(gBrowser, TEST_URI);
|
let tab = gBrowser.addTab(TEST_URI);
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
gBrowser.selectedTab = tab;
|
gBrowser.selectedTab = tab;
|
||||||
@@ -38,7 +38,7 @@ add_task(async function load_image_from_https_test() {
|
|||||||
* Loading an image from http:// should be rejected.
|
* Loading an image from http:// should be rejected.
|
||||||
*/
|
*/
|
||||||
add_task(async function load_image_from_http_test() {
|
add_task(async function load_image_from_http_test() {
|
||||||
let tab = BrowserTestUtils.addTab(gBrowser, TEST_URI);
|
let tab = gBrowser.addTab(TEST_URI);
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
gBrowser.selectedTab = tab;
|
gBrowser.selectedTab = tab;
|
||||||
@@ -74,7 +74,7 @@ add_task(async function load_image_from_http_test() {
|
|||||||
* The load from https:// should be replaced.
|
* The load from https:// should be replaced.
|
||||||
*/
|
*/
|
||||||
add_task(async function load_https_and_http_test() {
|
add_task(async function load_https_and_http_test() {
|
||||||
let tab = BrowserTestUtils.addTab(gBrowser, TEST_URI);
|
let tab = gBrowser.addTab(TEST_URI);
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
// Clear image cache, otherwise in non-e10s mode the image might be cached by
|
// Clear image cache, otherwise in non-e10s mode the image might be cached by
|
||||||
@@ -121,7 +121,7 @@ add_task(async function load_https_and_http_test() {
|
|||||||
* the imageBlockingStatus value.
|
* the imageBlockingStatus value.
|
||||||
*/
|
*/
|
||||||
add_task(async function block_pending_request_test() {
|
add_task(async function block_pending_request_test() {
|
||||||
let tab = BrowserTestUtils.addTab(gBrowser, TEST_URI);
|
let tab = gBrowser.addTab(TEST_URI);
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
gBrowser.selectedTab = tab;
|
gBrowser.selectedTab = tab;
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ add_task(async function() {
|
|||||||
});
|
});
|
||||||
await win2Promise;
|
await win2Promise;
|
||||||
|
|
||||||
var tab1 = BrowserTestUtils.addTab(win1.gBrowser, URL);
|
var tab1 = win1.gBrowser.addTab(URL);
|
||||||
await BrowserTestUtils.browserLoaded(win1.gBrowser.getBrowserForTab(tab1));
|
await BrowserTestUtils.browserLoaded(win1.gBrowser.getBrowserForTab(tab1));
|
||||||
var browser1 = gBrowser.getBrowserForTab(tab1);
|
var browser1 = gBrowser.getBrowserForTab(tab1);
|
||||||
|
|
||||||
var tab2 = BrowserTestUtils.addTab(win2.gBrowser, URL);
|
var tab2 = win2.gBrowser.addTab(URL);
|
||||||
await BrowserTestUtils.browserLoaded(win2.gBrowser.getBrowserForTab(tab2));
|
await BrowserTestUtils.browserLoaded(win2.gBrowser.getBrowserForTab(tab2));
|
||||||
var browser2 = gBrowser.getBrowserForTab(tab2);
|
var browser2 = gBrowser.getBrowserForTab(tab2);
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ function test() {
|
|||||||
return BrowserTestUtils.openNewBrowserWindow({private: true});
|
return BrowserTestUtils.openNewBrowserWindow({private: true});
|
||||||
}).then(pw => {
|
}).then(pw => {
|
||||||
privateWin = pw;
|
privateWin = pw;
|
||||||
privateTab = BrowserTestUtils.addTab(pw.gBrowser, "http://example.com/");
|
privateTab = pw.gBrowser.addTab("http://example.com/");
|
||||||
return BrowserTestUtils.browserLoaded(privateTab.linkedBrowser);
|
return BrowserTestUtils.browserLoaded(privateTab.linkedBrowser);
|
||||||
}).then(tab => {
|
}).then(tab => {
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ function runPass(getterFile, finishedCallback) {
|
|||||||
|
|
||||||
function afterPrivateWindowOpened() {
|
function afterPrivateWindowOpened() {
|
||||||
// In the private window, open the getter file, and wait for a new tab to be opened.
|
// In the private window, open the getter file, and wait for a new tab to be opened.
|
||||||
privateWin.gBrowser.selectedTab = BrowserTestUtils.addTab(privateWin.gBrowser, rootDir + getterFile);
|
privateWin.gBrowser.selectedTab = privateWin.gBrowser.addTab(rootDir + getterFile);
|
||||||
testBrowser = privateWin.gBrowser.selectedBrowser;
|
testBrowser = privateWin.gBrowser.selectedBrowser;
|
||||||
privateWin.gBrowser.tabContainer.addEventListener("TabOpen", onNewTabOpened, true);
|
privateWin.gBrowser.tabContainer.addEventListener("TabOpen", onNewTabOpened, true);
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ function runPass(getterFile, finishedCallback) {
|
|||||||
|
|
||||||
function afterPrivateWindowOpened2() {
|
function afterPrivateWindowOpened2() {
|
||||||
// In the private window, open the setter file, and wait for it to load.
|
// In the private window, open the setter file, and wait for it to load.
|
||||||
privateWin.gBrowser.selectedTab = BrowserTestUtils.addTab(privateWin.gBrowser, rootDir + "file_bug1108547-1.html");
|
privateWin.gBrowser.selectedTab = privateWin.gBrowser.addTab(rootDir + "file_bug1108547-1.html");
|
||||||
BrowserTestUtils.browserLoaded(privateWin.gBrowser.selectedBrowser).then(afterOpenCookieSetter2);
|
BrowserTestUtils.browserLoaded(privateWin.gBrowser.selectedBrowser).then(afterOpenCookieSetter2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ add_task(async function test2() {
|
|||||||
}, win);
|
}, win);
|
||||||
|
|
||||||
info("creating private tab");
|
info("creating private tab");
|
||||||
win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser);
|
win.gBrowser.selectedTab = win.gBrowser.addTab();
|
||||||
|
|
||||||
info("loading test page: " + testPageURL);
|
info("loading test page: " + testPageURL);
|
||||||
win.gBrowser.selectedBrowser.loadURI(testPageURL);
|
win.gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ add_task(async function test2() {
|
|||||||
let win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
|
let win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
|
||||||
|
|
||||||
info("creating tab");
|
info("creating tab");
|
||||||
win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser);
|
win.gBrowser.selectedTab = win.gBrowser.addTab();
|
||||||
win.gBrowser.selectedBrowser.loadURI(testPageURL);
|
win.gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||||
await waitForMessage("InvalidStateError", win.gBrowser);
|
await waitForMessage("InvalidStateError", win.gBrowser);
|
||||||
win.gBrowser.removeCurrentTab();
|
win.gBrowser.removeCurrentTab();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ add_task(async function testPermissionUnknownInPrivateWindow() {
|
|||||||
}, win);
|
}, win);
|
||||||
|
|
||||||
info("Creating private tab");
|
info("Creating private tab");
|
||||||
win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser);
|
win.gBrowser.selectedTab = win.gBrowser.addTab();
|
||||||
|
|
||||||
info("Loading test page: " + testPageURL);
|
info("Loading test page: " + testPageURL);
|
||||||
win.gBrowser.selectedBrowser.loadURI(testPageURL);
|
win.gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ add_task(async function() {
|
|||||||
|
|
||||||
var URL = "http://mochi.test:8888/browser/dom/tests/browser/page_privatestorageevent.html";
|
var URL = "http://mochi.test:8888/browser/dom/tests/browser/page_privatestorageevent.html";
|
||||||
|
|
||||||
var privTab = BrowserTestUtils.addTab(privWin.gBrowser, URL);
|
var privTab = privWin.gBrowser.addTab(URL);
|
||||||
await BrowserTestUtils.browserLoaded(privWin.gBrowser.getBrowserForTab(privTab));
|
await BrowserTestUtils.browserLoaded(privWin.gBrowser.getBrowserForTab(privTab));
|
||||||
var privBrowser = gBrowser.getBrowserForTab(privTab);
|
var privBrowser = gBrowser.getBrowserForTab(privTab);
|
||||||
|
|
||||||
var pubTab = BrowserTestUtils.addTab(pubWin.gBrowser, URL);
|
var pubTab = pubWin.gBrowser.addTab(URL);
|
||||||
await BrowserTestUtils.browserLoaded(pubWin.gBrowser.getBrowserForTab(pubTab));
|
await BrowserTestUtils.browserLoaded(pubWin.gBrowser.getBrowserForTab(pubTab));
|
||||||
var pubBrowser = gBrowser.getBrowserForTab(pubTab);
|
var pubBrowser = gBrowser.getBrowserForTab(pubTab);
|
||||||
|
|
||||||
|
|||||||
@@ -420,8 +420,7 @@ async function largeAllocSuccessTests() {
|
|||||||
|
|
||||||
let newWindow = await BrowserTestUtils.openNewBrowserWindow();
|
let newWindow = await BrowserTestUtils.openNewBrowserWindow();
|
||||||
|
|
||||||
newWindow.gBrowser.adoptTab(gBrowser.getTabForBrowser(aBrowser), 0, null,
|
newWindow.gBrowser.adoptTab(gBrowser.getTabForBrowser(aBrowser), 0);
|
||||||
Services.scriptSecurityManager.getSystemPrincipal());
|
|
||||||
let newTab = newWindow.gBrowser.tabs[0];
|
let newTab = newWindow.gBrowser.tabs[0];
|
||||||
|
|
||||||
is(newTab.linkedBrowser.currentURI.spec, TEST_URI);
|
is(newTab.linkedBrowser.currentURI.spec, TEST_URI);
|
||||||
|
|||||||
@@ -1187,8 +1187,6 @@ var BrowserApp = {
|
|||||||
if ("userRequested" in aParams) tab.userRequested = aParams.userRequested;
|
if ("userRequested" in aParams) tab.userRequested = aParams.userRequested;
|
||||||
tab.isSearch = ("isSearch" in aParams) ? aParams.isSearch : false;
|
tab.isSearch = ("isSearch" in aParams) ? aParams.isSearch : false;
|
||||||
}
|
}
|
||||||
// Don't fall back to System here Bug 1474619
|
|
||||||
let triggeringPrincipal = "triggeringPrincipal" in aParams ? aParams.triggeringPrincipal : Services.scriptSecurityManager.getSystemPrincipal();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
aBrowser.loadURI(aURI, {
|
aBrowser.loadURI(aURI, {
|
||||||
@@ -1196,7 +1194,6 @@ var BrowserApp = {
|
|||||||
referrerURI,
|
referrerURI,
|
||||||
charset,
|
charset,
|
||||||
postData,
|
postData,
|
||||||
triggeringPrincipal,
|
|
||||||
});
|
});
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
if (tab) {
|
if (tab) {
|
||||||
|
|||||||
@@ -247,7 +247,6 @@ this.tabs = class extends ExtensionAPI {
|
|||||||
}).api(),
|
}).api(),
|
||||||
|
|
||||||
async create(createProperties) {
|
async create(createProperties) {
|
||||||
let principal = context.principal;
|
|
||||||
let window = createProperties.windowId !== null ?
|
let window = createProperties.windowId !== null ?
|
||||||
windowTracker.getWindow(createProperties.windowId, context) :
|
windowTracker.getWindow(createProperties.windowId, context) :
|
||||||
windowTracker.topWindow;
|
windowTracker.topWindow;
|
||||||
@@ -261,9 +260,6 @@ this.tabs = class extends ExtensionAPI {
|
|||||||
if (!context.checkLoadURL(url, {dontReportErrors: true})) {
|
if (!context.checkLoadURL(url, {dontReportErrors: true})) {
|
||||||
return Promise.reject({message: `Illegal URL: ${url}`});
|
return Promise.reject({message: `Illegal URL: ${url}`});
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Falling back to system here as about:newtab requires it, however is safe.
|
|
||||||
principal = Services.scriptSecurityManager.getSystemPrincipal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let options = {};
|
let options = {};
|
||||||
@@ -289,7 +285,6 @@ this.tabs = class extends ExtensionAPI {
|
|||||||
options.parentId = BrowserApp.selectedTab.id;
|
options.parentId = BrowserApp.selectedTab.id;
|
||||||
|
|
||||||
tabListener.initTabReady();
|
tabListener.initTabReady();
|
||||||
options.triggeringPrincipal = principal;
|
|
||||||
let nativeTab = BrowserApp.addTab(url, options);
|
let nativeTab = BrowserApp.addTab(url, options);
|
||||||
|
|
||||||
if (createProperties.url) {
|
if (createProperties.url) {
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ var BrowserTestUtils = {
|
|||||||
opening();
|
opening();
|
||||||
tab = tabbrowser.selectedTab;
|
tab = tabbrowser.selectedTab;
|
||||||
} else {
|
} else {
|
||||||
tabbrowser.selectedTab = tab = BrowserTestUtils.addTab(tabbrowser, opening);
|
tabbrowser.selectedTab = tab = tabbrowser.addTab(opening);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -95,8 +95,7 @@ function loadMochitest(e) {
|
|||||||
win.removeEventListener("mochitest-load", loadMochitest);
|
win.removeEventListener("mochitest-load", loadMochitest);
|
||||||
|
|
||||||
// for mochitest-plain, navigating to the url is all we need
|
// for mochitest-plain, navigating to the url is all we need
|
||||||
win.loadURI(url, null, null, null, null, null, null, null,
|
win.loadURI(url);
|
||||||
Services.scriptSecurityManager.getSystemPrincipal());
|
|
||||||
if (flavor == "mochitest") {
|
if (flavor == "mochitest") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -576,10 +576,7 @@ Tester.prototype = {
|
|||||||
|
|
||||||
// Replace the last tab with a fresh one
|
// Replace the last tab with a fresh one
|
||||||
if (window.gBrowser) {
|
if (window.gBrowser) {
|
||||||
gBrowser.addTab("about:blank", {
|
gBrowser.addTab("about:blank", { skipAnimation: true });
|
||||||
skipAnimation: true,
|
|
||||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
|
||||||
});
|
|
||||||
gBrowser.removeTab(gBrowser.selectedTab, { skipPermitUnload: true });
|
gBrowser.removeTab(gBrowser.selectedTab, { skipPermitUnload: true });
|
||||||
gBrowser.stop();
|
gBrowser.stop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ add_task(async function test_support_tab_separators() {
|
|||||||
|
|
||||||
info("Checking background tab separator color");
|
info("Checking background tab separator color");
|
||||||
|
|
||||||
let tab = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
let tab = gBrowser.addTab("about:blank");
|
||||||
|
|
||||||
Assert.equal(window.getComputedStyle(tab, "::before").borderLeftColor,
|
Assert.equal(window.getComputedStyle(tab, "::before").borderLeftColor,
|
||||||
`rgb(${hexToRGB(TAB_SEPARATOR_COLOR).join(", ")})`,
|
`rgb(${hexToRGB(TAB_SEPARATOR_COLOR).join(", ")})`,
|
||||||
|
|||||||
@@ -346,10 +346,7 @@ var Heartbeat = class {
|
|||||||
this.options.postAnswerUrl.searchParams.append(key, engagementParams[key]);
|
this.options.postAnswerUrl.searchParams.append(key, engagementParams[key]);
|
||||||
}
|
}
|
||||||
// Open the engagement URL in a new tab.
|
// Open the engagement URL in a new tab.
|
||||||
let { gBrowser} = this.chromeWindow;
|
this.chromeWindow.gBrowser.selectedTab = this.chromeWindow.gBrowser.addTab(this.options.postAnswerUrl.toString());
|
||||||
gBrowser.selectedTab = gBrowser.addWebTab(this.options.postAnswerUrl.toString(), {
|
|
||||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.endTimerIfPresent("surveyEndTimer");
|
this.endTimerIfPresent("surveyEndTimer");
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ add_task(async function setup_test_preference() {
|
|||||||
|
|
||||||
add_task(async function block_autoplay_media() {
|
add_task(async function block_autoplay_media() {
|
||||||
info("- open new background tab1 -");
|
info("- open new background tab1 -");
|
||||||
let tab1 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab1 = window.gBrowser.addTab("about:blank");
|
||||||
tab1.linkedBrowser.loadURI(PAGE);
|
tab1.linkedBrowser.loadURI(PAGE);
|
||||||
await BrowserTestUtils.browserLoaded(tab1.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab1.linkedBrowser);
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ add_task(async function block_autoplay_media() {
|
|||||||
await check_audio_suspended(tab1.linkedBrowser, SuspendedType.SUSPENDED_BLOCK);
|
await check_audio_suspended(tab1.linkedBrowser, SuspendedType.SUSPENDED_BLOCK);
|
||||||
|
|
||||||
info("- open new background tab2 -");
|
info("- open new background tab2 -");
|
||||||
let tab2 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab2 = window.gBrowser.addTab("about:blank");
|
||||||
tab2.linkedBrowser.loadURI(PAGE);
|
tab2.linkedBrowser.loadURI(PAGE);
|
||||||
await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ add_task(async function block_autoplay_media() {
|
|||||||
]});
|
]});
|
||||||
|
|
||||||
info("- open new background tab4 -");
|
info("- open new background tab4 -");
|
||||||
let tab4 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab4 = window.gBrowser.addTab("about:blank");
|
||||||
tab4.linkedBrowser.loadURI(PAGE);
|
tab4.linkedBrowser.loadURI(PAGE);
|
||||||
await BrowserTestUtils.browserLoaded(tab4.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab4.linkedBrowser);
|
||||||
info("- should block autoplay for non-visited tab4 -");
|
info("- should block autoplay for non-visited tab4 -");
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ add_task(async function setup_test_preference() {
|
|||||||
|
|
||||||
add_task(async function block_autoplay_media() {
|
add_task(async function block_autoplay_media() {
|
||||||
info("- open new background tab1, and check tab1's media suspend type -");
|
info("- open new background tab1, and check tab1's media suspend type -");
|
||||||
let tab1 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab1 = window.gBrowser.addTab("about:blank");
|
||||||
tab1.linkedBrowser.loadURI(PAGE_SHOULD_NOT_PLAY);
|
tab1.linkedBrowser.loadURI(PAGE_SHOULD_NOT_PLAY);
|
||||||
await BrowserTestUtils.browserLoaded(tab1.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab1.linkedBrowser);
|
||||||
await ContentTask.spawn(tab1.linkedBrowser, SuspendedType.NONE_SUSPENDED,
|
await ContentTask.spawn(tab1.linkedBrowser, SuspendedType.NONE_SUSPENDED,
|
||||||
@@ -47,7 +47,7 @@ add_task(async function block_autoplay_media() {
|
|||||||
await waitForTabBlockEvent(tab1, false);
|
await waitForTabBlockEvent(tab1, false);
|
||||||
|
|
||||||
info("- open new background tab2, and check tab2's media suspend type -");
|
info("- open new background tab2, and check tab2's media suspend type -");
|
||||||
let tab2 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab2 = window.gBrowser.addTab("about:blank");
|
||||||
tab2.linkedBrowser.loadURI(PAGE_SHOULD_PLAY);
|
tab2.linkedBrowser.loadURI(PAGE_SHOULD_PLAY);
|
||||||
await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
|
||||||
await ContentTask.spawn(tab2.linkedBrowser, SuspendedType.SUSPENDED_BLOCK,
|
await ContentTask.spawn(tab2.linkedBrowser, SuspendedType.SUSPENDED_BLOCK,
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ add_task(async function setup_test_preference() {
|
|||||||
*/
|
*/
|
||||||
add_task(async function media_should_be_able_to_play_in_visible_tab() {
|
add_task(async function media_should_be_able_to_play_in_visible_tab() {
|
||||||
info("- open new background tab, and check tab's media pause state -");
|
info("- open new background tab, and check tab's media pause state -");
|
||||||
let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab = window.gBrowser.addTab("about:blank");
|
||||||
tab.linkedBrowser.loadURI(PAGE);
|
tab.linkedBrowser.loadURI(PAGE);
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
await ContentTask.spawn(tab.linkedBrowser, true,
|
await ContentTask.spawn(tab.linkedBrowser, true,
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ add_task(async function setup_test_preference() {
|
|||||||
|
|
||||||
add_task(async function block_multiple_media() {
|
add_task(async function block_multiple_media() {
|
||||||
info("- open new background tab -");
|
info("- open new background tab -");
|
||||||
let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab = window.gBrowser.addTab("about:blank");
|
||||||
let browser = tab.linkedBrowser;
|
let browser = tab.linkedBrowser;
|
||||||
browser.loadURI(PAGE);
|
browser.loadURI(PAGE);
|
||||||
await BrowserTestUtils.browserLoaded(browser);
|
await BrowserTestUtils.browserLoaded(browser);
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ add_task(async function setup_test_preference() {
|
|||||||
|
|
||||||
add_task(async function block_not_in_tree_media() {
|
add_task(async function block_not_in_tree_media() {
|
||||||
info("- open new background tab -");
|
info("- open new background tab -");
|
||||||
let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab = window.gBrowser.addTab("about:blank");
|
||||||
tab.linkedBrowser.loadURI(PAGE);
|
tab.linkedBrowser.loadURI(PAGE);
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ add_task(async function setup_test_preference() {
|
|||||||
|
|
||||||
add_task(async function unblock_icon_should_disapear_after_resume_tab() {
|
add_task(async function unblock_icon_should_disapear_after_resume_tab() {
|
||||||
info("- open new background tab -");
|
info("- open new background tab -");
|
||||||
let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab = window.gBrowser.addTab("about:blank");
|
||||||
tab.linkedBrowser.loadURI(PAGE);
|
tab.linkedBrowser.loadURI(PAGE);
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ add_task(async function setup_test_preference() {
|
|||||||
|
|
||||||
add_task(async function block_plug_in() {
|
add_task(async function block_plug_in() {
|
||||||
info("- open new background tab -");
|
info("- open new background tab -");
|
||||||
let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab = window.gBrowser.addTab("about:blank");
|
||||||
tab.linkedBrowser.loadURI(PAGE);
|
tab.linkedBrowser.loadURI(PAGE);
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ add_task(async function setup_test_preference() {
|
|||||||
|
|
||||||
add_task(async function unblock_icon_should_disapear_after_resume_tab() {
|
add_task(async function unblock_icon_should_disapear_after_resume_tab() {
|
||||||
info("- open new background tab -");
|
info("- open new background tab -");
|
||||||
let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab = window.gBrowser.addTab("about:blank");
|
||||||
tab.linkedBrowser.loadURI(PAGE);
|
tab.linkedBrowser.loadURI(PAGE);
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ add_task(async function unblock_icon_should_disapear_after_resume_tab() {
|
|||||||
|
|
||||||
add_task(async function should_not_show_sound_indicator_after_resume_tab() {
|
add_task(async function should_not_show_sound_indicator_after_resume_tab() {
|
||||||
info("- open new background tab -");
|
info("- open new background tab -");
|
||||||
let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab = window.gBrowser.addTab("about:blank");
|
||||||
tab.linkedBrowser.loadURI(PAGE);
|
tab.linkedBrowser.loadURI(PAGE);
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ add_task(async function setup_test_preference() {
|
|||||||
|
|
||||||
add_task(async function block_web_audio() {
|
add_task(async function block_web_audio() {
|
||||||
info("- open new background tab -");
|
info("- open new background tab -");
|
||||||
let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab = window.gBrowser.addTab("about:blank");
|
||||||
tab.linkedBrowser.loadURI(PAGE);
|
tab.linkedBrowser.loadURI(PAGE);
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ add_task(async function setup_test_preference() {
|
|||||||
*/
|
*/
|
||||||
add_task(async function resume_and_suspend_background_video_decoding() {
|
add_task(async function resume_and_suspend_background_video_decoding() {
|
||||||
info("- open new background tab -");
|
info("- open new background tab -");
|
||||||
let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
|
let tab = window.gBrowser.addTab("about:blank");
|
||||||
let browser = tab.linkedBrowser;
|
let browser = tab.linkedBrowser;
|
||||||
|
|
||||||
info("- before loading media, we shoudn't send the tab hover msg for tab -");
|
info("- before loading media, we shoudn't send the tab hover msg for tab -");
|
||||||
|
|||||||
Reference in New Issue
Block a user