summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/test/browser/browser_bug562890.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-02-10 02:51:36 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-02-10 02:51:36 -0500
commit37d5300335d81cecbecc99812747a657588c63eb (patch)
tree765efa3b6a56bb715d9813a8697473e120436278 /toolkit/mozapps/extensions/test/browser/browser_bug562890.js
parentb2bdac20c02b12f2057b9ef70b0a946113a00e00 (diff)
parent4fb11cd5966461bccc3ed1599b808237be6b0de9 (diff)
downloadUXP-37d5300335d81cecbecc99812747a657588c63eb.tar
UXP-37d5300335d81cecbecc99812747a657588c63eb.tar.gz
UXP-37d5300335d81cecbecc99812747a657588c63eb.tar.lz
UXP-37d5300335d81cecbecc99812747a657588c63eb.tar.xz
UXP-37d5300335d81cecbecc99812747a657588c63eb.zip
Merge branch 'ext-work'
Diffstat (limited to 'toolkit/mozapps/extensions/test/browser/browser_bug562890.js')
-rw-r--r--toolkit/mozapps/extensions/test/browser/browser_bug562890.js78
1 files changed, 0 insertions, 78 deletions
diff --git a/toolkit/mozapps/extensions/test/browser/browser_bug562890.js b/toolkit/mozapps/extensions/test/browser/browser_bug562890.js
deleted file mode 100644
index ccb12c489..000000000
--- a/toolkit/mozapps/extensions/test/browser/browser_bug562890.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Tests the Preferences button for addons in list view
- */
-
-function test() {
- requestLongerTimeout(2);
-
- waitForExplicitFinish();
-
- var addonPrefsURI = CHROMEROOT + "addon_prefs.xul";
-
- var gProvider = new MockProvider();
- gProvider.createAddons([{
- id: "test1@tests.mozilla.org",
- name: "Test add-on 1",
- description: "foo"
- },
- {
- id: "test2@tests.mozilla.org",
- name: "Test add-on 2",
- description: "bar",
- optionsURL: addonPrefsURI
- }]);
-
- open_manager("addons://list/extension", function(aManager) {
- var addonList = aManager.document.getElementById("addon-list");
- for (var addonItem of addonList.childNodes) {
- if (addonItem.hasAttribute("name") &&
- addonItem.getAttribute("name") == "Test add-on 1")
- break;
- }
- var prefsBtn = aManager.document.getAnonymousElementByAttribute(addonItem,
- "anonid",
- "preferences-btn");
- is(prefsBtn.hidden, true, "Prefs button should be hidden for addon with no optionsURL set")
-
- for (addonItem of addonList.childNodes) {
- if (addonItem.hasAttribute("name") &&
- addonItem.getAttribute("name") == "Test add-on 2")
- break;
- }
- prefsBtn = aManager.document.getAnonymousElementByAttribute(addonItem,
- "anonid",
- "preferences-btn");
- is(prefsBtn.hidden, false, "Prefs button should be shown for addon with a optionsURL set")
-
- Services.ww.registerNotification(function TEST_ww_observer(aSubject, aTopic, aData) {
- if (aTopic == "domwindowclosed") {
- Services.ww.unregisterNotification(TEST_ww_observer);
- // Give the preference window a chance to finish closing before closing
- // the add-ons manager.
- executeSoon(function() {
- close_manager(aManager, finish);
- });
- } else if (aTopic == "domwindowopened") {
- let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
- win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
- win.addEventListener("load", function TEST_ww_onLoad() {
- if (win.location != addonPrefsURI)
- return;
-
- win.removeEventListener("load", TEST_ww_onLoad, false);
- is(win.location, addonPrefsURI,
- "The correct addon pref window should have opened");
- win.close();
- }, false);
- }
- });
-
- addonList.ensureElementIsVisible(addonItem);
- EventUtils.synthesizeMouseAtCenter(prefsBtn, { }, aManager);
- });
-
-}