Bug 1349723 - remove tests for about:addons UI in standalone window. r=aswan

MozReview-Commit-ID: GSz3OdDbFn3

--HG--
extra : rebase_source : db68f7600d35d88e9371c1752eeaf682a8387275
This commit is contained in:
Robert Helmer 2017-05-08 15:57:42 -07:00
Родитель 10b3bba051
Коммит 7f9c494c09
10 изменённых файлов: 99 добавлений и 334 удалений

Просмотреть файл

@ -1,52 +0,0 @@
[DEFAULT]
install-to-subdir = test-window
support-files =
addons/*
addon_about.xul
addon_prefs.xul
cancelCompatCheck.sjs
discovery.html
discovery_frame.html
discovery_install.html
head.js
signed_hotfix.rdf
signed_hotfix.xpi
unsigned_hotfix.rdf
unsigned_hotfix.xpi
more_options.xul
options.xul
plugin_test.html
redirect.sjs
releaseNotes.xhtml
blockNoPlugins.xml
blockPluginHard.xml
browser_bug557956.rdf
browser_bug557956_8_2.xpi
browser_bug557956_9_2.xpi
browser_bug557956.xml
browser_bug591465.xml
browser_bug593535.xml
browser_searching.xml
browser_searching_empty.xml
browser_updatessl.rdf
browser_updatessl.rdf^headers^
browser_install.rdf
browser_install.rdf^headers^
browser_install.xml
browser_install1_3.xpi
browser_eula.xml
browser_purchase.xml
webapi_addon_listener.html
webapi_checkavailable.html
webapi_checkchromeframe.xul
webapi_checkframed.html
webapi_checknavigatedwindow.html
!/toolkit/mozapps/extensions/test/xpinstall/corrupt.xpi
!/toolkit/mozapps/extensions/test/xpinstall/incompatible.xpi
!/toolkit/mozapps/extensions/test/xpinstall/installtrigger.html
!/toolkit/mozapps/extensions/test/xpinstall/restartless.xpi
!/toolkit/mozapps/extensions/test/xpinstall/theme.xpi
!/toolkit/mozapps/extensions/test/xpinstall/unsigned.xpi
!/toolkit/mozapps/extensions/test/xpinstall/amosigned.xpi
[include:browser-common.ini]

Просмотреть файл

@ -89,44 +89,25 @@ function end_test() {
finish();
}
function go_back(aManager) {
if (gUseInContentUI) {
gBrowser.goBack();
} else {
EventUtils.synthesizeMouseAtCenter(aManager.document.getElementById("back-btn"),
{ }, aManager);
}
function go_back() {
gBrowser.goBack();
}
function go_back_backspace(aManager) {
function go_back_backspace() {
EventUtils.synthesizeKey("VK_BACK_SPACE", {});
}
function go_forward_backspace(aManager) {
function go_forward_backspace() {
EventUtils.synthesizeKey("VK_BACK_SPACE", {shiftKey: true});
}
function go_forward(aManager) {
if (gUseInContentUI) {
gBrowser.goForward();
} else {
EventUtils.synthesizeMouseAtCenter(aManager.document.getElementById("forward-btn"),
{ }, aManager);
}
function go_forward() {
gBrowser.goForward();
}
function check_state(aManager, canGoBack, canGoForward) {
var doc = aManager.document;
if (gUseInContentUI) {
is(gBrowser.canGoBack, canGoBack, "canGoBack should be correct");
is(gBrowser.canGoForward, canGoForward, "canGoForward should be correct");
}
if (!is_hidden(doc.getElementById("back-btn"))) {
is(!doc.getElementById("back-btn").disabled, canGoBack, "Back button should have the right state");
is(!doc.getElementById("forward-btn").disabled, canGoForward, "Forward button should have the right state");
}
function check_state(canGoBack, canGoForward) {
is(gBrowser.canGoBack, canGoBack, "canGoBack should be correct");
is(gBrowser.canGoForward, canGoForward, "canGoForward should be correct");
}
function is_in_list(aManager, view, canGoBack, canGoForward) {
@ -135,7 +116,7 @@ function is_in_list(aManager, view, canGoBack, canGoForward) {
is(doc.getElementById("categories").selectedItem.value, view, "Should be on the right category");
is(get_current_view(aManager).id, "list-view", "Should be on the right view");
check_state(aManager, canGoBack, canGoForward);
check_state(canGoBack, canGoForward);
}
function is_in_search(aManager, query, canGoBack, canGoForward) {
@ -145,7 +126,7 @@ function is_in_search(aManager, query, canGoBack, canGoForward) {
is(get_current_view(aManager).id, "search-view", "Should be on the right view");
is(doc.getElementById("header-search").value, query, "Should have used the right query");
check_state(aManager, canGoBack, canGoForward);
check_state(canGoBack, canGoForward);
}
function is_in_detail(aManager, view, canGoBack, canGoForward) {
@ -154,7 +135,7 @@ function is_in_detail(aManager, view, canGoBack, canGoForward) {
is(doc.getElementById("categories").selectedItem.value, view, "Should be on the right category");
is(get_current_view(aManager).id, "detail-view", "Should be on the right view");
check_state(aManager, canGoBack, canGoForward);
check_state(canGoBack, canGoForward);
}
function is_in_discovery(aManager, url, canGoBack, canGoForward) {
@ -170,7 +151,7 @@ function is_in_discovery(aManager, url, canGoBack, canGoForward) {
is(spec, url, "Should have loaded the right url");
check_state(aManager, canGoBack, canGoForward);
check_state(canGoBack, canGoForward);
}
function double_click_addon_element(aManager, aId) {
@ -193,19 +174,19 @@ add_test(function() {
info("Part 2");
is_in_list(aManager, "addons://list/plugin", true, false);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
info("Part 3");
is_in_list(aManager, "addons://list/extension", false, true);
go_forward(aManager);
go_forward();
wait_for_view_load(aManager, function(aManager) {
info("Part 4");
is_in_list(aManager, "addons://list/plugin", true, false);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
info("Part 5");
@ -217,7 +198,7 @@ add_test(function() {
info("Part 6");
is_in_detail(aManager, "addons://list/extension", true, false);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
info("Part 7");
@ -234,12 +215,7 @@ add_test(function() {
});
// Tests that browsing to the add-ons manager from a website and going back works
// Only relevant for in-content UI
add_test(function() {
if (!gUseInContentUI) {
run_next_test();
return;
}
function promiseManagerLoaded(manager) {
return new Promise(resolve => {
@ -298,7 +274,7 @@ add_test(function() {
// loaded in a tab
add_test(function() {
if (!gUseInContentUI || (Services.prefs.getIntPref("browser.backspace_action") != 0)) {
if (Services.prefs.getIntPref("browser.backspace_action") != 0) {
run_next_test();
return;
}
@ -313,19 +289,19 @@ add_test(function() {
info("Part 2");
is_in_list(aManager, "addons://list/plugin", true, false);
go_back_backspace(aManager);
go_back_backspace();
wait_for_view_load(aManager, function(aManager) {
info("Part 3");
is_in_list(aManager, "addons://list/extension", false, true);
go_forward_backspace(aManager);
go_forward_backspace();
wait_for_view_load(aManager, function(aManager) {
info("Part 4");
is_in_list(aManager, "addons://list/plugin", true, false);
go_back_backspace(aManager);
go_back_backspace();
wait_for_view_load(aManager, function(aManager) {
info("Part 5");
@ -337,7 +313,7 @@ add_test(function() {
info("Part 6");
is_in_detail(aManager, "addons://list/extension", true, false);
go_back_backspace(aManager);
go_back_backspace();
wait_for_view_load(aManager, function(aManager) {
info("Part 7");
@ -366,7 +342,7 @@ add_test(function() {
info("Part 2");
is_in_list(aManager, "addons://list/extension", true, false);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
info("Part 3");
@ -392,13 +368,13 @@ add_test(function() {
info("Part 2");
is_in_list(aManager, "addons://list/plugin", true, false);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
info("Part 3");
is_in_list(aManager, "addons://list/extension", false, true);
go_forward(aManager);
go_forward();
wait_for_view_load(aManager, function(aManager) {
info("Part 4");
@ -413,12 +389,7 @@ add_test(function() {
// Tests than navigating to a website and then going back returns to the
// previous view
// Only relevant for in-content UI
add_test(function() {
if (!gUseInContentUI) {
run_next_test();
return;
}
open_manager("addons://list/plugin", function(aManager) {
info("Part 1");
@ -435,7 +406,7 @@ add_test(function() {
ok(gBrowser.canGoBack, "Should be able to go back");
ok(!gBrowser.canGoForward, "Should not be able to go forward");
go_back(aManager);
go_back();
gBrowser.addEventListener("pageshow", function(event) {
if (event.target.location != "about:addons")
@ -446,7 +417,7 @@ add_test(function() {
info("Part 3");
is_in_list(aManager, "addons://list/plugin", false, true);
executeSoon(() => go_forward(aManager));
executeSoon(() => go_forward());
gBrowser.addEventListener("pageshow", function(event) {
if (event.target.location != "http://example.com/")
return;
@ -457,7 +428,7 @@ add_test(function() {
ok(gBrowser.canGoBack, "Should be able to go back");
ok(!gBrowser.canGoForward, "Should not be able to go forward");
go_back(aManager);
go_back();
gBrowser.addEventListener("pageshow", function(event) {
if (event.target.location != "about:addons")
@ -514,6 +485,8 @@ add_test(function() {
info("Part 2");
is_in_search(aManager, "bar", true, false);
// force layout flush
aManager.document.documentElement.clientTop;
check_all_in_list(aManager, ["test2@tests.mozilla.org", "test3@tests.mozilla.org"]);
double_click_addon_element(aManager, "test2@tests.mozilla.org");
@ -522,13 +495,13 @@ add_test(function() {
info("Part 3");
is_in_detail(aManager, "addons://search/", true, false);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
info("Part 4");
is_in_search(aManager, "bar", true, true);
check_all_in_list(aManager, ["test2@tests.mozilla.org", "test3@tests.mozilla.org"]);
go_forward(aManager);
go_forward();
wait_for_view_load(aManager, function(aManager) {
info("Part 5");
is_in_detail(aManager, "addons://search/", true, false);
@ -543,12 +516,7 @@ add_test(function() {
// Tests that going back from a webpage to a detail view loaded from a search
// result works
// Only relevant for in-content UI
add_test(function() {
if (!gUseInContentUI) {
run_next_test();
return;
}
open_manager("addons://list/extension", function(aManager) {
info("Part 1");
@ -581,7 +549,7 @@ add_test(function() {
ok(gBrowser.canGoBack, "Should be able to go back");
ok(!gBrowser.canGoForward, "Should not be able to go forward");
go_back(aManager);
go_back();
gBrowser.addEventListener("pageshow", function(event) {
if (event.target.location != "about:addons")
return;
@ -591,7 +559,7 @@ add_test(function() {
info("Part 5");
is_in_detail(aManager, "addons://search/", true, true);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
info("Part 6");
is_in_search(aManager, "bar", true, true);
@ -609,12 +577,7 @@ add_test(function() {
});
// Tests that refreshing a list view does not affect the history
// Only relevant for in-content UI
add_test(function() {
if (!gUseInContentUI) {
run_next_test();
return;
}
open_manager("addons://list/extension", function(aManager) {
info("Part 1");
@ -636,7 +599,7 @@ add_test(function() {
info("Part 3");
is_in_list(aManager, "addons://list/plugin", true, false);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
info("Part 4");
is_in_list(aManager, "addons://list/extension", false, true);
@ -650,12 +613,7 @@ add_test(function() {
});
// Tests that refreshing a detail view does not affect the history
// Only relevant for in-content UI
add_test(function() {
if (!gUseInContentUI) {
run_next_test();
return;
}
open_manager(null, function(aManager) {
info("Part 1");
@ -677,7 +635,7 @@ add_test(function() {
info("Part 3");
is_in_detail(aManager, "addons://list/extension", true, false);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
info("Part 4");
is_in_list(aManager, "addons://list/extension", false, true);
@ -707,13 +665,9 @@ add_test(function() {
{ }, aManager);
wait_for_view_load(aManager, function() {
if (gUseInContentUI) {
// TODO until bug 590661 is fixed the back button will be enabled
// when displaying in content
is_in_list(aManager, "addons://list/extension", true, false);
} else {
is_in_list(aManager, "addons://list/extension", false, false);
}
// TODO until bug 590661 is fixed the back button will be enabled
// when displaying in content
is_in_list(aManager, "addons://list/extension", true, false);
close_manager(aManager, run_next_test);
});
@ -721,29 +675,6 @@ add_test(function() {
});
});
// Tests that the back and forward buttons only show up for windowed mode
add_test(function() {
open_manager(null, function(aManager) {
var doc = aManager.document;
if (gUseInContentUI) {
var btn = document.getElementById("back-button");
if (!btn || is_hidden(btn)) {
is_element_visible(doc.getElementById("back-btn"), "Back button should not be hidden");
is_element_visible(doc.getElementById("forward-btn"), "Forward button should not be hidden");
} else {
is_element_hidden(doc.getElementById("back-btn"), "Back button should be hidden");
is_element_hidden(doc.getElementById("forward-btn"), "Forward button should be hidden");
}
} else {
is_element_visible(doc.getElementById("back-btn"), "Back button should not be hidden");
is_element_visible(doc.getElementById("forward-btn"), "Forward button should not be hidden");
}
close_manager(aManager, run_next_test);
});
});
// Tests that opening the manager opens the last view
add_test(function() {
open_manager("addons://list/plugin", function(aManager) {
@ -783,12 +714,12 @@ add_test(function() {
wait_for_view_load(aManager, function(aManager) {
is_in_list(aManager, "addons://list/plugin", true, false);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
is_in_discovery(aManager, SECOND_URL, true, true);
go_back(aManager);
go_back();
waitForLoad(aManager, function() {
is_in_discovery(aManager, MAIN_URL, false, true);
@ -799,10 +730,10 @@ add_test(function() {
});
});
go_forward(aManager);
go_forward();
});
go_back(aManager);
go_back();
});
});
});
@ -831,22 +762,22 @@ add_test(function() {
wait_for_view_load(aManager, function(aManager) {
is_in_list(aManager, "addons://list/plugin", true, false);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
is_in_discovery(aManager, SECOND_URL, true, true);
go_back(aManager);
go_back();
waitForLoad(aManager, function() {
is_in_discovery(aManager, MAIN_URL, true, true);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
is_in_list(aManager, "addons://list/plugin", false, true);
go_forward(aManager);
go_forward();
wait_for_view_load(aManager, function(aManager) {
is_in_discovery(aManager, MAIN_URL, true, true);
@ -857,7 +788,7 @@ add_test(function() {
close_manager(aManager, run_next_test);
});
go_forward(aManager);
go_forward();
});
});
});
@ -865,10 +796,10 @@ add_test(function() {
});
});
go_forward(aManager);
go_forward();
});
go_back(aManager);
go_back();
});
});
});
@ -877,10 +808,6 @@ add_test(function() {
// Tests that when displaying in-content and opened in the background the back
// and forward buttons still appear when switching tabs
add_test(function() {
if (!gUseInContentUI) {
run_next_test();
return;
}
var tab = gBrowser.addTab("about:addons");
var browser = gBrowser.getBrowserForTab(tab);
@ -928,22 +855,22 @@ add_test(function() {
waitForLoad(aManager, function() {
is_in_discovery(aManager, MAIN_URL, true, false);
go_back(aManager);
go_back();
waitForLoad(aManager, function() {
is_in_discovery(aManager, SECOND_URL, true, true);
go_back(aManager);
go_back();
waitForLoad(aManager, function() {
is_in_discovery(aManager, MAIN_URL, true, true);
go_back(aManager);
go_back();
wait_for_view_load(aManager, function(aManager) {
is_in_list(aManager, "addons://list/plugin", false, true);
go_forward(aManager);
go_forward();
wait_for_view_load(aManager, function(aManager) {
is_in_discovery(aManager, MAIN_URL, true, true);
@ -956,10 +883,10 @@ add_test(function() {
close_manager(aManager, run_next_test);
});
go_forward(aManager);
go_forward();
});
go_forward(aManager);
go_forward();
});
});
});

Просмотреть файл

@ -17,10 +17,7 @@ function checkInstallConfirmation(...urls) {
let observer = {
observe(aSubject, aTopic, aData) {
var installInfo = aSubject.wrappedJSObject;
if (gTestInWindow)
is(installInfo.browser, null, "Notification should have a null browser");
else
isnot(installInfo.browser, null, "Notification should have non-null browser");
isnot(installInfo.browser, null, "Notification should have non-null browser");
notificationCount++;
}
};

Просмотреть файл

@ -23,10 +23,7 @@ function checkInstallConfirmation(...urls) {
let observer = {
observe(aSubject, aTopic, aData) {
var installInfo = aSubject.wrappedJSObject;
if (gTestInWindow)
is(installInfo.browser, null, "Notification should have a null browser");
else
isnot(installInfo.browser, null, "Notification should have non-null browser");
isnot(installInfo.browser, null, "Notification should have non-null browser");
notificationCount++;
}
};

Просмотреть файл

@ -150,13 +150,6 @@ add_task(function* testExperimentLearnMore() {
yield gCategoryUtilities.openType("experiment");
let btn = gManagerWindow.document.getElementById("experiments-learn-more");
if (!gUseInContentUI) {
is_element_hidden(btn, "Learn more button hidden if not using in-content UI.");
Services.prefs.clearUserPref("toolkit.telemetry.infoURL");
return;
}
is_element_visible(btn, "Learn more button visible.");
let deferred = Promise.defer();
@ -183,11 +176,6 @@ add_task(function* testExperimentLearnMore() {
add_task(function* testOpenPreferences() {
yield gCategoryUtilities.openType("experiment");
let btn = gManagerWindow.document.getElementById("experiments-change-telemetry");
if (!gUseInContentUI) {
is_element_hidden(btn, "Change telemetry button not enabled in out of window UI.");
info("Skipping preferences open test because not using in-content UI.");
return;
}
is_element_visible(btn, "Change telemetry button visible in in-content UI.");

Просмотреть файл

@ -145,12 +145,8 @@ add_test(function() {
gBrowser.removeCurrentTab();
if (gUseInContentUI) {
is(gBrowser.currentURI.spec, "about:addons", "Should be back to the add-ons manager");
run_next_test();
} else {
waitForFocus(run_next_test, gManagerWindow);
}
is(gBrowser.currentURI.spec, "about:addons", "Should be back to the add-ons manager");
run_next_test();
});
}, {capture: true, once: true});
@ -169,12 +165,8 @@ add_test(function() {
gBrowser.removeCurrentTab();
if (gUseInContentUI) {
is(gBrowser.currentURI.spec, "about:addons", "Should be back to the add-ons manager");
run_next_test();
} else {
waitForFocus(run_next_test, gManagerWindow);
}
is(gBrowser.currentURI.spec, "about:addons", "Should be back to the add-ons manager");
run_next_test();
});
}, {capture: true, once: true});

Просмотреть файл

@ -41,57 +41,12 @@ add_test(function() {
var button = gManagerWindow.document.getAnonymousElementByAttribute(addon, "anonid", "preferences-btn");
is_element_visible(button, "Preferences button should be visible");
if (gUseInContentUI) {
EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
var browser = gBrowser.selectedBrowser;
browser.addEventListener("DOMContentLoaded", function() {
is(browser.currentURI.spec, addon.mAddon.optionsURL, "New tab should have loaded the options URL");
browser.contentWindow.close();
run_next_test();
}, {once: true});
return;
}
let instantApply = Services.prefs.getBoolPref("browser.preferences.instantApply");
function observer(aSubject, aTopic, aData) {
switch (aTopic) {
case "domwindowclosed":
// Give the preference window a chance to finish closing before
// closing the add-ons manager.
waitForFocus(function() {
Services.ww.unregisterNotification(observer);
run_next_test();
});
break;
case "domwindowopened":
let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
waitForFocus(function() {
// If the openDialog privileges are wrong a new browser window
// will open, let the test proceed (and fail) rather than timeout.
if (win.location != addon.mAddon.optionsURL &&
win.location != "chrome://browser/content/browser.xul")
return;
is(win.location, addon.mAddon.optionsURL,
"The correct addon pref window should have opened");
let chromeFlags = win.QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIWebNavigation).
QueryInterface(Ci.nsIDocShellTreeItem).treeOwner.
QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIXULWindow).chromeFlags;
ok(chromeFlags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_CHROME &&
(instantApply || chromeFlags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_DIALOG),
"Window was open as a chrome dialog.");
win.close();
}, win);
break;
}
}
Services.ww.registerNotification(observer);
EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
var browser = gBrowser.selectedBrowser;
browser.addEventListener("DOMContentLoaded", function() {
is(browser.currentURI.spec, addon.mAddon.optionsURL, "New tab should have loaded the options URL");
browser.contentWindow.close();
run_next_test();
}, {once: true});
});

Просмотреть файл

@ -26,35 +26,16 @@ var gTypes = [
];
function go_back(aManager) {
if (gUseInContentUI) {
gBrowser.goBack();
} else {
EventUtils.synthesizeMouseAtCenter(aManager.document.getElementById("back-btn"),
{ }, aManager);
}
gBrowser.goBack();
}
function go_forward(aManager) {
if (gUseInContentUI) {
gBrowser.goForward();
} else {
EventUtils.synthesizeMouseAtCenter(aManager.document.getElementById("forward-btn"),
{ }, aManager);
}
gBrowser.goForward();
}
function check_state(aManager, canGoBack, canGoForward) {
var doc = aManager.document;
if (gUseInContentUI) {
is(gBrowser.canGoBack, canGoBack, "canGoBack should be correct");
is(gBrowser.canGoForward, canGoForward, "canGoForward should be correct");
}
if (!is_hidden(doc.getElementById("back-btn"))) {
is(!doc.getElementById("back-btn").disabled, canGoBack, "Back button should have the right state");
is(!doc.getElementById("forward-btn").disabled, canGoForward, "Forward button should have the right state");
}
function check_state(canGoBack, canGoForward) {
is(gBrowser.canGoBack, canGoBack, "canGoBack should be correct");
is(gBrowser.canGoForward, canGoForward, "canGoForward should be correct");
}
function test() {
@ -150,7 +131,7 @@ add_test(function() {
go_back(gManagerWindow);
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "type1", "Should be showing the custom view");
check_state(gManagerWindow, true, true);
check_state(true, true);
AddonManagerPrivate.unregisterProvider(gProvider);
@ -159,27 +140,27 @@ add_test(function() {
ok(!gCategoryUtilities.get("missing1", true), "Missing 1 should be absent");
is(gCategoryUtilities.selectedCategory, "discover", "Should be back to the default view");
check_state(gManagerWindow, true, true);
check_state(true, true);
go_back(gManagerWindow);
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "extension", "Should be showing the extension view");
check_state(gManagerWindow, false, true);
check_state(false, true);
go_forward(gManagerWindow);
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "discover", "Should be back to the default view");
check_state(gManagerWindow, true, true);
check_state(true, true);
go_forward(gManagerWindow);
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "plugin", "Should be back to the plugins view");
check_state(gManagerWindow, true, false);
check_state(true, false);
go_back(gManagerWindow);
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "discover", "Should be back to the default view");
check_state(gManagerWindow, true, true);
check_state(true, true);
close_manager(gManagerWindow, run_next_test);
});
@ -212,7 +193,7 @@ add_test(function() {
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "extension", "Should be back to the first view");
check_state(gManagerWindow, false, true);
check_state(false, true);
close_manager(gManagerWindow, run_next_test);
});
@ -248,7 +229,7 @@ add_test(function() {
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "plugin", "Should be back to the plugin view");
check_state(gManagerWindow, true, false);
check_state(true, false);
close_manager(gManagerWindow, run_next_test);
});
@ -281,7 +262,7 @@ add_test(function() {
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "discover", "Should be at the default view");
check_state(gManagerWindow, false, true);
check_state(false, true);
close_manager(gManagerWindow, run_next_test);
});
@ -315,7 +296,7 @@ add_test(function() {
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "discover", "Should be at the default view");
check_state(gManagerWindow, true, false);
check_state(true, false);
close_manager(gManagerWindow, run_next_test);
});
@ -346,7 +327,7 @@ add_test(function() {
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "extension", "Should be back to the first view");
check_state(gManagerWindow, false, true);
check_state(false, true);
close_manager(gManagerWindow, run_next_test);
});
@ -386,7 +367,7 @@ add_test(function() {
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "plugin", "Should be back to the plugin view");
check_state(gManagerWindow, true, false);
check_state(true, false);
close_manager(gManagerWindow, run_next_test);
});
@ -422,7 +403,7 @@ add_test(function() {
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "discover", "Should be at the default view");
check_state(gManagerWindow, false, true);
check_state(false, true);
close_manager(gManagerWindow, run_next_test);
});
@ -461,7 +442,7 @@ add_test(function() {
wait_for_view_load(gManagerWindow, function() {
is(gCategoryUtilities.selectedCategory, "discover", "Should be at the default view");
check_state(gManagerWindow, true, false);
check_state(true, false);
close_manager(gManagerWindow, run_next_test);
});

Просмотреть файл

@ -18,13 +18,6 @@ var pathParts = gTestPath.split("/");
// Drop the test filename
pathParts.splice(pathParts.length - 1, pathParts.length);
var gTestInWindow = /-window$/.test(pathParts[pathParts.length - 1]);
// Drop the UI type
if (gTestInWindow) {
pathParts.splice(pathParts.length - 1, pathParts.length);
}
const RELATIVE_DIR = pathParts.slice(4).join("/") + "/";
const TESTROOT = "http://example.com/" + RELATIVE_DIR;
@ -64,8 +57,6 @@ var gPendingTests = [];
var gTestsRun = 0;
var gTestStart = null;
var gUseInContentUI = !gTestInWindow && ("switchToTabHavingURI" in window);
var gRestorePrefs = [{name: PREF_LOGGING_ENABLED},
{name: PREF_CUSTOM_XPINSTALL_CONFIRMATION_UI},
{name: "extensions.webservice.discoverURL"},
@ -407,28 +398,18 @@ function open_manager(aView, aCallback, aLoadCallback, aLongerTimeout) {
}, aManagerWindow);
}
if (gUseInContentUI) {
info("Loading manager window in tab");
Services.obs.addObserver(function(aSubject, aTopic, aData) {
Services.obs.removeObserver(arguments.callee, aTopic);
if (aSubject.location.href != MANAGER_URI) {
info("Ignoring load event for " + aSubject.location.href);
return;
}
setup_manager(aSubject);
}, "EM-loaded");
info("Loading manager window in tab");
Services.obs.addObserver(function(aSubject, aTopic, aData) {
Services.obs.removeObserver(arguments.callee, aTopic);
if (aSubject.location.href != MANAGER_URI) {
info("Ignoring load event for " + aSubject.location.href);
return;
}
setup_manager(aSubject);
}, "EM-loaded");
gBrowser.selectedTab = gBrowser.addTab();
switchToTabHavingURI(MANAGER_URI, true);
} else {
info("Loading manager window in dialog");
Services.obs.addObserver(function(aSubject, aTopic, aData) {
Services.obs.removeObserver(arguments.callee, aTopic);
setup_manager(aSubject);
}, "EM-loaded");
openDialog(MANAGER_URI);
}
gBrowser.selectedTab = gBrowser.addTab();
switchToTabHavingURI(MANAGER_URI, true);
});
// The promise resolves with the manager window, so it is passed to the callback

Просмотреть файл

@ -5,6 +5,5 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
BROWSER_CHROME_MANIFESTS += [
'browser-window.ini',
'browser.ini',
]