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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 * http://creativecommons.org/publicdomain/zero/1.0/
michael@0 3 */
michael@0 4
michael@0 5 // Bug 608316 - Test that opening the manager to an add-on that doesn't exist
michael@0 6 // just loads the default view
michael@0 7
michael@0 8 var gCategoryUtilities;
michael@0 9
michael@0 10 function test() {
michael@0 11 waitForExplicitFinish();
michael@0 12
michael@0 13 run_next_test();
michael@0 14 }
michael@0 15
michael@0 16 function end_test() {
michael@0 17 finish();
michael@0 18 }
michael@0 19
michael@0 20 add_test(function() {
michael@0 21 open_manager("addons://detail/foo", function(aManager) {
michael@0 22 gCategoryUtilities = new CategoryUtilities(aManager);
michael@0 23 is(gCategoryUtilities.selectedCategory, "discover", "Should fall back to the discovery pane");
michael@0 24
michael@0 25 close_manager(aManager, run_next_test);
michael@0 26 });
michael@0 27 });
michael@0 28
michael@0 29 // Also test that opening directly to an add-on that does exist doesn't break
michael@0 30 // and selects the right category
michael@0 31 add_test(function() {
michael@0 32 new MockProvider().createAddons([{
michael@0 33 id: "addon1@tests.mozilla.org",
michael@0 34 name: "addon 1",
michael@0 35 version: "1.0"
michael@0 36 }]);
michael@0 37
michael@0 38 open_manager("addons://detail/addon1@tests.mozilla.org", function(aManager) {
michael@0 39 gCategoryUtilities = new CategoryUtilities(aManager);
michael@0 40 is(gCategoryUtilities.selectedCategory, "extension", "Should have selected the right category");
michael@0 41
michael@0 42 close_manager(aManager, run_next_test);
michael@0 43 });
michael@0 44 });

mercurial