Bug 1244899 - Run dos2unix on UITour. r=me
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Mon, 01 Feb 2016 14:55:20 -0800
changeset 282561 f8a714ecb6732f6bd117d6d84e45e6be51f7b818
parent 282560 fee61a9a7c6db0922544d4d2aed7da6048396b95
child 282562 c286d0dfe75578c79ed52e7e5ec06a642c812930
push id17350
push usermozilla@noorenberghe.ca
push dateMon, 01 Feb 2016 22:57:53 +0000
treeherderfx-team@c286d0dfe755 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1244899
milestone47.0a1
Bug 1244899 - Run dos2unix on UITour. r=me
browser/components/uitour/test/browser_UITour.js
browser/components/uitour/test/browser_UITour2.js
browser/components/uitour/test/browser_UITour3.js
browser/components/uitour/test/browser_UITour_defaultBrowser.js
browser/components/uitour/test/browser_UITour_forceReaderMode.js
browser/components/uitour/test/browser_UITour_panel_close_annotation.js
browser/components/uitour/test/browser_UITour_registerPageID.js
browser/components/uitour/test/browser_UITour_sync.js
browser/components/uitour/test/browser_closeTab.js
browser/components/uitour/test/browser_openPreferences.js
browser/components/uitour/test/browser_openSearchPanel.js
--- a/browser/components/uitour/test/browser_UITour.js
+++ b/browser/components/uitour/test/browser_UITour.js
@@ -1,389 +1,389 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-
-Components.utils.import("resource://testing-common/TelemetryArchiveTesting.jsm", this);
-
-function test() {
-  UITourTest();
-}
-
-var tests = [
-  function test_untrusted_host(done) {
-    loadUITourTestPage(function() {
-      let bookmarksMenu = document.getElementById("bookmarks-menu-button");
-      is(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
-
-      gContentAPI.showMenu("bookmarks");
-      is(bookmarksMenu.open, false, "Bookmark menu should not open on a untrusted host");
-
-      done();
-    }, "http://mochi.test:8888/");
-  },
-  function test_testing_host(done) {
-    // Add two testing origins intentionally surrounded by whitespace to be ignored.
-    Services.prefs.setCharPref("browser.uitour.testingOrigins",
-                               "https://test1.example.org, https://test2.example.org:443 ");
-
-    registerCleanupFunction(() => {
-      Services.prefs.clearUserPref("browser.uitour.testingOrigins");
-    });
-    function callback(result) {
-      ok(result, "Callback should be called on a testing origin");
-      done();
-    }
-
-    loadUITourTestPage(function() {
-      gContentAPI.getConfiguration("appinfo", callback);
-    }, "https://test2.example.org/");
-  },
-  function test_unsecure_host(done) {
-    loadUITourTestPage(function() {
-      let bookmarksMenu = document.getElementById("bookmarks-menu-button");
-      is(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
-
-      gContentAPI.showMenu("bookmarks");
-      is(bookmarksMenu.open, false, "Bookmark menu should not open on a unsecure host");
-
-      done();
-    }, "http://example.org/");
-  },
-  function test_unsecure_host_override(done) {
-    Services.prefs.setBoolPref("browser.uitour.requireSecure", false);
-    loadUITourTestPage(function() {
-      let highlight = document.getElementById("UITourHighlight");
-      is_element_hidden(highlight, "Highlight should initially be hidden");
-
-      gContentAPI.showHighlight("urlbar");
-      waitForElementToBeVisible(highlight, done, "Highlight should be shown on a unsecure host when override pref is set");
-
-      Services.prefs.setBoolPref("browser.uitour.requireSecure", true);
-    }, "http://example.org/");
-  },
-  function test_disabled(done) {
-    Services.prefs.setBoolPref("browser.uitour.enabled", false);
-
-    let bookmarksMenu = document.getElementById("bookmarks-menu-button");
-    is(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
-
-    gContentAPI.showMenu("bookmarks");
-    is(bookmarksMenu.open, false, "Bookmark menu should not open when feature is disabled");
-
-    Services.prefs.setBoolPref("browser.uitour.enabled", true);
-    done();
-  },
-  function test_highlight(done) {
-    function test_highlight_2() {
-      let highlight = document.getElementById("UITourHighlight");
-      gContentAPI.hideHighlight();
-
-      waitForElementToBeHidden(highlight, test_highlight_3, "Highlight should be hidden after hideHighlight()");
-    }
-    function test_highlight_3() {
-      is_element_hidden(highlight, "Highlight should be hidden after hideHighlight()");
-
-      gContentAPI.showHighlight("urlbar");
-      waitForElementToBeVisible(highlight, test_highlight_4, "Highlight should be shown after showHighlight()");
-    }
-    function test_highlight_4() {
-      let highlight = document.getElementById("UITourHighlight");
-      gContentAPI.showHighlight("backForward");
-      waitForElementToBeVisible(highlight, done, "Highlight should be shown after showHighlight()");
-    }
-
-    let highlight = document.getElementById("UITourHighlight");
-    is_element_hidden(highlight, "Highlight should initially be hidden");
-
-    gContentAPI.showHighlight("urlbar");
-    waitForElementToBeVisible(highlight, test_highlight_2, "Highlight should be shown after showHighlight()");
-  },
-  function test_highlight_circle(done) {
-    function check_highlight_size() {
-      let panel = highlight.parentElement;
-      let anchor = panel.anchorNode;
-      let anchorRect = anchor.getBoundingClientRect();
-      info("addons target: width: " + anchorRect.width + " height: " + anchorRect.height);
-      let maxDimension = Math.round(Math.max(anchorRect.width, anchorRect.height));
-      let highlightRect = highlight.getBoundingClientRect();
-      info("highlight: width: " + highlightRect.width + " height: " + highlightRect.height);
-      is(Math.round(highlightRect.width), maxDimension, "The width of the highlight should be equal to the largest dimension of the target");
-      is(Math.round(highlightRect.height), maxDimension, "The height of the highlight should be equal to the largest dimension of the target");
-      is(Math.round(highlightRect.height), Math.round(highlightRect.width), "The height and width of the highlight should be the same to create a circle");
-      is(highlight.style.borderRadius, "100%", "The border-radius should be 100% to create a circle");
-      done();
-    }
-    let highlight = document.getElementById("UITourHighlight");
-    is_element_hidden(highlight, "Highlight should initially be hidden");
-
-    gContentAPI.showHighlight("addons");
-    waitForElementToBeVisible(highlight, check_highlight_size, "Highlight should be shown after showHighlight()");
-  },
-  function test_highlight_customize_auto_open_close(done) {
-    let highlight = document.getElementById("UITourHighlight");
-    gContentAPI.showHighlight("customize");
-    waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
-      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
-
-      // Move the highlight outside which should close the app menu.
-      gContentAPI.showHighlight("appMenu");
-      waitForElementToBeVisible(highlight, function checkPanelIsClosed() {
-        isnot(PanelUI.panel.state, "open",
-              "Panel should have closed after the highlight moved elsewhere.");
-        done();
-      }, "Highlight should move to the appMenu button");
-    }, "Highlight should be shown after showHighlight() for fixed panel items");
-  },
-  function test_highlight_customize_manual_open_close(done) {
-    let highlight = document.getElementById("UITourHighlight");
-    // Manually open the app menu then show a highlight there. The menu should remain open.
-    let shownPromise = promisePanelShown(window);
-    gContentAPI.showMenu("appMenu");
-    shownPromise.then(() => {
-      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
-      gContentAPI.showHighlight("customize");
-
-      waitForElementToBeVisible(highlight, function checkPanelIsStillOpen() {
-        isnot(PanelUI.panel.state, "closed", "Panel should still be open");
-
-        // Move the highlight outside which shouldn't close the app menu since it was manually opened.
-        gContentAPI.showHighlight("appMenu");
-        waitForElementToBeVisible(highlight, function () {
-          isnot(PanelUI.panel.state, "closed",
-                "Panel should remain open since UITour didn't open it in the first place");
-          gContentAPI.hideMenu("appMenu");
-          done();
-        }, "Highlight should move to the appMenu button");
-      }, "Highlight should be shown after showHighlight() for fixed panel items");
-    }).then(null, Components.utils.reportError);
-  },
-  function test_highlight_effect(done) {
-    function waitForHighlightWithEffect(highlightEl, effect, next, error) {
-      return waitForCondition(() => highlightEl.getAttribute("active") == effect,
-                              next,
-                              error);
-    }
-    function checkDefaultEffect() {
-      is(highlight.getAttribute("active"), "none", "The default should be no effect");
-
-      gContentAPI.showHighlight("urlbar", "none");
-      waitForHighlightWithEffect(highlight, "none", checkZoomEffect, "There should be no effect");
-    }
-    function checkZoomEffect() {
-      gContentAPI.showHighlight("urlbar", "zoom");
-      waitForHighlightWithEffect(highlight, "zoom", () => {
-        let style = window.getComputedStyle(highlight);
-        is(style.animationName, "uitour-zoom", "The animation-name should be uitour-zoom");
-        checkSameEffectOnDifferentTarget();
-      }, "There should be a zoom effect");
-    }
-    function checkSameEffectOnDifferentTarget() {
-      gContentAPI.showHighlight("appMenu", "wobble");
-      waitForHighlightWithEffect(highlight, "wobble", () => {
-        highlight.addEventListener("animationstart", function onAnimationStart(aEvent) {
-          highlight.removeEventListener("animationstart", onAnimationStart);
-          ok(true, "Animation occurred again even though the effect was the same");
-          checkRandomEffect();
-        });
-        gContentAPI.showHighlight("backForward", "wobble");
-      }, "There should be a wobble effect");
-    }
-    function checkRandomEffect() {
-      function waitForActiveHighlight(highlightEl, next, error) {
-        return waitForCondition(() => highlightEl.hasAttribute("active"),
-                                next,
-                                error);
-      }
-
-      gContentAPI.hideHighlight();
-      gContentAPI.showHighlight("urlbar", "random");
-      waitForActiveHighlight(highlight, () => {
-        ok(highlight.hasAttribute("active"), "The highlight should be active");
-        isnot(highlight.getAttribute("active"), "none", "A random effect other than none should have been chosen");
-        isnot(highlight.getAttribute("active"), "random", "The random effect shouldn't be 'random'");
-        isnot(UITour.highlightEffects.indexOf(highlight.getAttribute("active")), -1, "Check that a supported effect was randomly chosen");
-        done();
-      }, "There should be an active highlight with a random effect");
-    }
-
-    let highlight = document.getElementById("UITourHighlight");
-    is_element_hidden(highlight, "Highlight should initially be hidden");
-
-    gContentAPI.showHighlight("urlbar");
-    waitForElementToBeVisible(highlight, checkDefaultEffect, "Highlight should be shown after showHighlight()");
-  },
-  function test_highlight_effect_unsupported(done) {
-    function checkUnsupportedEffect() {
-      is(highlight.getAttribute("active"), "none", "No effect should be used when an unsupported effect is requested");
-      done();
-    }
-
-    let highlight = document.getElementById("UITourHighlight");
-    is_element_hidden(highlight, "Highlight should initially be hidden");
-
-    gContentAPI.showHighlight("urlbar", "__UNSUPPORTED__");
-    waitForElementToBeVisible(highlight, checkUnsupportedEffect, "Highlight should be shown after showHighlight()");
-  },
-  function test_info_1(done) {
-    let popup = document.getElementById("UITourTooltip");
-    let title = document.getElementById("UITourTooltipTitle");
-    let desc = document.getElementById("UITourTooltipDescription");
-    let icon = document.getElementById("UITourTooltipIcon");
-    let buttons = document.getElementById("UITourTooltipButtons");
-
-    popup.addEventListener("popupshown", function onPopupShown() {
-      popup.removeEventListener("popupshown", onPopupShown);
-      is(popup.popupBoxObject.anchorNode, document.getElementById("urlbar"), "Popup should be anchored to the urlbar");
-      is(title.textContent, "test title", "Popup should have correct title");
-      is(desc.textContent, "test text", "Popup should have correct description text");
-      is(icon.src, "", "Popup should have no icon");
-      is(buttons.hasChildNodes(), false, "Popup should have no buttons");
-
-      popup.addEventListener("popuphidden", function onPopupHidden() {
-        popup.removeEventListener("popuphidden", onPopupHidden);
-
-        popup.addEventListener("popupshown", function onPopupShown() {
-          popup.removeEventListener("popupshown", onPopupShown);
-          done();
-        });
-
-        gContentAPI.showInfo("urlbar", "test title", "test text");
-
-      });
-      gContentAPI.hideInfo();
-    });
-
-    gContentAPI.showInfo("urlbar", "test title", "test text");
-  },
-  taskify(function* test_info_2() {
-    let popup = document.getElementById("UITourTooltip");
-    let title = document.getElementById("UITourTooltipTitle");
-    let desc = document.getElementById("UITourTooltipDescription");
-    let icon = document.getElementById("UITourTooltipIcon");
-    let buttons = document.getElementById("UITourTooltipButtons");
-
-    yield showInfoPromise("urlbar", "urlbar title", "urlbar text");
-
-    is(popup.popupBoxObject.anchorNode, document.getElementById("urlbar"), "Popup should be anchored to the urlbar");
-    is(title.textContent, "urlbar title", "Popup should have correct title");
-    is(desc.textContent, "urlbar text", "Popup should have correct description text");
-    is(icon.src, "", "Popup should have no icon");
-    is(buttons.hasChildNodes(), false, "Popup should have no buttons");
-
-    yield showInfoPromise("search", "search title", "search text");
-
-    is(popup.popupBoxObject.anchorNode, document.getElementById("searchbar"), "Popup should be anchored to the searchbar");
-    is(title.textContent, "search title", "Popup should have correct title");
-    is(desc.textContent, "search text", "Popup should have correct description text");
-  }),
-  function test_getConfigurationVersion(done) {
-    function callback(result) {
-      let props = ["defaultUpdateChannel", "version"];
-      for (let property of props) {
-        ok(typeof(result[property]) !== undefined, "Check " + property + " isn't undefined.");
-        is(result[property], Services.appinfo[property], "Should have the same " + property + " property.");
-      }
-      done();
-    }
-
-    gContentAPI.getConfiguration("appinfo", callback);
-  },
-  function test_addToolbarButton(done) {
-    let placement = CustomizableUI.getPlacementOfWidget("panic-button");
-    is(placement, null, "default UI has panic button in the palette");
-
-    gContentAPI.getConfiguration("availableTargets", (data) => {
-      let available = (data.targets.indexOf("forget") != -1);
-      ok(!available, "Forget button should not be available by default");
-
-      gContentAPI.addNavBarWidget("forget", () => {
-        info("addNavBarWidget callback successfully called");
-
-        let placement = CustomizableUI.getPlacementOfWidget("panic-button");
-        is(placement.area, CustomizableUI.AREA_NAVBAR);
-
-        gContentAPI.getConfiguration("availableTargets", (data) => {
-          let available = (data.targets.indexOf("forget") != -1);
-          ok(available, "Forget button should now be available");
-
-          // Cleanup
-          CustomizableUI.removeWidgetFromArea("panic-button");
-          done();
-        });
-      });
-    });
-  },
-  function test_search(done) {
-    Services.search.init(rv => {
-      if (!Components.isSuccessCode(rv)) {
-        ok(false, "search service init failed: " + rv);
-        done();
-        return;
-      }
-      let defaultEngine = Services.search.defaultEngine;
-      gContentAPI.getConfiguration("search", data => {
-        let visibleEngines = Services.search.getVisibleEngines();
-        let expectedEngines = visibleEngines.filter((engine) => engine.identifier)
-                                            .map((engine) => "searchEngine-" + engine.identifier);
-
-        let engines = data.engines;
-        ok(Array.isArray(engines), "data.engines should be an array");
-        is(engines.sort().toString(), expectedEngines.sort().toString(),
-           "Engines should be as expected");
-
-        is(data.searchEngineIdentifier, defaultEngine.identifier,
-           "the searchEngineIdentifier property should contain the defaultEngine's identifier");
-
-        let someOtherEngineID = data.engines.filter(t => t != "searchEngine-" + defaultEngine.identifier)[0];
-        someOtherEngineID = someOtherEngineID.replace(/^searchEngine-/, "");
-
-        let observe = function (subject, topic, verb) {
-          info("browser-search-engine-modified: " + verb);
-          if (verb == "engine-current") {
-            is(Services.search.defaultEngine.identifier, someOtherEngineID, "correct engine was switched to");
-            done();
-          }
-        };
-        Services.obs.addObserver(observe, "browser-search-engine-modified", false);
-        registerCleanupFunction(() => {
-          // Clean up
-          Services.obs.removeObserver(observe, "browser-search-engine-modified");
-          Services.search.defaultEngine = defaultEngine;
-        });
-
-        gContentAPI.setDefaultSearchEngine(someOtherEngineID);
-      });
-    });
-  },
-  taskify(function* test_treatment_tag() {
-    let ac = new TelemetryArchiveTesting.Checker();
-    yield ac.promiseInit();
-    yield gContentAPI.setTreatmentTag("foobar", "baz");
-    yield new Promise((resolve) => {
-      gContentAPI.getTreatmentTag("foobar", (data) => {
-        is(data.value, "baz", "set and retrieved treatmentTag");
-        ac.promiseFindPing("uitour-tag", [
-          [["payload", "tagName"], "foobar"],
-          [["payload", "tagValue"], "baz"],
-        ]).then((found) => {
-          ok(found, "Telemetry ping submitted for setTreatmentTag");
-          resolve();
-        }, (err) => {
-          ok(false, "Exception finding uitour telemetry ping: " + err);
-          resolve();
-        });
-      });
-    });
-  }),
-
-  // Make sure this test is last in the file so the appMenu gets left open and done will confirm it got tore down.
-  taskify(function* cleanupMenus() {
-    let shownPromise = promisePanelShown(window);
-    gContentAPI.showMenu("appMenu");
-    yield shownPromise;
-  }),
-];
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+
+Components.utils.import("resource://testing-common/TelemetryArchiveTesting.jsm", this);
+
+function test() {
+  UITourTest();
+}
+
+var tests = [
+  function test_untrusted_host(done) {
+    loadUITourTestPage(function() {
+      let bookmarksMenu = document.getElementById("bookmarks-menu-button");
+      is(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
+
+      gContentAPI.showMenu("bookmarks");
+      is(bookmarksMenu.open, false, "Bookmark menu should not open on a untrusted host");
+
+      done();
+    }, "http://mochi.test:8888/");
+  },
+  function test_testing_host(done) {
+    // Add two testing origins intentionally surrounded by whitespace to be ignored.
+    Services.prefs.setCharPref("browser.uitour.testingOrigins",
+                               "https://test1.example.org, https://test2.example.org:443 ");
+
+    registerCleanupFunction(() => {
+      Services.prefs.clearUserPref("browser.uitour.testingOrigins");
+    });
+    function callback(result) {
+      ok(result, "Callback should be called on a testing origin");
+      done();
+    }
+
+    loadUITourTestPage(function() {
+      gContentAPI.getConfiguration("appinfo", callback);
+    }, "https://test2.example.org/");
+  },
+  function test_unsecure_host(done) {
+    loadUITourTestPage(function() {
+      let bookmarksMenu = document.getElementById("bookmarks-menu-button");
+      is(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
+
+      gContentAPI.showMenu("bookmarks");
+      is(bookmarksMenu.open, false, "Bookmark menu should not open on a unsecure host");
+
+      done();
+    }, "http://example.org/");
+  },
+  function test_unsecure_host_override(done) {
+    Services.prefs.setBoolPref("browser.uitour.requireSecure", false);
+    loadUITourTestPage(function() {
+      let highlight = document.getElementById("UITourHighlight");
+      is_element_hidden(highlight, "Highlight should initially be hidden");
+
+      gContentAPI.showHighlight("urlbar");
+      waitForElementToBeVisible(highlight, done, "Highlight should be shown on a unsecure host when override pref is set");
+
+      Services.prefs.setBoolPref("browser.uitour.requireSecure", true);
+    }, "http://example.org/");
+  },
+  function test_disabled(done) {
+    Services.prefs.setBoolPref("browser.uitour.enabled", false);
+
+    let bookmarksMenu = document.getElementById("bookmarks-menu-button");
+    is(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
+
+    gContentAPI.showMenu("bookmarks");
+    is(bookmarksMenu.open, false, "Bookmark menu should not open when feature is disabled");
+
+    Services.prefs.setBoolPref("browser.uitour.enabled", true);
+    done();
+  },
+  function test_highlight(done) {
+    function test_highlight_2() {
+      let highlight = document.getElementById("UITourHighlight");
+      gContentAPI.hideHighlight();
+
+      waitForElementToBeHidden(highlight, test_highlight_3, "Highlight should be hidden after hideHighlight()");
+    }
+    function test_highlight_3() {
+      is_element_hidden(highlight, "Highlight should be hidden after hideHighlight()");
+
+      gContentAPI.showHighlight("urlbar");
+      waitForElementToBeVisible(highlight, test_highlight_4, "Highlight should be shown after showHighlight()");
+    }
+    function test_highlight_4() {
+      let highlight = document.getElementById("UITourHighlight");
+      gContentAPI.showHighlight("backForward");
+      waitForElementToBeVisible(highlight, done, "Highlight should be shown after showHighlight()");
+    }
+
+    let highlight = document.getElementById("UITourHighlight");
+    is_element_hidden(highlight, "Highlight should initially be hidden");
+
+    gContentAPI.showHighlight("urlbar");
+    waitForElementToBeVisible(highlight, test_highlight_2, "Highlight should be shown after showHighlight()");
+  },
+  function test_highlight_circle(done) {
+    function check_highlight_size() {
+      let panel = highlight.parentElement;
+      let anchor = panel.anchorNode;
+      let anchorRect = anchor.getBoundingClientRect();
+      info("addons target: width: " + anchorRect.width + " height: " + anchorRect.height);
+      let maxDimension = Math.round(Math.max(anchorRect.width, anchorRect.height));
+      let highlightRect = highlight.getBoundingClientRect();
+      info("highlight: width: " + highlightRect.width + " height: " + highlightRect.height);
+      is(Math.round(highlightRect.width), maxDimension, "The width of the highlight should be equal to the largest dimension of the target");
+      is(Math.round(highlightRect.height), maxDimension, "The height of the highlight should be equal to the largest dimension of the target");
+      is(Math.round(highlightRect.height), Math.round(highlightRect.width), "The height and width of the highlight should be the same to create a circle");
+      is(highlight.style.borderRadius, "100%", "The border-radius should be 100% to create a circle");
+      done();
+    }
+    let highlight = document.getElementById("UITourHighlight");
+    is_element_hidden(highlight, "Highlight should initially be hidden");
+
+    gContentAPI.showHighlight("addons");
+    waitForElementToBeVisible(highlight, check_highlight_size, "Highlight should be shown after showHighlight()");
+  },
+  function test_highlight_customize_auto_open_close(done) {
+    let highlight = document.getElementById("UITourHighlight");
+    gContentAPI.showHighlight("customize");
+    waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
+      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
+
+      // Move the highlight outside which should close the app menu.
+      gContentAPI.showHighlight("appMenu");
+      waitForElementToBeVisible(highlight, function checkPanelIsClosed() {
+        isnot(PanelUI.panel.state, "open",
+              "Panel should have closed after the highlight moved elsewhere.");
+        done();
+      }, "Highlight should move to the appMenu button");
+    }, "Highlight should be shown after showHighlight() for fixed panel items");
+  },
+  function test_highlight_customize_manual_open_close(done) {
+    let highlight = document.getElementById("UITourHighlight");
+    // Manually open the app menu then show a highlight there. The menu should remain open.
+    let shownPromise = promisePanelShown(window);
+    gContentAPI.showMenu("appMenu");
+    shownPromise.then(() => {
+      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
+      gContentAPI.showHighlight("customize");
+
+      waitForElementToBeVisible(highlight, function checkPanelIsStillOpen() {
+        isnot(PanelUI.panel.state, "closed", "Panel should still be open");
+
+        // Move the highlight outside which shouldn't close the app menu since it was manually opened.
+        gContentAPI.showHighlight("appMenu");
+        waitForElementToBeVisible(highlight, function () {
+          isnot(PanelUI.panel.state, "closed",
+                "Panel should remain open since UITour didn't open it in the first place");
+          gContentAPI.hideMenu("appMenu");
+          done();
+        }, "Highlight should move to the appMenu button");
+      }, "Highlight should be shown after showHighlight() for fixed panel items");
+    }).then(null, Components.utils.reportError);
+  },
+  function test_highlight_effect(done) {
+    function waitForHighlightWithEffect(highlightEl, effect, next, error) {
+      return waitForCondition(() => highlightEl.getAttribute("active") == effect,
+                              next,
+                              error);
+    }
+    function checkDefaultEffect() {
+      is(highlight.getAttribute("active"), "none", "The default should be no effect");
+
+      gContentAPI.showHighlight("urlbar", "none");
+      waitForHighlightWithEffect(highlight, "none", checkZoomEffect, "There should be no effect");
+    }
+    function checkZoomEffect() {
+      gContentAPI.showHighlight("urlbar", "zoom");
+      waitForHighlightWithEffect(highlight, "zoom", () => {
+        let style = window.getComputedStyle(highlight);
+        is(style.animationName, "uitour-zoom", "The animation-name should be uitour-zoom");
+        checkSameEffectOnDifferentTarget();
+      }, "There should be a zoom effect");
+    }
+    function checkSameEffectOnDifferentTarget() {
+      gContentAPI.showHighlight("appMenu", "wobble");
+      waitForHighlightWithEffect(highlight, "wobble", () => {
+        highlight.addEventListener("animationstart", function onAnimationStart(aEvent) {
+          highlight.removeEventListener("animationstart", onAnimationStart);
+          ok(true, "Animation occurred again even though the effect was the same");
+          checkRandomEffect();
+        });
+        gContentAPI.showHighlight("backForward", "wobble");
+      }, "There should be a wobble effect");
+    }
+    function checkRandomEffect() {
+      function waitForActiveHighlight(highlightEl, next, error) {
+        return waitForCondition(() => highlightEl.hasAttribute("active"),
+                                next,
+                                error);
+      }
+
+      gContentAPI.hideHighlight();
+      gContentAPI.showHighlight("urlbar", "random");
+      waitForActiveHighlight(highlight, () => {
+        ok(highlight.hasAttribute("active"), "The highlight should be active");
+        isnot(highlight.getAttribute("active"), "none", "A random effect other than none should have been chosen");
+        isnot(highlight.getAttribute("active"), "random", "The random effect shouldn't be 'random'");
+        isnot(UITour.highlightEffects.indexOf(highlight.getAttribute("active")), -1, "Check that a supported effect was randomly chosen");
+        done();
+      }, "There should be an active highlight with a random effect");
+    }
+
+    let highlight = document.getElementById("UITourHighlight");
+    is_element_hidden(highlight, "Highlight should initially be hidden");
+
+    gContentAPI.showHighlight("urlbar");
+    waitForElementToBeVisible(highlight, checkDefaultEffect, "Highlight should be shown after showHighlight()");
+  },
+  function test_highlight_effect_unsupported(done) {
+    function checkUnsupportedEffect() {
+      is(highlight.getAttribute("active"), "none", "No effect should be used when an unsupported effect is requested");
+      done();
+    }
+
+    let highlight = document.getElementById("UITourHighlight");
+    is_element_hidden(highlight, "Highlight should initially be hidden");
+
+    gContentAPI.showHighlight("urlbar", "__UNSUPPORTED__");
+    waitForElementToBeVisible(highlight, checkUnsupportedEffect, "Highlight should be shown after showHighlight()");
+  },
+  function test_info_1(done) {
+    let popup = document.getElementById("UITourTooltip");
+    let title = document.getElementById("UITourTooltipTitle");
+    let desc = document.getElementById("UITourTooltipDescription");
+    let icon = document.getElementById("UITourTooltipIcon");
+    let buttons = document.getElementById("UITourTooltipButtons");
+
+    popup.addEventListener("popupshown", function onPopupShown() {
+      popup.removeEventListener("popupshown", onPopupShown);
+      is(popup.popupBoxObject.anchorNode, document.getElementById("urlbar"), "Popup should be anchored to the urlbar");
+      is(title.textContent, "test title", "Popup should have correct title");
+      is(desc.textContent, "test text", "Popup should have correct description text");
+      is(icon.src, "", "Popup should have no icon");
+      is(buttons.hasChildNodes(), false, "Popup should have no buttons");
+
+      popup.addEventListener("popuphidden", function onPopupHidden() {
+        popup.removeEventListener("popuphidden", onPopupHidden);
+
+        popup.addEventListener("popupshown", function onPopupShown() {
+          popup.removeEventListener("popupshown", onPopupShown);
+          done();
+        });
+
+        gContentAPI.showInfo("urlbar", "test title", "test text");
+
+      });
+      gContentAPI.hideInfo();
+    });
+
+    gContentAPI.showInfo("urlbar", "test title", "test text");
+  },
+  taskify(function* test_info_2() {
+    let popup = document.getElementById("UITourTooltip");
+    let title = document.getElementById("UITourTooltipTitle");
+    let desc = document.getElementById("UITourTooltipDescription");
+    let icon = document.getElementById("UITourTooltipIcon");
+    let buttons = document.getElementById("UITourTooltipButtons");
+
+    yield showInfoPromise("urlbar", "urlbar title", "urlbar text");
+
+    is(popup.popupBoxObject.anchorNode, document.getElementById("urlbar"), "Popup should be anchored to the urlbar");
+    is(title.textContent, "urlbar title", "Popup should have correct title");
+    is(desc.textContent, "urlbar text", "Popup should have correct description text");
+    is(icon.src, "", "Popup should have no icon");
+    is(buttons.hasChildNodes(), false, "Popup should have no buttons");
+
+    yield showInfoPromise("search", "search title", "search text");
+
+    is(popup.popupBoxObject.anchorNode, document.getElementById("searchbar"), "Popup should be anchored to the searchbar");
+    is(title.textContent, "search title", "Popup should have correct title");
+    is(desc.textContent, "search text", "Popup should have correct description text");
+  }),
+  function test_getConfigurationVersion(done) {
+    function callback(result) {
+      let props = ["defaultUpdateChannel", "version"];
+      for (let property of props) {
+        ok(typeof(result[property]) !== undefined, "Check " + property + " isn't undefined.");
+        is(result[property], Services.appinfo[property], "Should have the same " + property + " property.");
+      }
+      done();
+    }
+
+    gContentAPI.getConfiguration("appinfo", callback);
+  },
+  function test_addToolbarButton(done) {
+    let placement = CustomizableUI.getPlacementOfWidget("panic-button");
+    is(placement, null, "default UI has panic button in the palette");
+
+    gContentAPI.getConfiguration("availableTargets", (data) => {
+      let available = (data.targets.indexOf("forget") != -1);
+      ok(!available, "Forget button should not be available by default");
+
+      gContentAPI.addNavBarWidget("forget", () => {
+        info("addNavBarWidget callback successfully called");
+
+        let placement = CustomizableUI.getPlacementOfWidget("panic-button");
+        is(placement.area, CustomizableUI.AREA_NAVBAR);
+
+        gContentAPI.getConfiguration("availableTargets", (data) => {
+          let available = (data.targets.indexOf("forget") != -1);
+          ok(available, "Forget button should now be available");
+
+          // Cleanup
+          CustomizableUI.removeWidgetFromArea("panic-button");
+          done();
+        });
+      });
+    });
+  },
+  function test_search(done) {
+    Services.search.init(rv => {
+      if (!Components.isSuccessCode(rv)) {
+        ok(false, "search service init failed: " + rv);
+        done();
+        return;
+      }
+      let defaultEngine = Services.search.defaultEngine;
+      gContentAPI.getConfiguration("search", data => {
+        let visibleEngines = Services.search.getVisibleEngines();
+        let expectedEngines = visibleEngines.filter((engine) => engine.identifier)
+                                            .map((engine) => "searchEngine-" + engine.identifier);
+
+        let engines = data.engines;
+        ok(Array.isArray(engines), "data.engines should be an array");
+        is(engines.sort().toString(), expectedEngines.sort().toString(),
+           "Engines should be as expected");
+
+        is(data.searchEngineIdentifier, defaultEngine.identifier,
+           "the searchEngineIdentifier property should contain the defaultEngine's identifier");
+
+        let someOtherEngineID = data.engines.filter(t => t != "searchEngine-" + defaultEngine.identifier)[0];
+        someOtherEngineID = someOtherEngineID.replace(/^searchEngine-/, "");
+
+        let observe = function (subject, topic, verb) {
+          info("browser-search-engine-modified: " + verb);
+          if (verb == "engine-current") {
+            is(Services.search.defaultEngine.identifier, someOtherEngineID, "correct engine was switched to");
+            done();
+          }
+        };
+        Services.obs.addObserver(observe, "browser-search-engine-modified", false);
+        registerCleanupFunction(() => {
+          // Clean up
+          Services.obs.removeObserver(observe, "browser-search-engine-modified");
+          Services.search.defaultEngine = defaultEngine;
+        });
+
+        gContentAPI.setDefaultSearchEngine(someOtherEngineID);
+      });
+    });
+  },
+  taskify(function* test_treatment_tag() {
+    let ac = new TelemetryArchiveTesting.Checker();
+    yield ac.promiseInit();
+    yield gContentAPI.setTreatmentTag("foobar", "baz");
+    yield new Promise((resolve) => {
+      gContentAPI.getTreatmentTag("foobar", (data) => {
+        is(data.value, "baz", "set and retrieved treatmentTag");
+        ac.promiseFindPing("uitour-tag", [
+          [["payload", "tagName"], "foobar"],
+          [["payload", "tagValue"], "baz"],
+        ]).then((found) => {
+          ok(found, "Telemetry ping submitted for setTreatmentTag");
+          resolve();
+        }, (err) => {
+          ok(false, "Exception finding uitour telemetry ping: " + err);
+          resolve();
+        });
+      });
+    });
+  }),
+
+  // Make sure this test is last in the file so the appMenu gets left open and done will confirm it got tore down.
+  taskify(function* cleanupMenus() {
+    let shownPromise = promisePanelShown(window);
+    gContentAPI.showMenu("appMenu");
+    yield shownPromise;
+  }),
+];
--- a/browser/components/uitour/test/browser_UITour2.js
+++ b/browser/components/uitour/test/browser_UITour2.js
@@ -1,83 +1,83 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-
-function test() {
-  UITourTest();
-}
-
-var tests = [
-  function test_info_customize_auto_open_close(done) {
-    let popup = document.getElementById("UITourTooltip");
-    gContentAPI.showInfo("customize", "Customization", "Customize me please!");
-    UITour.getTarget(window, "customize").then((customizeTarget) => {
-      waitForPopupAtAnchor(popup, customizeTarget.node, function checkPanelIsOpen() {
-        isnot(PanelUI.panel.state, "closed", "Panel should have opened before the popup anchored");
-        ok(PanelUI.panel.hasAttribute("noautohide"), "@noautohide on the menu panel should have been set");
-
-        // Move the info outside which should close the app menu.
-        gContentAPI.showInfo("appMenu", "Open Me", "You know you want to");
-        UITour.getTarget(window, "appMenu").then((target) => {
-          waitForPopupAtAnchor(popup, target.node, function checkPanelIsClosed() {
-            isnot(PanelUI.panel.state, "open",
-                  "Panel should have closed after the info moved elsewhere.");
-            ok(!PanelUI.panel.hasAttribute("noautohide"), "@noautohide on the menu panel should have been cleaned up on close");
-            done();
-          }, "Info should move to the appMenu button");
-        });
-      }, "Info panel should be anchored to the customize button");
-    });
-  },
-  function test_info_customize_manual_open_close(done) {
-    let popup = document.getElementById("UITourTooltip");
-    // Manually open the app menu then show an info panel there. The menu should remain open.
-    let shownPromise = promisePanelShown(window);
-    gContentAPI.showMenu("appMenu");
-    shownPromise.then(() => {
-      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
-      ok(PanelUI.panel.hasAttribute("noautohide"), "@noautohide on the menu panel should have been set");
-      gContentAPI.showInfo("customize", "Customization", "Customize me please!");
-
-      UITour.getTarget(window, "customize").then((customizeTarget) => {
-        waitForPopupAtAnchor(popup, customizeTarget.node, function checkMenuIsStillOpen() {
-          isnot(PanelUI.panel.state, "closed", "Panel should still be open");
-          ok(PanelUI.panel.hasAttribute("noautohide"), "@noautohide on the menu panel should still be set");
-
-          // Move the info outside which shouldn't close the app menu since it was manually opened.
-          gContentAPI.showInfo("appMenu", "Open Me", "You know you want to");
-          UITour.getTarget(window, "appMenu").then((target) => {
-            waitForPopupAtAnchor(popup, target.node, function checkMenuIsStillOpen() {
-              isnot(PanelUI.panel.state, "closed",
-                    "Menu should remain open since UITour didn't open it in the first place");
-              waitForElementToBeHidden(window.PanelUI.panel, () => {
-                ok(!PanelUI.panel.hasAttribute("noautohide"), "@noautohide on the menu panel should have been cleaned up on close");
-                done();
-              });
-              gContentAPI.hideMenu("appMenu");
-            }, "Info should move to the appMenu button");
-          });
-        }, "Info should be shown after showInfo() for fixed menu panel items");
-      });
-    }).then(null, Components.utils.reportError);
-  },
-  taskify(function* test_bookmarks_menu() {
-    let bookmarksMenuButton = document.getElementById("bookmarks-menu-button");
-
-    is(bookmarksMenuButton.open, false, "Menu should initially be closed");
-    gContentAPI.showMenu("bookmarks");
-
-    yield waitForConditionPromise(() => {
-      return bookmarksMenuButton.open;
-    }, "Menu should be visible after showMenu()");
-
-    gContentAPI.hideMenu("bookmarks");
-    yield waitForConditionPromise(() => {
-        return !bookmarksMenuButton.open;
-    }, "Menu should be hidden after hideMenu()");
-  }),
-];
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+
+function test() {
+  UITourTest();
+}
+
+var tests = [
+  function test_info_customize_auto_open_close(done) {
+    let popup = document.getElementById("UITourTooltip");
+    gContentAPI.showInfo("customize", "Customization", "Customize me please!");
+    UITour.getTarget(window, "customize").then((customizeTarget) => {
+      waitForPopupAtAnchor(popup, customizeTarget.node, function checkPanelIsOpen() {
+        isnot(PanelUI.panel.state, "closed", "Panel should have opened before the popup anchored");
+        ok(PanelUI.panel.hasAttribute("noautohide"), "@noautohide on the menu panel should have been set");
+
+        // Move the info outside which should close the app menu.
+        gContentAPI.showInfo("appMenu", "Open Me", "You know you want to");
+        UITour.getTarget(window, "appMenu").then((target) => {
+          waitForPopupAtAnchor(popup, target.node, function checkPanelIsClosed() {
+            isnot(PanelUI.panel.state, "open",
+                  "Panel should have closed after the info moved elsewhere.");
+            ok(!PanelUI.panel.hasAttribute("noautohide"), "@noautohide on the menu panel should have been cleaned up on close");
+            done();
+          }, "Info should move to the appMenu button");
+        });
+      }, "Info panel should be anchored to the customize button");
+    });
+  },
+  function test_info_customize_manual_open_close(done) {
+    let popup = document.getElementById("UITourTooltip");
+    // Manually open the app menu then show an info panel there. The menu should remain open.
+    let shownPromise = promisePanelShown(window);
+    gContentAPI.showMenu("appMenu");
+    shownPromise.then(() => {
+      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
+      ok(PanelUI.panel.hasAttribute("noautohide"), "@noautohide on the menu panel should have been set");
+      gContentAPI.showInfo("customize", "Customization", "Customize me please!");
+
+      UITour.getTarget(window, "customize").then((customizeTarget) => {
+        waitForPopupAtAnchor(popup, customizeTarget.node, function checkMenuIsStillOpen() {
+          isnot(PanelUI.panel.state, "closed", "Panel should still be open");
+          ok(PanelUI.panel.hasAttribute("noautohide"), "@noautohide on the menu panel should still be set");
+
+          // Move the info outside which shouldn't close the app menu since it was manually opened.
+          gContentAPI.showInfo("appMenu", "Open Me", "You know you want to");
+          UITour.getTarget(window, "appMenu").then((target) => {
+            waitForPopupAtAnchor(popup, target.node, function checkMenuIsStillOpen() {
+              isnot(PanelUI.panel.state, "closed",
+                    "Menu should remain open since UITour didn't open it in the first place");
+              waitForElementToBeHidden(window.PanelUI.panel, () => {
+                ok(!PanelUI.panel.hasAttribute("noautohide"), "@noautohide on the menu panel should have been cleaned up on close");
+                done();
+              });
+              gContentAPI.hideMenu("appMenu");
+            }, "Info should move to the appMenu button");
+          });
+        }, "Info should be shown after showInfo() for fixed menu panel items");
+      });
+    }).then(null, Components.utils.reportError);
+  },
+  taskify(function* test_bookmarks_menu() {
+    let bookmarksMenuButton = document.getElementById("bookmarks-menu-button");
+
+    is(bookmarksMenuButton.open, false, "Menu should initially be closed");
+    gContentAPI.showMenu("bookmarks");
+
+    yield waitForConditionPromise(() => {
+      return bookmarksMenuButton.open;
+    }, "Menu should be visible after showMenu()");
+
+    gContentAPI.hideMenu("bookmarks");
+    yield waitForConditionPromise(() => {
+        return !bookmarksMenuButton.open;
+    }, "Menu should be hidden after hideMenu()");
+  }),
+];
--- a/browser/components/uitour/test/browser_UITour3.js
+++ b/browser/components/uitour/test/browser_UITour3.js
@@ -1,182 +1,182 @@
-"use strict";
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-
-requestLongerTimeout(2);
-
-add_task(setup_UITourTest);
-
-add_UITour_task(function* test_info_icon() {
-  let popup = document.getElementById("UITourTooltip");
-  let title = document.getElementById("UITourTooltipTitle");
-  let desc = document.getElementById("UITourTooltipDescription");
-  let icon = document.getElementById("UITourTooltipIcon");
-  let buttons = document.getElementById("UITourTooltipButtons");
-
-  // Disable the animation to prevent the mouse clicks from hitting the main
-  // window during the transition instead of the buttons in the popup.
-  popup.setAttribute("animate", "false");
-
-  yield showInfoPromise("urlbar", "a title", "some text", "image.png");
-
-  is(title.textContent, "a title", "Popup should have correct title");
-  is(desc.textContent, "some text", "Popup should have correct description text");
-
-  let imageURL = getRootDirectory(gTestPath) + "image.png";
-  imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.org/");
-  is(icon.src, imageURL,  "Popup should have correct icon shown");
-
-  is(buttons.hasChildNodes(), false, "Popup should have no buttons");
-}),
-
-add_UITour_task(function* test_info_buttons_1() {
-  let popup = document.getElementById("UITourTooltip");
-  let title = document.getElementById("UITourTooltipTitle");
-  let desc = document.getElementById("UITourTooltipDescription");
-  let icon = document.getElementById("UITourTooltipIcon");
-
-  yield showInfoPromise("urlbar", "another title", "moar text", "./image.png", "makeButtons");
-
-  is(title.textContent, "another title", "Popup should have correct title");
-  is(desc.textContent, "moar text", "Popup should have correct description text");
-
-  let imageURL = getRootDirectory(gTestPath) + "image.png";
-  imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.org/");
-  is(icon.src, imageURL,  "Popup should have correct icon shown");
-
-  let buttons = document.getElementById("UITourTooltipButtons");
-  is(buttons.childElementCount, 4, "Popup should have four buttons");
-
-  is(buttons.childNodes[0].nodeName, "label", "Text label should be a <label>");
-  is(buttons.childNodes[0].getAttribute("value"), "Regular text", "Text label should have correct value");
-  is(buttons.childNodes[0].getAttribute("image"), "", "Text should have no image");
-  is(buttons.childNodes[0].className, "", "Text should have no class");
-
-  is(buttons.childNodes[1].nodeName, "button", "Link should be a <button>");
-  is(buttons.childNodes[1].getAttribute("label"), "Link", "Link should have correct label");
-  is(buttons.childNodes[1].getAttribute("image"), "", "Link should have no image");
-  is(buttons.childNodes[1].className, "button-link", "Check link class");
-
-  is(buttons.childNodes[2].nodeName, "button", "Button 1 should be a <button>");
-  is(buttons.childNodes[2].getAttribute("label"), "Button 1", "First button should have correct label");
-  is(buttons.childNodes[2].getAttribute("image"), "", "First button should have no image");
-  is(buttons.childNodes[2].className, "", "Button 1 should have no class");
-
-  is(buttons.childNodes[3].nodeName, "button", "Button 2 should be a <button>");
-  is(buttons.childNodes[3].getAttribute("label"), "Button 2", "Second button should have correct label");
-  is(buttons.childNodes[3].getAttribute("image"), imageURL, "Second button should have correct image");
-  is(buttons.childNodes[3].className, "button-primary", "Check button 2 class");
-
-  let promiseHidden = promisePanelElementHidden(window, popup);
-  EventUtils.synthesizeMouseAtCenter(buttons.childNodes[2], {}, window);
-  yield promiseHidden;
-
-  ok(true, "Popup should close automatically");
-
-  let returnValue = yield waitForCallbackResultPromise();
-  is(returnValue.result, "button1", "Correct callback should have been called");
-});
-
-add_UITour_task(function* test_info_buttons_2() {
-  let popup = document.getElementById("UITourTooltip");
-  let title = document.getElementById("UITourTooltipTitle");
-  let desc = document.getElementById("UITourTooltipDescription");
-  let icon = document.getElementById("UITourTooltipIcon");
-
-  yield showInfoPromise("urlbar", "another title", "moar text", "./image.png", "makeButtons");
-
-  is(title.textContent, "another title", "Popup should have correct title");
-  is(desc.textContent, "moar text", "Popup should have correct description text");
-
-  let imageURL = getRootDirectory(gTestPath) + "image.png";
-  imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.org/");
-  is(icon.src, imageURL,  "Popup should have correct icon shown");
-
-  let buttons = document.getElementById("UITourTooltipButtons");
-  is(buttons.childElementCount, 4, "Popup should have four buttons");
-
-  is(buttons.childNodes[1].getAttribute("label"), "Link", "Link should have correct label");
-  is(buttons.childNodes[1].getAttribute("image"), "", "Link should have no image");
-  ok(buttons.childNodes[1].classList.contains("button-link"), "Link should have button-link class");
-
-  is(buttons.childNodes[2].getAttribute("label"), "Button 1", "First button should have correct label");
-  is(buttons.childNodes[2].getAttribute("image"), "", "First button should have no image");
-
-  is(buttons.childNodes[3].getAttribute("label"), "Button 2", "Second button should have correct label");
-  is(buttons.childNodes[3].getAttribute("image"), imageURL, "Second button should have correct image");
-
-  let promiseHidden = promisePanelElementHidden(window, popup);
-  EventUtils.synthesizeMouseAtCenter(buttons.childNodes[3], {}, window);
-  yield promiseHidden;
-
-  ok(true, "Popup should close automatically");
-
-  let returnValue = yield waitForCallbackResultPromise();
-
-  is(returnValue.result, "button2", "Correct callback should have been called");
-}),
-
-add_UITour_task(function* test_info_close_button() {
-  let popup = document.getElementById("UITourTooltip");
-  let closeButton = document.getElementById("UITourTooltipClose");
-
-  yield showInfoPromise("urlbar", "Close me", "X marks the spot", null, null, "makeInfoOptions");
-
-  EventUtils.synthesizeMouseAtCenter(closeButton, {}, window);
-
-  let returnValue = yield waitForCallbackResultPromise();
-
-  is(returnValue.result, "closeButton", "Close button callback called");
-}),
-
-add_UITour_task(function* test_info_target_callback() {
-  let popup = document.getElementById("UITourTooltip");
-
-  yield showInfoPromise("appMenu", "I want to know when the target is clicked", "*click*", null, null, "makeInfoOptions");
-
-  yield PanelUI.show();
-
-  let returnValue = yield waitForCallbackResultPromise();
-
-  is(returnValue.result, "target", "target callback called");
-  is(returnValue.data.target, "appMenu", "target callback was from the appMenu");
-  is(returnValue.data.type, "popupshown", "target callback was from the mousedown");
-
-  // Cleanup.
-  yield hideInfoPromise();
-
-  popup.removeAttribute("animate");
-}),
-
-add_UITour_task(function* test_getConfiguration_selectedSearchEngine() {
-  yield new Promise((resolve) => {
-    Services.search.init(Task.async(function*(rv) {
-      ok(Components.isSuccessCode(rv), "Search service initialized");
-      let engine = Services.search.defaultEngine;
-      let data = yield getConfigurationPromise("selectedSearchEngine");
-      is(data.searchEngineIdentifier, engine.identifier, "Correct engine identifier");
-      resolve();
-    }));
-  });
-});
-
-add_UITour_task(function* test_setSearchTerm() {
-  const TERM = "UITour Search Term";
-  yield gContentAPI.setSearchTerm(TERM);
-
-  let searchbar = document.getElementById("searchbar");
-  // The UITour gets to the searchbar element through a promise, so the value setting
-  // only happens after a tick.
-  yield waitForConditionPromise(() => searchbar.value == TERM, "Correct term set");
-});
-
-add_UITour_task(function* test_clearSearchTerm() {
-  yield gContentAPI.setSearchTerm("");
-
-  let searchbar = document.getElementById("searchbar");
-  // The UITour gets to the searchbar element through a promise, so the value setting
-  // only happens after a tick.
-  yield waitForConditionPromise(() => searchbar.value == "", "Search term cleared");
-});
+"use strict";
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+
+requestLongerTimeout(2);
+
+add_task(setup_UITourTest);
+
+add_UITour_task(function* test_info_icon() {
+  let popup = document.getElementById("UITourTooltip");
+  let title = document.getElementById("UITourTooltipTitle");
+  let desc = document.getElementById("UITourTooltipDescription");
+  let icon = document.getElementById("UITourTooltipIcon");
+  let buttons = document.getElementById("UITourTooltipButtons");
+
+  // Disable the animation to prevent the mouse clicks from hitting the main
+  // window during the transition instead of the buttons in the popup.
+  popup.setAttribute("animate", "false");
+
+  yield showInfoPromise("urlbar", "a title", "some text", "image.png");
+
+  is(title.textContent, "a title", "Popup should have correct title");
+  is(desc.textContent, "some text", "Popup should have correct description text");
+
+  let imageURL = getRootDirectory(gTestPath) + "image.png";
+  imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.org/");
+  is(icon.src, imageURL,  "Popup should have correct icon shown");
+
+  is(buttons.hasChildNodes(), false, "Popup should have no buttons");
+}),
+
+add_UITour_task(function* test_info_buttons_1() {
+  let popup = document.getElementById("UITourTooltip");
+  let title = document.getElementById("UITourTooltipTitle");
+  let desc = document.getElementById("UITourTooltipDescription");
+  let icon = document.getElementById("UITourTooltipIcon");
+
+  yield showInfoPromise("urlbar", "another title", "moar text", "./image.png", "makeButtons");
+
+  is(title.textContent, "another title", "Popup should have correct title");
+  is(desc.textContent, "moar text", "Popup should have correct description text");
+
+  let imageURL = getRootDirectory(gTestPath) + "image.png";
+  imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.org/");
+  is(icon.src, imageURL,  "Popup should have correct icon shown");
+
+  let buttons = document.getElementById("UITourTooltipButtons");
+  is(buttons.childElementCount, 4, "Popup should have four buttons");
+
+  is(buttons.childNodes[0].nodeName, "label", "Text label should be a <label>");
+  is(buttons.childNodes[0].getAttribute("value"), "Regular text", "Text label should have correct value");
+  is(buttons.childNodes[0].getAttribute("image"), "", "Text should have no image");
+  is(buttons.childNodes[0].className, "", "Text should have no class");
+
+  is(buttons.childNodes[1].nodeName, "button", "Link should be a <button>");
+  is(buttons.childNodes[1].getAttribute("label"), "Link", "Link should have correct label");
+  is(buttons.childNodes[1].getAttribute("image"), "", "Link should have no image");
+  is(buttons.childNodes[1].className, "button-link", "Check link class");
+
+  is(buttons.childNodes[2].nodeName, "button", "Button 1 should be a <button>");
+  is(buttons.childNodes[2].getAttribute("label"), "Button 1", "First button should have correct label");
+  is(buttons.childNodes[2].getAttribute("image"), "", "First button should have no image");
+  is(buttons.childNodes[2].className, "", "Button 1 should have no class");
+
+  is(buttons.childNodes[3].nodeName, "button", "Button 2 should be a <button>");
+  is(buttons.childNodes[3].getAttribute("label"), "Button 2", "Second button should have correct label");
+  is(buttons.childNodes[3].getAttribute("image"), imageURL, "Second button should have correct image");
+  is(buttons.childNodes[3].className, "button-primary", "Check button 2 class");
+
+  let promiseHidden = promisePanelElementHidden(window, popup);
+  EventUtils.synthesizeMouseAtCenter(buttons.childNodes[2], {}, window);
+  yield promiseHidden;
+
+  ok(true, "Popup should close automatically");
+
+  let returnValue = yield waitForCallbackResultPromise();
+  is(returnValue.result, "button1", "Correct callback should have been called");
+});
+
+add_UITour_task(function* test_info_buttons_2() {
+  let popup = document.getElementById("UITourTooltip");
+  let title = document.getElementById("UITourTooltipTitle");
+  let desc = document.getElementById("UITourTooltipDescription");
+  let icon = document.getElementById("UITourTooltipIcon");
+
+  yield showInfoPromise("urlbar", "another title", "moar text", "./image.png", "makeButtons");
+
+  is(title.textContent, "another title", "Popup should have correct title");
+  is(desc.textContent, "moar text", "Popup should have correct description text");
+
+  let imageURL = getRootDirectory(gTestPath) + "image.png";
+  imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.org/");
+  is(icon.src, imageURL,  "Popup should have correct icon shown");
+
+  let buttons = document.getElementById("UITourTooltipButtons");
+  is(buttons.childElementCount, 4, "Popup should have four buttons");
+
+  is(buttons.childNodes[1].getAttribute("label"), "Link", "Link should have correct label");
+  is(buttons.childNodes[1].getAttribute("image"), "", "Link should have no image");
+  ok(buttons.childNodes[1].classList.contains("button-link"), "Link should have button-link class");
+
+  is(buttons.childNodes[2].getAttribute("label"), "Button 1", "First button should have correct label");
+  is(buttons.childNodes[2].getAttribute("image"), "", "First button should have no image");
+
+  is(buttons.childNodes[3].getAttribute("label"), "Button 2", "Second button should have correct label");
+  is(buttons.childNodes[3].getAttribute("image"), imageURL, "Second button should have correct image");
+
+  let promiseHidden = promisePanelElementHidden(window, popup);
+  EventUtils.synthesizeMouseAtCenter(buttons.childNodes[3], {}, window);
+  yield promiseHidden;
+
+  ok(true, "Popup should close automatically");
+
+  let returnValue = yield waitForCallbackResultPromise();
+
+  is(returnValue.result, "button2", "Correct callback should have been called");
+}),
+
+add_UITour_task(function* test_info_close_button() {
+  let popup = document.getElementById("UITourTooltip");
+  let closeButton = document.getElementById("UITourTooltipClose");
+
+  yield showInfoPromise("urlbar", "Close me", "X marks the spot", null, null, "makeInfoOptions");
+
+  EventUtils.synthesizeMouseAtCenter(closeButton, {}, window);
+
+  let returnValue = yield waitForCallbackResultPromise();
+
+  is(returnValue.result, "closeButton", "Close button callback called");
+}),
+
+add_UITour_task(function* test_info_target_callback() {
+  let popup = document.getElementById("UITourTooltip");
+
+  yield showInfoPromise("appMenu", "I want to know when the target is clicked", "*click*", null, null, "makeInfoOptions");
+
+  yield PanelUI.show();
+
+  let returnValue = yield waitForCallbackResultPromise();
+
+  is(returnValue.result, "target", "target callback called");
+  is(returnValue.data.target, "appMenu", "target callback was from the appMenu");
+  is(returnValue.data.type, "popupshown", "target callback was from the mousedown");
+
+  // Cleanup.
+  yield hideInfoPromise();
+
+  popup.removeAttribute("animate");
+}),
+
+add_UITour_task(function* test_getConfiguration_selectedSearchEngine() {
+  yield new Promise((resolve) => {
+    Services.search.init(Task.async(function*(rv) {
+      ok(Components.isSuccessCode(rv), "Search service initialized");
+      let engine = Services.search.defaultEngine;
+      let data = yield getConfigurationPromise("selectedSearchEngine");
+      is(data.searchEngineIdentifier, engine.identifier, "Correct engine identifier");
+      resolve();
+    }));
+  });
+});
+
+add_UITour_task(function* test_setSearchTerm() {
+  const TERM = "UITour Search Term";
+  yield gContentAPI.setSearchTerm(TERM);
+
+  let searchbar = document.getElementById("searchbar");
+  // The UITour gets to the searchbar element through a promise, so the value setting
+  // only happens after a tick.
+  yield waitForConditionPromise(() => searchbar.value == TERM, "Correct term set");
+});
+
+add_UITour_task(function* test_clearSearchTerm() {
+  yield gContentAPI.setSearchTerm("");
+
+  let searchbar = document.getElementById("searchbar");
+  // The UITour gets to the searchbar element through a promise, so the value setting
+  // only happens after a tick.
+  yield waitForConditionPromise(() => searchbar.value == "", "Search term cleared");
+});
--- a/browser/components/uitour/test/browser_UITour_defaultBrowser.js
+++ b/browser/components/uitour/test/browser_UITour_defaultBrowser.js
@@ -1,61 +1,61 @@
-"use strict";
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-var setDefaultBrowserCalled = false;
-
-Cc["@mozilla.org/moz/jssubscript-loader;1"]
-  .getService(Ci.mozIJSSubScriptLoader)
-  .loadSubScript("chrome://mochikit/content/tests/SimpleTest/MockObjects.js", this);
-
-function MockShellService() {};
-MockShellService.prototype = {
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIShellService]),
-  isDefaultBrowser: function(aStartupCheck, aForAllTypes) { return false; },
-  setDefaultBrowser: function(aClaimAllTypes, aForAllUsers) {
-    setDefaultBrowserCalled = true;
-  },
-  shouldCheckDefaultBrowser: false,
-  canSetDesktopBackground: false,
-  BACKGROUND_TILE      : 1,
-  BACKGROUND_STRETCH   : 2,
-  BACKGROUND_CENTER    : 3,
-  BACKGROUND_FILL      : 4,
-  BACKGROUND_FIT       : 5,
-  setDesktopBackground: function(aElement, aPosition) {},
-  APPLICATION_MAIL : 0,
-  APPLICATION_NEWS : 1,
-  openApplication: function(aApplication) {},
-  desktopBackgroundColor: 0,
-  openApplicationWithURI: function(aApplication, aURI) {},
-  defaultFeedReader: 0,
-};
-
-var mockShellService = new MockObjectRegisterer("@mozilla.org/browser/shell-service;1",
-                                                MockShellService);
-
-// Temporarily disabled, see note at test_setDefaultBrowser.
-// mockShellService.register();
-
-add_task(setup_UITourTest);
-
-/* This test is disabled (bug 1180714) since the MockObjectRegisterer
- is not actually replacing the original ShellService.
-add_UITour_task(function* test_setDefaultBrowser() {
-  try {
-    yield gContentAPI.setConfiguration("defaultBrowser");
-    ok(setDefaultBrowserCalled, "setDefaultBrowser called");
-  } finally {
-    mockShellService.unregister();
-  }
-});
-*/
-
-add_UITour_task(function* test_isDefaultBrowser() {
-  let shell = Components.classes["@mozilla.org/browser/shell-service;1"]
-        .getService(Components.interfaces.nsIShellService);
-  let isDefault = shell.isDefaultBrowser(false);
-  let data = yield getConfigurationPromise("appinfo");
-  is(isDefault, data.defaultBrowser, "gContentAPI result should match shellService.isDefaultBrowser");
-});
+"use strict";
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+var setDefaultBrowserCalled = false;
+
+Cc["@mozilla.org/moz/jssubscript-loader;1"]
+  .getService(Ci.mozIJSSubScriptLoader)
+  .loadSubScript("chrome://mochikit/content/tests/SimpleTest/MockObjects.js", this);
+
+function MockShellService() {};
+MockShellService.prototype = {
+  QueryInterface: XPCOMUtils.generateQI([Ci.nsIShellService]),
+  isDefaultBrowser: function(aStartupCheck, aForAllTypes) { return false; },
+  setDefaultBrowser: function(aClaimAllTypes, aForAllUsers) {
+    setDefaultBrowserCalled = true;
+  },
+  shouldCheckDefaultBrowser: false,
+  canSetDesktopBackground: false,
+  BACKGROUND_TILE      : 1,
+  BACKGROUND_STRETCH   : 2,
+  BACKGROUND_CENTER    : 3,
+  BACKGROUND_FILL      : 4,
+  BACKGROUND_FIT       : 5,
+  setDesktopBackground: function(aElement, aPosition) {},
+  APPLICATION_MAIL : 0,
+  APPLICATION_NEWS : 1,
+  openApplication: function(aApplication) {},
+  desktopBackgroundColor: 0,
+  openApplicationWithURI: function(aApplication, aURI) {},
+  defaultFeedReader: 0,
+};
+
+var mockShellService = new MockObjectRegisterer("@mozilla.org/browser/shell-service;1",
+                                                MockShellService);
+
+// Temporarily disabled, see note at test_setDefaultBrowser.
+// mockShellService.register();
+
+add_task(setup_UITourTest);
+
+/* This test is disabled (bug 1180714) since the MockObjectRegisterer
+ is not actually replacing the original ShellService.
+add_UITour_task(function* test_setDefaultBrowser() {
+  try {
+    yield gContentAPI.setConfiguration("defaultBrowser");
+    ok(setDefaultBrowserCalled, "setDefaultBrowser called");
+  } finally {
+    mockShellService.unregister();
+  }
+});
+*/
+
+add_UITour_task(function* test_isDefaultBrowser() {
+  let shell = Components.classes["@mozilla.org/browser/shell-service;1"]
+        .getService(Components.interfaces.nsIShellService);
+  let isDefault = shell.isDefaultBrowser(false);
+  let data = yield getConfigurationPromise("appinfo");
+  is(isDefault, data.defaultBrowser, "gContentAPI result should match shellService.isDefaultBrowser");
+});
--- a/browser/components/uitour/test/browser_UITour_forceReaderMode.js
+++ b/browser/components/uitour/test/browser_UITour_forceReaderMode.js
@@ -1,17 +1,17 @@
-"use strict";
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-
-add_task(setup_UITourTest);
-
-add_UITour_task(function*() {
-  ok(!gBrowser.selectedBrowser.isArticle, "Should not be an article when we start");
-  ok(document.getElementById("reader-mode-button").hidden, "Button should be hidden.");
-  yield gContentAPI.forceShowReaderIcon();
-  yield waitForConditionPromise(() => gBrowser.selectedBrowser.isArticle);
-  ok(gBrowser.selectedBrowser.isArticle, "Should suddenly be an article.");
-  ok(!document.getElementById("reader-mode-button").hidden, "Button should now be visible.");
-});
-
+"use strict";
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+
+add_task(setup_UITourTest);
+
+add_UITour_task(function*() {
+  ok(!gBrowser.selectedBrowser.isArticle, "Should not be an article when we start");
+  ok(document.getElementById("reader-mode-button").hidden, "Button should be hidden.");
+  yield gContentAPI.forceShowReaderIcon();
+  yield waitForConditionPromise(() => gBrowser.selectedBrowser.isArticle);
+  ok(gBrowser.selectedBrowser.isArticle, "Should suddenly be an article.");
+  ok(!document.getElementById("reader-mode-button").hidden, "Button should now be visible.");
+});
+
--- a/browser/components/uitour/test/browser_UITour_panel_close_annotation.js
+++ b/browser/components/uitour/test/browser_UITour_panel_close_annotation.js
@@ -1,153 +1,153 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests that annotations disappear when their target is hidden.
- */
-
-"use strict";
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-var highlight = document.getElementById("UITourHighlight");
-var tooltip = document.getElementById("UITourTooltip");
-
-function test() {
-  registerCleanupFunction(() => {
-    // Close the find bar in case it's open in the remaining tab
-    gBrowser.getFindBar(gBrowser.selectedTab).close();
-  });
-  UITourTest();
-}
-
-var tests = [
-  function test_highlight_move_outside_panel(done) {
-    gContentAPI.showInfo("urlbar", "test title", "test text");
-    gContentAPI.showHighlight("customize");
-    waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
-      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
-
-      // Move the highlight outside which should close the app menu.
-      gContentAPI.showHighlight("appMenu");
-      waitForPopupAtAnchor(highlight.parentElement, document.getElementById("PanelUI-button"), () => {
-        isnot(PanelUI.panel.state, "open",
-              "Panel should have closed after the highlight moved elsewhere.");
-        ok(tooltip.state == "showing" || tooltip.state == "open", "The info panel should have remained open");
-        done();
-      }, "Highlight should move to the appMenu button and still be visible");
-    }, "Highlight should be shown after showHighlight() for fixed panel items");
-  },
-
-  function test_highlight_panel_hideMenu(done) {
-    gContentAPI.showHighlight("customize");
-    gContentAPI.showInfo("search", "test title", "test text");
-    waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
-      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
-
-      // Close the app menu and make sure the highlight also disappeared.
-      gContentAPI.hideMenu("appMenu");
-      waitForElementToBeHidden(highlight, function checkPanelIsClosed() {
-        isnot(PanelUI.panel.state, "open",
-              "Panel still should have closed");
-        ok(tooltip.state == "showing" || tooltip.state == "open", "The info panel should have remained open");
-        done();
-      }, "Highlight should have disappeared when panel closed");
-    }, "Highlight should be shown after showHighlight() for fixed panel items");
-  },
-
-  function test_highlight_panel_click_find(done) {
-    gContentAPI.showHighlight("help");
-    gContentAPI.showInfo("searchIcon", "test title", "test text");
-    waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
-      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
-
-      // Click the find button which should close the panel.
-      let findButton = document.getElementById("find-button");
-      EventUtils.synthesizeMouseAtCenter(findButton, {});
-      waitForElementToBeHidden(highlight, function checkPanelIsClosed() {
-        isnot(PanelUI.panel.state, "open",
-              "Panel should have closed when the find bar opened");
-        ok(tooltip.state == "showing" || tooltip.state == "open", "The info panel should have remained open");
-        done();
-      }, "Highlight should have disappeared when panel closed");
-    }, "Highlight should be shown after showHighlight() for fixed panel items");
-  },
-
-  function test_highlight_info_panel_click_find(done) {
-    gContentAPI.showHighlight("help");
-    gContentAPI.showInfo("customize", "customize me!", "awesome!");
-    waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
-      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
-
-      // Click the find button which should close the panel.
-      let findButton = document.getElementById("find-button");
-      EventUtils.synthesizeMouseAtCenter(findButton, {});
-      waitForElementToBeHidden(highlight, function checkPanelIsClosed() {
-        isnot(PanelUI.panel.state, "open",
-              "Panel should have closed when the find bar opened");
-        waitForElementToBeHidden(tooltip, function checkTooltipIsClosed() {
-          isnot(tooltip.state, "open", "The info panel should have closed too");
-          done();
-        }, "Tooltip should hide with the menu");
-      }, "Highlight should have disappeared when panel closed");
-    }, "Highlight should be shown after showHighlight() for fixed panel items");
-  },
-
-  function test_highlight_panel_open_subview(done) {
-    gContentAPI.showHighlight("customize");
-    gContentAPI.showInfo("backForward", "test title", "test text");
-    waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
-      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
-
-      // Click the help button which should open the subview in the panel menu.
-      let helpButton = document.getElementById("PanelUI-help");
-      EventUtils.synthesizeMouseAtCenter(helpButton, {});
-      waitForElementToBeHidden(highlight, function highlightHidden() {
-        is(PanelUI.panel.state, "open",
-           "Panel should have stayed open when the subview opened");
-        ok(tooltip.state == "showing" || tooltip.state == "open", "The info panel should have remained open");
-        PanelUI.hide();
-        done();
-      }, "Highlight should have disappeared when the subview opened");
-    }, "Highlight should be shown after showHighlight() for fixed panel items");
-  },
-
-  function test_info_panel_open_subview(done) {
-    gContentAPI.showHighlight("urlbar");
-    gContentAPI.showInfo("customize", "customize me!", "Open a subview");
-    waitForElementToBeVisible(tooltip, function checkPanelIsOpen() {
-      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
-
-      // Click the help button which should open the subview in the panel menu.
-      let helpButton = document.getElementById("PanelUI-help");
-      EventUtils.synthesizeMouseAtCenter(helpButton, {});
-      waitForElementToBeHidden(tooltip, function tooltipHidden() {
-        is(PanelUI.panel.state, "open",
-           "Panel should have stayed open when the subview opened");
-        is(highlight.parentElement.state, "open", "The highlight should have remained open");
-        PanelUI.hide();
-        done();
-      }, "Tooltip should have disappeared when the subview opened");
-    }, "Highlight should be shown after showHighlight() for fixed panel items");
-  },
-
-  function test_info_move_outside_panel(done) {
-    gContentAPI.showInfo("addons", "test title", "test text");
-    gContentAPI.showHighlight("urlbar");
-    let addonsButton = document.getElementById("add-ons-button");
-    waitForPopupAtAnchor(tooltip, addonsButton, function checkPanelIsOpen() {
-      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
-
-      // Move the info panel outside which should close the app menu.
-      gContentAPI.showInfo("appMenu", "Cool menu button", "It's three lines");
-      waitForPopupAtAnchor(tooltip, document.getElementById("PanelUI-button"), () => {
-        isnot(PanelUI.panel.state, "open",
-              "Menu should have closed after the highlight moved elsewhere.");
-        is(highlight.parentElement.state, "open", "The highlight should have remained visible");
-        done();
-      }, "Tooltip should move to the appMenu button and still be visible");
-    }, "Tooltip should be shown after showInfo() for a panel item");
-  },
-
-];
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Tests that annotations disappear when their target is hidden.
+ */
+
+"use strict";
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+var highlight = document.getElementById("UITourHighlight");
+var tooltip = document.getElementById("UITourTooltip");
+
+function test() {
+  registerCleanupFunction(() => {
+    // Close the find bar in case it's open in the remaining tab
+    gBrowser.getFindBar(gBrowser.selectedTab).close();
+  });
+  UITourTest();
+}
+
+var tests = [
+  function test_highlight_move_outside_panel(done) {
+    gContentAPI.showInfo("urlbar", "test title", "test text");
+    gContentAPI.showHighlight("customize");
+    waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
+      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
+
+      // Move the highlight outside which should close the app menu.
+      gContentAPI.showHighlight("appMenu");
+      waitForPopupAtAnchor(highlight.parentElement, document.getElementById("PanelUI-button"), () => {
+        isnot(PanelUI.panel.state, "open",
+              "Panel should have closed after the highlight moved elsewhere.");
+        ok(tooltip.state == "showing" || tooltip.state == "open", "The info panel should have remained open");
+        done();
+      }, "Highlight should move to the appMenu button and still be visible");
+    }, "Highlight should be shown after showHighlight() for fixed panel items");
+  },
+
+  function test_highlight_panel_hideMenu(done) {
+    gContentAPI.showHighlight("customize");
+    gContentAPI.showInfo("search", "test title", "test text");
+    waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
+      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
+
+      // Close the app menu and make sure the highlight also disappeared.
+      gContentAPI.hideMenu("appMenu");
+      waitForElementToBeHidden(highlight, function checkPanelIsClosed() {
+        isnot(PanelUI.panel.state, "open",
+              "Panel still should have closed");
+        ok(tooltip.state == "showing" || tooltip.state == "open", "The info panel should have remained open");
+        done();
+      }, "Highlight should have disappeared when panel closed");
+    }, "Highlight should be shown after showHighlight() for fixed panel items");
+  },
+
+  function test_highlight_panel_click_find(done) {
+    gContentAPI.showHighlight("help");
+    gContentAPI.showInfo("searchIcon", "test title", "test text");
+    waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
+      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
+
+      // Click the find button which should close the panel.
+      let findButton = document.getElementById("find-button");
+      EventUtils.synthesizeMouseAtCenter(findButton, {});
+      waitForElementToBeHidden(highlight, function checkPanelIsClosed() {
+        isnot(PanelUI.panel.state, "open",
+              "Panel should have closed when the find bar opened");
+        ok(tooltip.state == "showing" || tooltip.state == "open", "The info panel should have remained open");
+        done();
+      }, "Highlight should have disappeared when panel closed");
+    }, "Highlight should be shown after showHighlight() for fixed panel items");
+  },
+
+  function test_highlight_info_panel_click_find(done) {
+    gContentAPI.showHighlight("help");
+    gContentAPI.showInfo("customize", "customize me!", "awesome!");
+    waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
+      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
+
+      // Click the find button which should close the panel.
+      let findButton = document.getElementById("find-button");
+      EventUtils.synthesizeMouseAtCenter(findButton, {});
+      waitForElementToBeHidden(highlight, function checkPanelIsClosed() {
+        isnot(PanelUI.panel.state, "open",
+              "Panel should have closed when the find bar opened");
+        waitForElementToBeHidden(tooltip, function checkTooltipIsClosed() {
+          isnot(tooltip.state, "open", "The info panel should have closed too");
+          done();
+        }, "Tooltip should hide with the menu");
+      }, "Highlight should have disappeared when panel closed");
+    }, "Highlight should be shown after showHighlight() for fixed panel items");
+  },
+
+  function test_highlight_panel_open_subview(done) {
+    gContentAPI.showHighlight("customize");
+    gContentAPI.showInfo("backForward", "test title", "test text");
+    waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
+      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
+
+      // Click the help button which should open the subview in the panel menu.
+      let helpButton = document.getElementById("PanelUI-help");
+      EventUtils.synthesizeMouseAtCenter(helpButton, {});
+      waitForElementToBeHidden(highlight, function highlightHidden() {
+        is(PanelUI.panel.state, "open",
+           "Panel should have stayed open when the subview opened");
+        ok(tooltip.state == "showing" || tooltip.state == "open", "The info panel should have remained open");
+        PanelUI.hide();
+        done();
+      }, "Highlight should have disappeared when the subview opened");
+    }, "Highlight should be shown after showHighlight() for fixed panel items");
+  },
+
+  function test_info_panel_open_subview(done) {
+    gContentAPI.showHighlight("urlbar");
+    gContentAPI.showInfo("customize", "customize me!", "Open a subview");
+    waitForElementToBeVisible(tooltip, function checkPanelIsOpen() {
+      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
+
+      // Click the help button which should open the subview in the panel menu.
+      let helpButton = document.getElementById("PanelUI-help");
+      EventUtils.synthesizeMouseAtCenter(helpButton, {});
+      waitForElementToBeHidden(tooltip, function tooltipHidden() {
+        is(PanelUI.panel.state, "open",
+           "Panel should have stayed open when the subview opened");
+        is(highlight.parentElement.state, "open", "The highlight should have remained open");
+        PanelUI.hide();
+        done();
+      }, "Tooltip should have disappeared when the subview opened");
+    }, "Highlight should be shown after showHighlight() for fixed panel items");
+  },
+
+  function test_info_move_outside_panel(done) {
+    gContentAPI.showInfo("addons", "test title", "test text");
+    gContentAPI.showHighlight("urlbar");
+    let addonsButton = document.getElementById("add-ons-button");
+    waitForPopupAtAnchor(tooltip, addonsButton, function checkPanelIsOpen() {
+      isnot(PanelUI.panel.state, "closed", "Panel should have opened");
+
+      // Move the info panel outside which should close the app menu.
+      gContentAPI.showInfo("appMenu", "Cool menu button", "It's three lines");
+      waitForPopupAtAnchor(tooltip, document.getElementById("PanelUI-button"), () => {
+        isnot(PanelUI.panel.state, "open",
+              "Menu should have closed after the highlight moved elsewhere.");
+        is(highlight.parentElement.state, "open", "The highlight should have remained visible");
+        done();
+      }, "Tooltip should move to the appMenu button and still be visible");
+    }, "Tooltip should be shown after showInfo() for a panel item");
+  },
+
+];
--- a/browser/components/uitour/test/browser_UITour_registerPageID.js
+++ b/browser/components/uitour/test/browser_UITour_registerPageID.js
@@ -1,108 +1,108 @@
-"use strict";
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-
-Components.utils.import("resource://gre/modules/UITelemetry.jsm");
-Components.utils.import("resource:///modules/BrowserUITelemetry.jsm");
-
-add_task(function* setup_telemetry() {
-  UITelemetry._enabled = true;
-
-  registerCleanupFunction(function() {
-    Services.prefs.clearUserPref("browser.uitour.seenPageIDs");
-    resetSeenPageIDsLazyGetter();
-    UITelemetry._enabled = undefined;
-    BrowserUITelemetry.setBucket(null);
-    delete window.UITelemetry;
-    delete window.BrowserUITelemetry;
-  });
-});
-
-add_task(setup_UITourTest);
-
-function resetSeenPageIDsLazyGetter() {
-  delete UITour.seenPageIDs;
-  // This should be kept in sync with how UITour.init() sets this.
-  Object.defineProperty(UITour, "seenPageIDs", {
-    get: UITour.restoreSeenPageIDs.bind(UITour),
-    configurable: true,
-  });
-}
-
-function checkExpectedSeenPageIDs(expected) {
-  is(UITour.seenPageIDs.size, expected.length, "Should be " + expected.length + " total seen page IDs");
-
-  for (let id of expected)
-    ok(UITour.seenPageIDs.has(id), "Should have seen '" + id + "' page ID");
-
-  let prefData = Services.prefs.getCharPref("browser.uitour.seenPageIDs");
-  prefData = new Map(JSON.parse(prefData));
-
-  is(prefData.size, expected.length, "Should be " + expected.length + " total seen page IDs persisted");
-
-  for (let id of expected)
-    ok(prefData.has(id), "Should have seen '" + id + "' page ID persisted");
-}
-
-
-add_UITour_task(function test_seenPageIDs_restore() {
-  info("Setting up seenPageIDs to be restored from pref");
-  let data = JSON.stringify([
-    ["savedID1", { lastSeen: Date.now() }],
-    ["savedID2", { lastSeen: Date.now() }],
-    // 9 weeks ago, should auto expire.
-    ["savedID3", { lastSeen: Date.now() - 9 * 7 * 24 * 60 * 60 * 1000 }],
-  ]);
-  Services.prefs.setCharPref("browser.uitour.seenPageIDs",
-                             data);
-
-  resetSeenPageIDsLazyGetter();
-  checkExpectedSeenPageIDs(["savedID1", "savedID2"]);
-});
-
-add_UITour_task(function* test_seenPageIDs_set_1() {
-  yield gContentAPI.registerPageID("testpage1");
-
-  yield waitForConditionPromise(() => UITour.seenPageIDs.size == 3, "Waiting for page to be registered.");
-
-  checkExpectedSeenPageIDs(["savedID1", "savedID2", "testpage1"]);
-
-  const PREFIX = BrowserUITelemetry.BUCKET_PREFIX;
-  const SEP = BrowserUITelemetry.BUCKET_SEPARATOR;
-
-  let bucket = PREFIX + "UITour" + SEP + "testpage1";
-  is(BrowserUITelemetry.currentBucket, bucket, "Bucket should have correct name");
-
-  gBrowser.selectedTab = gBrowser.addTab("about:blank");
-  bucket = PREFIX + "UITour" + SEP + "testpage1" + SEP + "inactive" + SEP + "1m";
-  is(BrowserUITelemetry.currentBucket, bucket,
-     "After switching tabs, bucket should be expiring");
-
-  gBrowser.removeTab(gBrowser.selectedTab);
-  gBrowser.selectedTab = gTestTab;
-  BrowserUITelemetry.setBucket(null);
-});
-
-add_UITour_task(function* test_seenPageIDs_set_2() {
-  yield gContentAPI.registerPageID("testpage2");
-
-  yield waitForConditionPromise(() => UITour.seenPageIDs.size == 4, "Waiting for page to be registered.");
-
-  checkExpectedSeenPageIDs(["savedID1", "savedID2", "testpage1", "testpage2"]);
-
-  const PREFIX = BrowserUITelemetry.BUCKET_PREFIX;
-  const SEP = BrowserUITelemetry.BUCKET_SEPARATOR;
-
-  let bucket = PREFIX + "UITour" + SEP + "testpage2";
-  is(BrowserUITelemetry.currentBucket, bucket, "Bucket should have correct name");
-
-  gBrowser.removeTab(gTestTab);
-  gTestTab = null;
-  bucket = PREFIX + "UITour" + SEP + "testpage2" + SEP + "closed" + SEP + "1m";
-  is(BrowserUITelemetry.currentBucket, bucket,
-     "After closing tab, bucket should be expiring");
-
-  BrowserUITelemetry.setBucket(null);
-});
+"use strict";
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+
+Components.utils.import("resource://gre/modules/UITelemetry.jsm");
+Components.utils.import("resource:///modules/BrowserUITelemetry.jsm");
+
+add_task(function* setup_telemetry() {
+  UITelemetry._enabled = true;
+
+  registerCleanupFunction(function() {
+    Services.prefs.clearUserPref("browser.uitour.seenPageIDs");
+    resetSeenPageIDsLazyGetter();
+    UITelemetry._enabled = undefined;
+    BrowserUITelemetry.setBucket(null);
+    delete window.UITelemetry;
+    delete window.BrowserUITelemetry;
+  });
+});
+
+add_task(setup_UITourTest);
+
+function resetSeenPageIDsLazyGetter() {
+  delete UITour.seenPageIDs;
+  // This should be kept in sync with how UITour.init() sets this.
+  Object.defineProperty(UITour, "seenPageIDs", {
+    get: UITour.restoreSeenPageIDs.bind(UITour),
+    configurable: true,
+  });
+}
+
+function checkExpectedSeenPageIDs(expected) {
+  is(UITour.seenPageIDs.size, expected.length, "Should be " + expected.length + " total seen page IDs");
+
+  for (let id of expected)
+    ok(UITour.seenPageIDs.has(id), "Should have seen '" + id + "' page ID");
+
+  let prefData = Services.prefs.getCharPref("browser.uitour.seenPageIDs");
+  prefData = new Map(JSON.parse(prefData));
+
+  is(prefData.size, expected.length, "Should be " + expected.length + " total seen page IDs persisted");
+
+  for (let id of expected)
+    ok(prefData.has(id), "Should have seen '" + id + "' page ID persisted");
+}
+
+
+add_UITour_task(function test_seenPageIDs_restore() {
+  info("Setting up seenPageIDs to be restored from pref");
+  let data = JSON.stringify([
+    ["savedID1", { lastSeen: Date.now() }],
+    ["savedID2", { lastSeen: Date.now() }],
+    // 9 weeks ago, should auto expire.
+    ["savedID3", { lastSeen: Date.now() - 9 * 7 * 24 * 60 * 60 * 1000 }],
+  ]);
+  Services.prefs.setCharPref("browser.uitour.seenPageIDs",
+                             data);
+
+  resetSeenPageIDsLazyGetter();
+  checkExpectedSeenPageIDs(["savedID1", "savedID2"]);
+});
+
+add_UITour_task(function* test_seenPageIDs_set_1() {
+  yield gContentAPI.registerPageID("testpage1");
+
+  yield waitForConditionPromise(() => UITour.seenPageIDs.size == 3, "Waiting for page to be registered.");
+
+  checkExpectedSeenPageIDs(["savedID1", "savedID2", "testpage1"]);
+
+  const PREFIX = BrowserUITelemetry.BUCKET_PREFIX;
+  const SEP = BrowserUITelemetry.BUCKET_SEPARATOR;
+
+  let bucket = PREFIX + "UITour" + SEP + "testpage1";
+  is(BrowserUITelemetry.currentBucket, bucket, "Bucket should have correct name");
+
+  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  bucket = PREFIX + "UITour" + SEP + "testpage1" + SEP + "inactive" + SEP + "1m";
+  is(BrowserUITelemetry.currentBucket, bucket,
+     "After switching tabs, bucket should be expiring");
+
+  gBrowser.removeTab(gBrowser.selectedTab);
+  gBrowser.selectedTab = gTestTab;
+  BrowserUITelemetry.setBucket(null);
+});
+
+add_UITour_task(function* test_seenPageIDs_set_2() {
+  yield gContentAPI.registerPageID("testpage2");
+
+  yield waitForConditionPromise(() => UITour.seenPageIDs.size == 4, "Waiting for page to be registered.");
+
+  checkExpectedSeenPageIDs(["savedID1", "savedID2", "testpage1", "testpage2"]);
+
+  const PREFIX = BrowserUITelemetry.BUCKET_PREFIX;
+  const SEP = BrowserUITelemetry.BUCKET_SEPARATOR;
+
+  let bucket = PREFIX + "UITour" + SEP + "testpage2";
+  is(BrowserUITelemetry.currentBucket, bucket, "Bucket should have correct name");
+
+  gBrowser.removeTab(gTestTab);
+  gTestTab = null;
+  bucket = PREFIX + "UITour" + SEP + "testpage2" + SEP + "closed" + SEP + "1m";
+  is(BrowserUITelemetry.currentBucket, bucket,
+     "After closing tab, bucket should be expiring");
+
+  BrowserUITelemetry.setBucket(null);
+});
--- a/browser/components/uitour/test/browser_UITour_sync.js
+++ b/browser/components/uitour/test/browser_UITour_sync.js
@@ -1,29 +1,29 @@
-"use strict";
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-
-registerCleanupFunction(function() {
-  Services.prefs.clearUserPref("services.sync.username");
-});
-
-add_task(setup_UITourTest);
-
-add_UITour_task(function* test_checkSyncSetup_disabled() {
-  let result = yield getConfigurationPromise("sync");
-  is(result.setup, false, "Sync shouldn't be setup by default");
-});
-
-add_UITour_task(function* test_checkSyncSetup_enabled() {
-  Services.prefs.setCharPref("services.sync.username", "uitour@tests.mozilla.org");
-  let result = yield getConfigurationPromise("sync");
-  is(result.setup, true, "Sync should be setup");
-});
-
-// The showFirefoxAccounts API is sync related, so we test that here too...
-add_UITour_task(function* test_firefoxAccounts() {
-  yield gContentAPI.showFirefoxAccounts();
-  yield BrowserTestUtils.browserLoaded(gTestTab.linkedBrowser, false,
-                                       "about:accounts?action=signup&entrypoint=uitour");
-});
+"use strict";
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+
+registerCleanupFunction(function() {
+  Services.prefs.clearUserPref("services.sync.username");
+});
+
+add_task(setup_UITourTest);
+
+add_UITour_task(function* test_checkSyncSetup_disabled() {
+  let result = yield getConfigurationPromise("sync");
+  is(result.setup, false, "Sync shouldn't be setup by default");
+});
+
+add_UITour_task(function* test_checkSyncSetup_enabled() {
+  Services.prefs.setCharPref("services.sync.username", "uitour@tests.mozilla.org");
+  let result = yield getConfigurationPromise("sync");
+  is(result.setup, true, "Sync should be setup");
+});
+
+// The showFirefoxAccounts API is sync related, so we test that here too...
+add_UITour_task(function* test_firefoxAccounts() {
+  yield gContentAPI.showFirefoxAccounts();
+  yield BrowserTestUtils.browserLoaded(gTestTab.linkedBrowser, false,
+                                       "about:accounts?action=signup&entrypoint=uitour");
+});
--- a/browser/components/uitour/test/browser_closeTab.js
+++ b/browser/components/uitour/test/browser_closeTab.js
@@ -1,16 +1,16 @@
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-
-add_task(setup_UITourTest);
-
-add_UITour_task(function* test_closeTab() {
-  // Setting gTestTab to null indicates that the tab has already been closed,
-  // and if this does not happen the test run will fail.
-  yield gContentAPI.closeTab();
-  gTestTab = null;
-});
+"use strict";
+
+var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+
+add_task(setup_UITourTest);
+
+add_UITour_task(function* test_closeTab() {
+  // Setting gTestTab to null indicates that the tab has already been closed,
+  // and if this does not happen the test run will fail.
+  yield gContentAPI.closeTab();
+  gTestTab = null;
+});
--- a/browser/components/uitour/test/browser_openPreferences.js
+++ b/browser/components/uitour/test/browser_openPreferences.js
@@ -1,36 +1,36 @@
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-
-add_task(setup_UITourTest);
-
-add_UITour_task(function* test_openPreferences() {
-  let promiseTabOpened = BrowserTestUtils.waitForNewTab(gBrowser, "about:preferences");
-  yield gContentAPI.openPreferences();
-  let tab = yield promiseTabOpened;
-  yield BrowserTestUtils.removeTab(tab);
-});
-
-add_UITour_task(function* test_openInvalidPreferences() {
-  yield gContentAPI.openPreferences(999);
-
-  try {
-    yield waitForConditionPromise(() => {
-      return gBrowser.selectedBrowser.currentURI.spec.startsWith("about:preferences");
-    }, "Check if about:preferences opened");
-    ok(false, "No about:preferences tab should have opened");
-  } catch (ex) {
-    ok(true, "No about:preferences tab opened: " + ex);
-  }
-});
-
-add_UITour_task(function* test_openPrivacyPreferences() {
-  let promiseTabOpened = BrowserTestUtils.waitForNewTab(gBrowser, "about:preferences#privacy");
-  yield gContentAPI.openPreferences("privacy");
-  let tab = yield promiseTabOpened;
-  yield BrowserTestUtils.removeTab(tab);
-});
+"use strict";
+
+var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+
+add_task(setup_UITourTest);
+
+add_UITour_task(function* test_openPreferences() {
+  let promiseTabOpened = BrowserTestUtils.waitForNewTab(gBrowser, "about:preferences");
+  yield gContentAPI.openPreferences();
+  let tab = yield promiseTabOpened;
+  yield BrowserTestUtils.removeTab(tab);
+});
+
+add_UITour_task(function* test_openInvalidPreferences() {
+  yield gContentAPI.openPreferences(999);
+
+  try {
+    yield waitForConditionPromise(() => {
+      return gBrowser.selectedBrowser.currentURI.spec.startsWith("about:preferences");
+    }, "Check if about:preferences opened");
+    ok(false, "No about:preferences tab should have opened");
+  } catch (ex) {
+    ok(true, "No about:preferences tab opened: " + ex);
+  }
+});
+
+add_UITour_task(function* test_openPrivacyPreferences() {
+  let promiseTabOpened = BrowserTestUtils.waitForNewTab(gBrowser, "about:preferences#privacy");
+  yield gContentAPI.openPreferences("privacy");
+  let tab = yield promiseTabOpened;
+  yield BrowserTestUtils.removeTab(tab);
+});
--- a/browser/components/uitour/test/browser_openSearchPanel.js
+++ b/browser/components/uitour/test/browser_openSearchPanel.js
@@ -1,33 +1,33 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-
-function test() {
-  UITourTest();
-}
-
-var tests = [
-  function test_openSearchPanel(done) {
-    let searchbar = document.getElementById("searchbar");
-
-    // If suggestions are enabled, the panel will attempt to use the network to connect
-    // to the suggestions provider, causing the test suite to fail.
-    Services.prefs.setBoolPref("browser.search.suggest.enabled", false);
-    registerCleanupFunction(() => {
-      Services.prefs.clearUserPref("browser.search.suggest.enabled");
-    });
-
-    ok(!searchbar.textbox.open, "Popup starts as closed");
-    gContentAPI.openSearchPanel(() => {
-      ok(searchbar.textbox.open, "Popup was opened");
-      searchbar.textbox.closePopup();
-      ok(!searchbar.textbox.open, "Popup was closed");
-      done();
-    });
-  },
-];
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+
+function test() {
+  UITourTest();
+}
+
+var tests = [
+  function test_openSearchPanel(done) {
+    let searchbar = document.getElementById("searchbar");
+
+    // If suggestions are enabled, the panel will attempt to use the network to connect
+    // to the suggestions provider, causing the test suite to fail.
+    Services.prefs.setBoolPref("browser.search.suggest.enabled", false);
+    registerCleanupFunction(() => {
+      Services.prefs.clearUserPref("browser.search.suggest.enabled");
+    });
+
+    ok(!searchbar.textbox.open, "Popup starts as closed");
+    gContentAPI.openSearchPanel(() => {
+      ok(searchbar.textbox.open, "Popup was opened");
+      searchbar.textbox.closePopup();
+      ok(!searchbar.textbox.open, "Popup was closed");
+      done();
+    });
+  },
+];