зеркало из https://github.com/mozilla/gecko-dev.git
Bug 610764: Get Add-ons tab is not default selection in new profile. r=Unfocused, a=blocks-final
This commit is contained in:
Родитель
89ae6c1a3a
Коммит
e7d2a6945f
|
@ -72,7 +72,7 @@ const UPDATES_RELEASENOTES_TRANSFORMFILE = "chrome://mozapps/content/extensions/
|
||||||
|
|
||||||
const XMLURI_PARSE_ERROR = "http://www.mozilla.org/newlayout/xml/parsererror.xml"
|
const XMLURI_PARSE_ERROR = "http://www.mozilla.org/newlayout/xml/parsererror.xml"
|
||||||
|
|
||||||
const VIEW_DEFAULT = "addons://list/extension";
|
const VIEW_DEFAULT = "addons://discover/";
|
||||||
|
|
||||||
var gStrings = {};
|
var gStrings = {};
|
||||||
XPCOMUtils.defineLazyServiceGetter(gStrings, "bundleSvc",
|
XPCOMUtils.defineLazyServiceGetter(gStrings, "bundleSvc",
|
||||||
|
|
|
@ -61,6 +61,7 @@ _MAIN_TEST_FILES = \
|
||||||
browser_bug591465.js \
|
browser_bug591465.js \
|
||||||
browser_bug596336.js \
|
browser_bug596336.js \
|
||||||
browser_bug608316.js \
|
browser_bug608316.js \
|
||||||
|
browser_bug610764.js \
|
||||||
browser_details.js \
|
browser_details.js \
|
||||||
browser_discovery.js \
|
browser_discovery.js \
|
||||||
browser_dragdrop.js \
|
browser_dragdrop.js \
|
||||||
|
|
|
@ -41,16 +41,18 @@ function end_test() {
|
||||||
|
|
||||||
|
|
||||||
function perform_search(aQuery, aCallback) {
|
function perform_search(aQuery, aCallback) {
|
||||||
var searchBox = gManagerWindow.document.getElementById("header-search");
|
waitForFocus(function() {
|
||||||
searchBox.value = aQuery;
|
var searchBox = gManagerWindow.document.getElementById("header-search");
|
||||||
|
searchBox.value = aQuery;
|
||||||
|
|
||||||
EventUtils.synthesizeMouse(searchBox, 2, 2, { }, gManagerWindow);
|
EventUtils.synthesizeMouse(searchBox, 2, 2, { }, gManagerWindow);
|
||||||
EventUtils.synthesizeKey("VK_RETURN", { }, gManagerWindow);
|
EventUtils.synthesizeKey("VK_RETURN", { }, gManagerWindow);
|
||||||
wait_for_view_load(gManagerWindow, function() {
|
wait_for_view_load(gManagerWindow, function() {
|
||||||
var list = gManagerWindow.document.getElementById("search-list");
|
var list = gManagerWindow.document.getElementById("search-list");
|
||||||
var rows = list.getElementsByTagName("richlistitem");
|
var rows = list.getElementsByTagName("richlistitem");
|
||||||
aCallback(rows);
|
aCallback(rows);
|
||||||
});
|
});
|
||||||
|
}, gManagerWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,7 @@ add_test(function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
open_manager(null, function(aManager) {
|
open_manager("addons://list/extension", function(aManager) {
|
||||||
info("Part 1");
|
info("Part 1");
|
||||||
is_in_list(aManager, "addons://list/extension", false, false);
|
is_in_list(aManager, "addons://list/extension", false, false);
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ add_test(function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
open_manager(null, function(aManager) {
|
open_manager("addons://list/extension", function(aManager) {
|
||||||
info("Part 1");
|
info("Part 1");
|
||||||
is_in_list(aManager, "addons://list/extension", false, false);
|
is_in_list(aManager, "addons://list/extension", false, false);
|
||||||
|
|
||||||
|
@ -530,7 +530,7 @@ add_test(function() {
|
||||||
// Tests that removing an extension from the detail view goes back and doesn't
|
// Tests that removing an extension from the detail view goes back and doesn't
|
||||||
// allow you to go forward again.
|
// allow you to go forward again.
|
||||||
add_test(function() {
|
add_test(function() {
|
||||||
open_manager(null, function(aManager) {
|
open_manager("addons://list/extension", function(aManager) {
|
||||||
info("Part 1");
|
info("Part 1");
|
||||||
is_in_list(aManager, "addons://list/extension", false, false);
|
is_in_list(aManager, "addons://list/extension", false, false);
|
||||||
|
|
||||||
|
@ -574,3 +574,20 @@ add_test(function() {
|
||||||
close_manager(aManager, run_next_test);
|
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) {
|
||||||
|
info("Part 1");
|
||||||
|
is_in_list(aManager, "addons://list/plugin", false, false);
|
||||||
|
|
||||||
|
close_manager(aManager, function() {
|
||||||
|
open_manager(null, function(aManager) {
|
||||||
|
info("Part 1");
|
||||||
|
is_in_list(aManager, "addons://list/plugin", false, false);
|
||||||
|
|
||||||
|
close_manager(aManager, run_next_test);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
@ -40,21 +40,23 @@ function end_test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function search(aRemoteSearch, aCallback) {
|
function search(aRemoteSearch, aCallback) {
|
||||||
var searchBox = gManagerWindow.document.getElementById("header-search");
|
waitForFocus(function() {
|
||||||
searchBox.value = SEARCH_QUERY;
|
var searchBox = gManagerWindow.document.getElementById("header-search");
|
||||||
|
searchBox.value = SEARCH_QUERY;
|
||||||
|
|
||||||
EventUtils.synthesizeMouseAtCenter(searchBox, { }, gManagerWindow);
|
EventUtils.synthesizeMouseAtCenter(searchBox, { }, gManagerWindow);
|
||||||
EventUtils.synthesizeKey("VK_RETURN", { }, gManagerWindow);
|
EventUtils.synthesizeKey("VK_RETURN", { }, gManagerWindow);
|
||||||
|
|
||||||
wait_for_view_load(gManagerWindow, function() {
|
wait_for_view_load(gManagerWindow, function() {
|
||||||
if (aRemoteSearch)
|
if (aRemoteSearch)
|
||||||
var filter = gManagerWindow.document.getElementById("search-filter-remote");
|
var filter = gManagerWindow.document.getElementById("search-filter-remote");
|
||||||
else
|
else
|
||||||
var filter = gManagerWindow.document.getElementById("search-filter-local");
|
var filter = gManagerWindow.document.getElementById("search-filter-local");
|
||||||
EventUtils.synthesizeMouseAtCenter(filter, { }, gManagerWindow);
|
EventUtils.synthesizeMouseAtCenter(filter, { }, gManagerWindow);
|
||||||
|
|
||||||
executeSoon(aCallback);
|
executeSoon(aCallback);
|
||||||
});
|
});
|
||||||
|
}, gManagerWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_allresultslink(aShouldShow) {
|
function check_allresultslink(aShouldShow) {
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Tests that the discovery view is the default
|
||||||
|
|
||||||
|
var gCategoryUtilities;
|
||||||
|
|
||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
open_manager(null, function(aWindow) {
|
||||||
|
waitForFocus(function() {
|
||||||
|
// The last view is cached except when it is the search view so switch to
|
||||||
|
// that and reopen to ensure we see the default view
|
||||||
|
var searchBox = aWindow.document.getElementById("header-search");
|
||||||
|
searchBox.value = "bar";
|
||||||
|
|
||||||
|
EventUtils.synthesizeMouseAtCenter(searchBox, { }, aWindow);
|
||||||
|
EventUtils.synthesizeKey("VK_RETURN", { }, aWindow);
|
||||||
|
|
||||||
|
wait_for_view_load(aWindow, function() {
|
||||||
|
close_manager(aWindow, function() {
|
||||||
|
open_manager(null, function(aWindow) {
|
||||||
|
gCategoryUtilities = new CategoryUtilities(aWindow);
|
||||||
|
is(gCategoryUtilities.selectedCategory, "discover", "Should show the discovery pane by default");
|
||||||
|
|
||||||
|
close_manager(aWindow, finish);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, aWindow);
|
||||||
|
});
|
||||||
|
}
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
// Tests that the discovery view loads properly
|
// Tests that the discovery view loads properly
|
||||||
|
|
||||||
const PREF_DISCOVERURL = "extensions.webservice.discoverURL";
|
|
||||||
const PREF_BACKGROUND_UPDATE = "extensions.update.enabled";
|
const PREF_BACKGROUND_UPDATE = "extensions.update.enabled";
|
||||||
|
|
||||||
var gManagerWindow;
|
var gManagerWindow;
|
||||||
|
|
|
@ -204,7 +204,7 @@ add_test(function() {
|
||||||
add_test(function() {
|
add_test(function() {
|
||||||
installSearchResult(function() {
|
installSearchResult(function() {
|
||||||
close_manager(gManagerWindow, function() {
|
close_manager(gManagerWindow, function() {
|
||||||
open_manager(null, function(aWindow) {
|
open_manager("addons://list/extension", function(aWindow) {
|
||||||
gManagerWindow = aWindow;
|
gManagerWindow = aWindow;
|
||||||
gCategoryUtilities = new CategoryUtilities(gManagerWindow);
|
gCategoryUtilities = new CategoryUtilities(gManagerWindow);
|
||||||
check_undo_install();
|
check_undo_install();
|
||||||
|
|
|
@ -26,6 +26,7 @@ const MANAGER_URI = "about:addons";
|
||||||
const INSTALL_URI = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
|
const INSTALL_URI = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
|
||||||
const PREF_LOGGING_ENABLED = "extensions.logging.enabled";
|
const PREF_LOGGING_ENABLED = "extensions.logging.enabled";
|
||||||
const PREF_SEARCH_MAXRESULTS = "extensions.getAddons.maxResults";
|
const PREF_SEARCH_MAXRESULTS = "extensions.getAddons.maxResults";
|
||||||
|
const PREF_DISCOVERURL = "extensions.webservice.discoverURL";
|
||||||
|
|
||||||
var gPendingTests = [];
|
var gPendingTests = [];
|
||||||
var gTestsRun = 0;
|
var gTestsRun = 0;
|
||||||
|
@ -37,6 +38,8 @@ var gUseInContentUI = !gTestInWindow && ("switchToTabHavingURI" in window);
|
||||||
Services.prefs.setBoolPref(PREF_LOGGING_ENABLED, true);
|
Services.prefs.setBoolPref(PREF_LOGGING_ENABLED, true);
|
||||||
// Turn off remote results in searches
|
// Turn off remote results in searches
|
||||||
Services.prefs.setIntPref(PREF_SEARCH_MAXRESULTS, 0);
|
Services.prefs.setIntPref(PREF_SEARCH_MAXRESULTS, 0);
|
||||||
|
// Default to a local discovery pane
|
||||||
|
Services.prefs.setCharPref(PREF_DISCOVERURL, "http://127.0.0.1/extensions-dummy/discoveryURL");
|
||||||
registerCleanupFunction(function() {
|
registerCleanupFunction(function() {
|
||||||
Services.prefs.clearUserPref(PREF_LOGGING_ENABLED);
|
Services.prefs.clearUserPref(PREF_LOGGING_ENABLED);
|
||||||
try {
|
try {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче