2011-05-17 12:57:38 -07:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Bug 656269 - Add link to Mozilla plugin check from Add-ons Manager
|
|
|
|
|
2011-05-20 12:37:39 -07:00
|
|
|
const MAIN_URL = "https://example.com/" + RELATIVE_DIR + "discovery.html";
|
|
|
|
const PREF_PLUGINCHECKURL = "plugins.update.url";
|
|
|
|
|
2011-05-17 12:57:38 -07:00
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
2011-05-20 12:37:39 -07:00
|
|
|
|
|
|
|
Services.prefs.setCharPref(PREF_PLUGINCHECKURL, MAIN_URL);
|
|
|
|
registerCleanupFunction(function() {
|
|
|
|
Services.prefs.clearUserPref(PREF_PLUGINCHECKURL);
|
|
|
|
});
|
|
|
|
|
2011-05-17 12:57:38 -07:00
|
|
|
run_next_test();
|
|
|
|
}
|
|
|
|
|
|
|
|
function end_test() {
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
add_test(function() {
|
|
|
|
open_manager("addons://list/extension", function(aManager) {
|
|
|
|
info("Testing plugin check information");
|
2011-05-31 15:52:49 -07:00
|
|
|
var button = aManager.document.querySelector("#list-view button.global-info-plugincheck");
|
2011-05-17 12:57:38 -07:00
|
|
|
is_element_hidden(button, "Plugin Check message button should be hidden");
|
|
|
|
|
|
|
|
info("Changing view to plugins")
|
2011-05-20 10:36:28 -07:00
|
|
|
EventUtils.synthesizeMouseAtCenter(aManager.document.getElementById("category-plugin"), { }, aManager);
|
2011-05-17 12:57:38 -07:00
|
|
|
|
|
|
|
wait_for_view_load(aManager, function(aManager) {
|
2011-05-31 15:52:49 -07:00
|
|
|
var button = aManager.document.querySelector("#list-view button.global-info-plugincheck");
|
2011-05-17 12:57:38 -07:00
|
|
|
is_element_visible(button, "Plugin Check message button should be visible");
|
|
|
|
|
|
|
|
info("Clicking 'Plugin Check' button");
|
|
|
|
EventUtils.synthesizeMouseAtCenter(button, { }, aManager);
|
|
|
|
gBrowser.addEventListener("load", function(event) {
|
|
|
|
if (!(event.target instanceof Document) ||
|
|
|
|
event.target.location.href == "about:blank")
|
|
|
|
return;
|
|
|
|
gBrowser.removeEventListener("load", arguments.callee, true);
|
|
|
|
|
|
|
|
is(gBrowser.currentURI.spec, Services.urlFormatter.formatURLPref("plugins.update.url"), "Plugin Check URL should match");
|
|
|
|
|
|
|
|
gBrowser.removeCurrentTab();
|
|
|
|
close_manager(aManager, function() {
|
|
|
|
run_next_test();
|
|
|
|
});
|
|
|
|
}, true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|