1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/mozapps/extensions/test/browser/browser_bug679604.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,31 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ 1.6 + */ 1.7 + 1.8 +// Bug 679604 - Test that a XUL persisted category from an older version of 1.9 +// Firefox doesn't break the add-ons manager when that category doesn't exist 1.10 + 1.11 +const PREF_UI_LASTCATEGORY = "extensions.ui.lastCategory"; 1.12 + 1.13 +var gManagerWindow; 1.14 + 1.15 +function test() { 1.16 + waitForExplicitFinish(); 1.17 + 1.18 + open_manager(null, function(aWindow) { 1.19 + var categories = aWindow.document.getElementById("categories"); 1.20 + categories.setAttribute("last-selected", "foo"); 1.21 + aWindow.document.persist("categories", "last-selected"); 1.22 + 1.23 + close_manager(aWindow, function() { 1.24 + Services.prefs.clearUserPref(PREF_UI_LASTCATEGORY); 1.25 + 1.26 + open_manager(null, function(aWindow) { 1.27 + is(new CategoryUtilities(aWindow).selectedCategory, "discover", 1.28 + "Should have loaded the right view"); 1.29 + 1.30 + close_manager(aWindow, finish); 1.31 + }); 1.32 + }); 1.33 + }); 1.34 +}