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 566194 - safe mode / security & compatibility check status are not exposed in new addon manager UI michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); 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: info("Testing compatibility checking warning"); michael@0: michael@0: info("Setting checkCompatibility to false"); michael@0: AddonManager.checkCompatibility = false; michael@0: michael@0: open_manager("addons://list/extension", function(aWindow) { michael@0: var hbox = aWindow.document.querySelector("#list-view hbox.global-warning-checkcompatibility"); michael@0: is_element_visible(hbox, "Check Compatibility warning hbox should be visible"); michael@0: var button = aWindow.document.querySelector("#list-view button.global-warning-checkcompatibility"); michael@0: is_element_visible(button, "Check Compatibility warning button should be visible"); michael@0: michael@0: info("Clicking 'Enable' button"); michael@0: EventUtils.synthesizeMouse(button, 2, 2, { }, aWindow); michael@0: is(AddonManager.checkCompatibility, true, "Check Compatibility pref should be cleared"); michael@0: is_element_hidden(hbox, "Check Compatibility warning hbox should be hidden"); michael@0: is_element_hidden(button, "Check Compatibility warning button should be hidden"); michael@0: michael@0: close_manager(aWindow, function() { michael@0: run_next_test(); michael@0: }); michael@0: }); michael@0: }); michael@0: michael@0: add_test(function() { michael@0: info("Testing update security checking warning"); michael@0: michael@0: var pref = "extensions.checkUpdateSecurity"; michael@0: info("Setting " + pref + " pref to false") michael@0: Services.prefs.setBoolPref(pref, false); michael@0: michael@0: open_manager(null, function(aWindow) { michael@0: var hbox = aWindow.document.querySelector("#list-view hbox.global-warning-updatesecurity"); michael@0: is_element_visible(hbox, "Check Update Security warning hbox should be visible"); michael@0: var button = aWindow.document.querySelector("#list-view button.global-warning-updatesecurity"); michael@0: is_element_visible(button, "Check Update Security warning button should be visible"); michael@0: michael@0: info("Clicking 'Enable' button"); michael@0: EventUtils.synthesizeMouse(button, 2, 2, { }, aWindow); michael@0: is(Services.prefs.prefHasUserValue(pref), false, "Check Update Security pref should be cleared"); michael@0: is_element_hidden(hbox, "Check Update Security warning hbox should be hidden"); michael@0: is_element_hidden(button, "Check Update Security warning button should be hidden"); michael@0: michael@0: close_manager(aWindow, function() { michael@0: run_next_test(); michael@0: }); michael@0: }); michael@0: });