toolkit/mozapps/extensions/test/browser/browser_bug610764.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/mozapps/extensions/test/browser/browser_bug610764.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,34 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 + * http://creativecommons.org/publicdomain/zero/1.0/
     1.6 + */
     1.7 +
     1.8 +// Tests that the discovery view is the default
     1.9 +
    1.10 +var gCategoryUtilities;
    1.11 +
    1.12 +function test() {
    1.13 +  waitForExplicitFinish();
    1.14 +
    1.15 +  open_manager(null, function(aWindow) {
    1.16 +    waitForFocus(function() {
    1.17 +      // The last view is cached except when it is the search view so switch to
    1.18 +      // that and reopen to ensure we see the default view
    1.19 +      var searchBox = aWindow.document.getElementById("header-search");
    1.20 +      searchBox.value = "bar";
    1.21 +
    1.22 +      EventUtils.synthesizeMouseAtCenter(searchBox, { }, aWindow);
    1.23 +      EventUtils.synthesizeKey("VK_RETURN", { }, aWindow);
    1.24 +
    1.25 +      wait_for_view_load(aWindow, function() {
    1.26 +        close_manager(aWindow, function() {
    1.27 +          open_manager(null, function(aWindow) {
    1.28 +            gCategoryUtilities = new CategoryUtilities(aWindow);
    1.29 +            is(gCategoryUtilities.selectedCategory, "discover", "Should show the discovery pane by default");
    1.30 +
    1.31 +            close_manager(aWindow, finish);
    1.32 +          });
    1.33 +        });
    1.34 +      });
    1.35 +    }, aWindow);
    1.36 +  });
    1.37 +}

mercurial