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_webext_options.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_webext_options.js')
-rw-r--r-- | toolkit/mozapps/extensions/test/browser/browser_webext_options.js | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/toolkit/mozapps/extensions/test/browser/browser_webext_options.js b/toolkit/mozapps/extensions/test/browser/browser_webext_options.js deleted file mode 100644 index b13213f0b..000000000 --- a/toolkit/mozapps/extensions/test/browser/browser_webext_options.js +++ /dev/null @@ -1,70 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ - */ - -// Wrapper to run a test that consists of: -// 1. opening the add-ons manager viewing the list of extensions -// 2. installing an extension (using the provider installer callable) -// 3. opening the preferences panel for the new extension and verifying -// that it opens cleanly -function* runTest(installer) { - let mgrWindow = yield open_manager("addons://list/extension"); - - let {addon, id} = yield* installer(); - isnot(addon, null, "Extension is installed"); - - let element = get_addon_element(mgrWindow, id); - element.parentNode.ensureElementIsVisible(element); - - let button = mgrWindow.document.getAnonymousElementByAttribute(element, "anonid", "preferences-btn"); - is_element_visible(button, "Preferences button should be visible"); - - EventUtils.synthesizeMouseAtCenter(button, {clickCount: 1}, mgrWindow); - - yield TestUtils.topicObserved(AddonManager.OPTIONS_NOTIFICATION_DISPLAYED, - (subject, data) => data == id); - - is(mgrWindow.gViewController.currentViewId, - `addons://detail/${encodeURIComponent(id)}/preferences`, - "Current view should scroll to preferences"); - - var browser = mgrWindow.document.querySelector("#detail-grid > rows > .inline-options-browser"); - var rows = browser.parentNode; - - ok(browser, "Grid should have a browser child"); - is(browser.localName, "browser", "Grid should have a browser child"); - is(browser.currentURI.spec, element.mAddon.optionsURL, "Browser has the expected options URL loaded") - - is(browser.clientWidth, rows.clientWidth, - "Browser should be the same width as its parent node"); - - button = mgrWindow.document.getElementById("detail-prefs-btn"); - is_element_hidden(button, "Preferences button should not be visible"); - - yield close_manager(mgrWindow); - - addon.uninstall(); -} - -// Test that deferred handling of optionsURL works for a signed webextension -add_task(function* test_options_signed() { - yield* runTest(function*() { - // The extension in-tree is signed with this ID: - const ID = "{9792932b-32b2-4567-998c-e7bf6c4c5e35}"; - - yield install_addon("addons/options_signed.xpi"); - let addon = yield promiseAddonByID(ID); - - return {addon, id: ID}; - }); -}); - -add_task(function* test_options_temporary() { - yield* runTest(function*() { - let dir = get_addon_file_url("options_signed").file; - let addon = yield AddonManager.installTemporaryAddon(dir); - isnot(addon, null, "Extension is installed (temporarily)"); - - return {addon, id: addon.id}; - }); -}); |