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: // Bug 608316 - Test that opening the manager to an add-on that doesn't exist michael@0: // just loads the default view michael@0: michael@0: var gCategoryUtilities; michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: function end_test() { michael@0: finish(); michael@0: } michael@0: michael@0: add_test(function() { michael@0: open_manager("addons://detail/foo", function(aManager) { michael@0: gCategoryUtilities = new CategoryUtilities(aManager); michael@0: is(gCategoryUtilities.selectedCategory, "discover", "Should fall back to the discovery pane"); michael@0: michael@0: close_manager(aManager, run_next_test); michael@0: }); michael@0: }); michael@0: michael@0: // Also test that opening directly to an add-on that does exist doesn't break michael@0: // and selects the right category michael@0: add_test(function() { michael@0: new MockProvider().createAddons([{ michael@0: id: "addon1@tests.mozilla.org", michael@0: name: "addon 1", michael@0: version: "1.0" michael@0: }]); michael@0: michael@0: open_manager("addons://detail/addon1@tests.mozilla.org", function(aManager) { michael@0: gCategoryUtilities = new CategoryUtilities(aManager); michael@0: is(gCategoryUtilities.selectedCategory, "extension", "Should have selected the right category"); michael@0: michael@0: close_manager(aManager, run_next_test); michael@0: }); michael@0: });