|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 * http://creativecommons.org/publicdomain/zero/1.0/ |
|
3 */ |
|
4 |
|
5 // Tests that the discovery view is the default |
|
6 |
|
7 var gCategoryUtilities; |
|
8 |
|
9 function test() { |
|
10 waitForExplicitFinish(); |
|
11 |
|
12 open_manager(null, function(aWindow) { |
|
13 waitForFocus(function() { |
|
14 // The last view is cached except when it is the search view so switch to |
|
15 // that and reopen to ensure we see the default view |
|
16 var searchBox = aWindow.document.getElementById("header-search"); |
|
17 searchBox.value = "bar"; |
|
18 |
|
19 EventUtils.synthesizeMouseAtCenter(searchBox, { }, aWindow); |
|
20 EventUtils.synthesizeKey("VK_RETURN", { }, aWindow); |
|
21 |
|
22 wait_for_view_load(aWindow, function() { |
|
23 close_manager(aWindow, function() { |
|
24 open_manager(null, function(aWindow) { |
|
25 gCategoryUtilities = new CategoryUtilities(aWindow); |
|
26 is(gCategoryUtilities.selectedCategory, "discover", "Should show the discovery pane by default"); |
|
27 |
|
28 close_manager(aWindow, finish); |
|
29 }); |
|
30 }); |
|
31 }); |
|
32 }, aWindow); |
|
33 }); |
|
34 } |