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 679604 - Test that a XUL persisted category from an older version of michael@0: // Firefox doesn't break the add-ons manager when that category doesn't exist michael@0: michael@0: const PREF_UI_LASTCATEGORY = "extensions.ui.lastCategory"; michael@0: michael@0: var gManagerWindow; michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: open_manager(null, function(aWindow) { michael@0: var categories = aWindow.document.getElementById("categories"); michael@0: categories.setAttribute("last-selected", "foo"); michael@0: aWindow.document.persist("categories", "last-selected"); michael@0: michael@0: close_manager(aWindow, function() { michael@0: Services.prefs.clearUserPref(PREF_UI_LASTCATEGORY); michael@0: michael@0: open_manager(null, function(aWindow) { michael@0: is(new CategoryUtilities(aWindow).selectedCategory, "discover", michael@0: "Should have loaded the right view"); michael@0: michael@0: close_manager(aWindow, finish); michael@0: }); michael@0: }); michael@0: }); michael@0: }