summaryrefslogtreecommitdiffstats
path: root/browser/components/uitour/test/browser_UITour_availableTargets.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-02-03 06:00:38 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-02-03 06:00:38 -0500
commit8148615da179fdd60f19018e13b4e94b95609cc6 (patch)
tree771fccdd99fa3adf35fdd2c81d8197b415a89b91 /browser/components/uitour/test/browser_UITour_availableTargets.js
parent494802c1be7888025b95260d23db187467d2b9dd (diff)
downloadUXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar
UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.gz
UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.lz
UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.xz
UXP-8148615da179fdd60f19018e13b4e94b95609cc6.zip
Remove browser tests - Part 1: The Tests (except for experiments)
Diffstat (limited to 'browser/components/uitour/test/browser_UITour_availableTargets.js')
-rw-r--r--browser/components/uitour/test/browser_UITour_availableTargets.js114
1 files changed, 0 insertions, 114 deletions
diff --git a/browser/components/uitour/test/browser_UITour_availableTargets.js b/browser/components/uitour/test/browser_UITour_availableTargets.js
deleted file mode 100644
index a6e96e31f..000000000
--- a/browser/components/uitour/test/browser_UITour_availableTargets.js
+++ /dev/null
@@ -1,114 +0,0 @@
-"use strict";
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-
-var hasWebIDE = Services.prefs.getBoolPref("devtools.webide.widget.enabled");
-var hasPocket = Services.prefs.getBoolPref("extensions.pocket.enabled");
-
-requestLongerTimeout(2);
-add_task(setup_UITourTest);
-
-add_UITour_task(function* test_availableTargets() {
- let data = yield getConfigurationPromise("availableTargets");
- ok_targets(data, [
- "accountStatus",
- "addons",
- "appMenu",
- "backForward",
- "bookmarks",
- "customize",
- "help",
- "home",
- "devtools",
- ...(hasPocket ? ["pocket"] : []),
- "privateWindow",
- "quit",
- "readerMode-urlBar",
- "search",
- "searchIcon",
- "trackingProtection",
- "urlbar",
- ...(hasWebIDE ? ["webide"] : [])
- ]);
-
- ok(UITour.availableTargetsCache.has(window),
- "Targets should now be cached");
-});
-
-add_UITour_task(function* test_availableTargets_changeWidgets() {
- CustomizableUI.removeWidgetFromArea("bookmarks-menu-button");
- ok(!UITour.availableTargetsCache.has(window),
- "Targets should be evicted from cache after widget change");
- let data = yield getConfigurationPromise("availableTargets");
- ok_targets(data, [
- "accountStatus",
- "addons",
- "appMenu",
- "backForward",
- "customize",
- "help",
- "devtools",
- "home",
- ...(hasPocket ? ["pocket"] : []),
- "privateWindow",
- "quit",
- "readerMode-urlBar",
- "search",
- "searchIcon",
- "trackingProtection",
- "urlbar",
- ...(hasWebIDE ? ["webide"] : [])
- ]);
-
- ok(UITour.availableTargetsCache.has(window),
- "Targets should now be cached again");
- CustomizableUI.reset();
- ok(!UITour.availableTargetsCache.has(window),
- "Targets should not be cached after reset");
-});
-
-add_UITour_task(function* test_availableTargets_exceptionFromGetTarget() {
- // The query function for the "search" target will throw if it's not found.
- // Make sure the callback still fires with the other available targets.
- CustomizableUI.removeWidgetFromArea("search-container");
- let data = yield getConfigurationPromise("availableTargets");
- // Default minus "search" and "searchIcon"
- ok_targets(data, [
- "accountStatus",
- "addons",
- "appMenu",
- "backForward",
- "bookmarks",
- "customize",
- "help",
- "home",
- "devtools",
- ...(hasPocket ? ["pocket"] : []),
- "privateWindow",
- "quit",
- "readerMode-urlBar",
- "trackingProtection",
- "urlbar",
- ...(hasWebIDE ? ["webide"] : [])
- ]);
-
- CustomizableUI.reset();
-});
-
-function ok_targets(actualData, expectedTargets) {
- // Depending on how soon after page load this is called, the selected tab icon
- // may or may not be showing the loading throbber. Check for its presence and
- // insert it into expectedTargets if it's visible.
- let selectedTabIcon =
- document.getAnonymousElementByAttribute(gBrowser.selectedTab,
- "anonid",
- "tab-icon-image");
- if (selectedTabIcon && UITour.isElementVisible(selectedTabIcon))
- expectedTargets.push("selectedTabIcon");
-
- ok(Array.isArray(actualData.targets), "data.targets should be an array");
- is(actualData.targets.sort().toString(), expectedTargets.sort().toString(),
- "Targets should be as expected");
-}