Bug 963945 - Add about:addons URI as whitelisted so that it can be refocused instead of opening duplicate tabs in private browsing. r=jdm

This commit is contained in:
Michael Lopez 2014-12-16 21:45:00 -05:00
parent c49d96cb02
commit 209ecfe36b
3 changed files with 32 additions and 0 deletions

View File

@ -7476,6 +7476,7 @@ function switchToTabHavingURI(aURI, aOpenNew, aOpenParams={}) {
// Certain URLs can be switched to irrespective of the source or destination
// window being in private browsing mode:
const kPrivateBrowsingWhitelist = new Set([
"about:addons",
"about:customizing",
]);

View File

@ -486,3 +486,4 @@ skip-if = e10s # bug 1100687 - test directly manipulates content (content.docume
[browser_mcb_redirect.js]
skip-if = e10s # bug 1084504 - [e10s] Mixed content detection does not take redirection into account
[browser_windowactivation.js]
[browser_bug963945.js]

View File

@ -0,0 +1,30 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* This test ensures the about:addons tab is only
* opened one time when in private browsing.
*/
function test() {
waitForExplicitFinish();
var win = OpenBrowserWindow({private: true});
whenDelayedStartupFinished(win, function() {
win.gBrowser.loadURI("about:addons");
waitForFocus(function() {
EventUtils.synthesizeKey("a", { ctrlKey: true, shiftKey: true }, win);
is(win.gBrowser.tabs.length, 1, "about:addons tab was re-focused.");
is(win.gBrowser.currentURI.spec, "about:addons", "Addons tab was opened.");
win.close();
finish();
});
});
}