Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/
3 */
5 // Bug 608316 - Test that opening the manager to an add-on that doesn't exist
6 // just loads the default view
8 var gCategoryUtilities;
10 function test() {
11 waitForExplicitFinish();
13 run_next_test();
14 }
16 function end_test() {
17 finish();
18 }
20 add_test(function() {
21 open_manager("addons://detail/foo", function(aManager) {
22 gCategoryUtilities = new CategoryUtilities(aManager);
23 is(gCategoryUtilities.selectedCategory, "discover", "Should fall back to the discovery pane");
25 close_manager(aManager, run_next_test);
26 });
27 });
29 // Also test that opening directly to an add-on that does exist doesn't break
30 // and selects the right category
31 add_test(function() {
32 new MockProvider().createAddons([{
33 id: "addon1@tests.mozilla.org",
34 name: "addon 1",
35 version: "1.0"
36 }]);
38 open_manager("addons://detail/addon1@tests.mozilla.org", function(aManager) {
39 gCategoryUtilities = new CategoryUtilities(aManager);
40 is(gCategoryUtilities.selectedCategory, "extension", "Should have selected the right category");
42 close_manager(aManager, run_next_test);
43 });
44 });