summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/webextensions/test/browser/browser_inlinesettings_custom.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
commitfc61780b35af913801d72086456f493f63197da6 (patch)
treef85891288a7bd988da9f0f15ae64e5c63f00d493 /toolkit/mozapps/webextensions/test/browser/browser_inlinesettings_custom.js
parent69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff)
parent50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff)
downloadUXP-fc61780b35af913801d72086456f493f63197da6.tar
UXP-fc61780b35af913801d72086456f493f63197da6.tar.gz
UXP-fc61780b35af913801d72086456f493f63197da6.tar.lz
UXP-fc61780b35af913801d72086456f493f63197da6.tar.xz
UXP-fc61780b35af913801d72086456f493f63197da6.zip
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts: # browser/app/profile/firefox.js # browser/components/preferences/jar.mn
Diffstat (limited to 'toolkit/mozapps/webextensions/test/browser/browser_inlinesettings_custom.js')
-rw-r--r--toolkit/mozapps/webextensions/test/browser/browser_inlinesettings_custom.js92
1 files changed, 0 insertions, 92 deletions
diff --git a/toolkit/mozapps/webextensions/test/browser/browser_inlinesettings_custom.js b/toolkit/mozapps/webextensions/test/browser/browser_inlinesettings_custom.js
deleted file mode 100644
index ecd10852d..000000000
--- a/toolkit/mozapps/webextensions/test/browser/browser_inlinesettings_custom.js
+++ /dev/null
@@ -1,92 +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;
-
-function installAddon(aCallback) {
- AddonManager.getInstallForURL(TESTROOT + "addons/browser_inlinesettings1_custom.xpi",
- function(aInstall) {
- aInstall.addListener({
- onInstallEnded: function() {
- executeSoon(aCallback);
- }
- });
- aInstall.install();
- }, "application/x-xpinstall");
-}
-
-function test() {
- waitForExplicitFinish();
-
- installAddon(function () {
- open_manager("addons://list/extension", function(aWindow) {
- gManagerWindow = aWindow;
- gCategoryUtilities = new CategoryUtilities(gManagerWindow);
-
- run_next_test();
- });
- });
-}
-
-function end_test() {
- close_manager(gManagerWindow, function() {
- AddonManager.getAddonByID("inlinesettings1@tests.mozilla.org", function(aAddon) {
- aAddon.uninstall();
- finish();
- });
- });
-}
-
-// Addon with options.xul, with custom <setting> binding
-add_test(function() {
- var addon = get_addon_element(gManagerWindow, "inlinesettings1@tests.mozilla.org");
- is(addon.mAddon.optionsType, AddonManager.OPTIONS_TYPE_INLINE, "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");
-
- run_next_test();
-});
-
-// Addon with options.xul, also a test for the setting.xml bindings
-add_test(function() {
- var addon = get_addon_element(gManagerWindow, "inlinesettings1@tests.mozilla.org");
- addon.parentNode.ensureElementIsVisible(addon);
-
- var button = gManagerWindow.document.getAnonymousElementByAttribute(addon, "anonid", "preferences-btn");
- EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
-
- wait_for_view_load(gManagerWindow, function() {
- is(gManagerWindow.gViewController.currentViewId,
- "addons://detail/inlinesettings1%40tests.mozilla.org/preferences",
- "Current view should scroll to preferences");
-
- var grid = gManagerWindow.document.getElementById("detail-grid");
- var settings = grid.querySelectorAll("rows > setting");
- is(settings.length, 1, "Grid should have settings children");
-
- ok(settings[0].hasAttribute("first-row"), "First visible row should have first-row attribute");
-
- var style = window.getComputedStyle(settings[0], null);
- is(style.getPropertyValue("background-color"), "rgb(0, 0, 255)", "Background color should be set");
- is(style.getPropertyValue("display"), "-moz-grid-line", "Display should be set");
- is(style.getPropertyValue("-moz-binding"), 'url("chrome://inlinesettings/content/binding.xml#custom")', "Binding should be set");
-
- var label = gManagerWindow.document.getAnonymousElementByAttribute(settings[0], "anonid", "label");
- is(label.textContent, "Custom", "Localized string should be shown");
-
- var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[0], "anonid", "input");
- isnot(input, null, "Binding should be applied");
- is(input.value, "Woah!", "Binding should be applied");
-
- button = gManagerWindow.document.getElementById("detail-prefs-btn");
- is_element_hidden(button, "Preferences button should not be visible");
-
- gCategoryUtilities.openType("extension", run_next_test);
- });
-});