diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-10 02:49:12 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-10 02:49:12 -0500 |
commit | 4fb11cd5966461bccc3ed1599b808237be6b0de9 (patch) | |
tree | d7f0ccd49cebb3544d52635ff1bd6ed4d763823f /toolkit/mozapps/extensions/test/browser/browser_tabsettings.js | |
parent | f164d9124708b50789dbb6959e1de96cc5697c48 (diff) | |
download | UXP-4fb11cd5966461bccc3ed1599b808237be6b0de9.tar UXP-4fb11cd5966461bccc3ed1599b808237be6b0de9.tar.gz UXP-4fb11cd5966461bccc3ed1599b808237be6b0de9.tar.lz UXP-4fb11cd5966461bccc3ed1599b808237be6b0de9.tar.xz UXP-4fb11cd5966461bccc3ed1599b808237be6b0de9.zip |
Move WebExtensions enabled Add-ons Manager
Diffstat (limited to 'toolkit/mozapps/extensions/test/browser/browser_tabsettings.js')
-rw-r--r-- | toolkit/mozapps/extensions/test/browser/browser_tabsettings.js | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/toolkit/mozapps/extensions/test/browser/browser_tabsettings.js b/toolkit/mozapps/extensions/test/browser/browser_tabsettings.js deleted file mode 100644 index 2838698c7..000000000 --- a/toolkit/mozapps/extensions/test/browser/browser_tabsettings.js +++ /dev/null @@ -1,100 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ - */ - -// Tests various aspects of the details view - -var gManagerWindow; -var gCategoryUtilities; -var gProvider; - -function test() { - waitForExplicitFinish(); - - gProvider = new MockProvider(); - - gProvider.createAddons([{ - id: "tabsettings@tests.mozilla.org", - name: "Tab Settings", - version: "1", - optionsURL: CHROMEROOT + "addon_prefs.xul", - optionsType: AddonManager.OPTIONS_TYPE_TAB - }]); - - open_manager("addons://list/extension", function(aWindow) { - gManagerWindow = aWindow; - gCategoryUtilities = new CategoryUtilities(gManagerWindow); - - run_next_test(); - }); -} - -function end_test() { - close_manager(gManagerWindow, function() { - finish(); - }); -} - -add_test(function() { - var addon = get_addon_element(gManagerWindow, "tabsettings@tests.mozilla.org"); - is(addon.mAddon.optionsType, AddonManager.OPTIONS_TYPE_TAB, "Options should be inline type"); - addon.parentNode.ensureElementIsVisible(addon); - - 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() { - browser.removeEventListener("DOMContentLoaded", arguments.callee, false); - is(browser.currentURI.spec, addon.mAddon.optionsURL, "New tab should have loaded the options URL"); - browser.contentWindow.close(); - run_next_test(); - }, false); - 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); -}); |