michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: // Tests that the discovery view is the default michael@0: michael@0: var gCategoryUtilities; michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: open_manager(null, function(aWindow) { michael@0: waitForFocus(function() { michael@0: // The last view is cached except when it is the search view so switch to michael@0: // that and reopen to ensure we see the default view michael@0: var searchBox = aWindow.document.getElementById("header-search"); michael@0: searchBox.value = "bar"; michael@0: michael@0: EventUtils.synthesizeMouseAtCenter(searchBox, { }, aWindow); michael@0: EventUtils.synthesizeKey("VK_RETURN", { }, aWindow); michael@0: michael@0: wait_for_view_load(aWindow, function() { michael@0: close_manager(aWindow, function() { michael@0: open_manager(null, function(aWindow) { michael@0: gCategoryUtilities = new CategoryUtilities(aWindow); michael@0: is(gCategoryUtilities.selectedCategory, "discover", "Should show the discovery pane by default"); michael@0: michael@0: close_manager(aWindow, finish); michael@0: }); michael@0: }); michael@0: }); michael@0: }, aWindow); michael@0: }); michael@0: }