1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/mozapps/extensions/test/browser/browser_globalwarnings.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,63 @@ 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 566194 - safe mode / security & compatibility check status are not exposed in new addon manager UI 1.9 + 1.10 +function test() { 1.11 + waitForExplicitFinish(); 1.12 + run_next_test(); 1.13 +} 1.14 + 1.15 +function end_test() { 1.16 + finish(); 1.17 +} 1.18 + 1.19 +add_test(function() { 1.20 + info("Testing compatibility checking warning"); 1.21 + 1.22 + info("Setting checkCompatibility to false"); 1.23 + AddonManager.checkCompatibility = false; 1.24 + 1.25 + open_manager("addons://list/extension", function(aWindow) { 1.26 + var hbox = aWindow.document.querySelector("#list-view hbox.global-warning-checkcompatibility"); 1.27 + is_element_visible(hbox, "Check Compatibility warning hbox should be visible"); 1.28 + var button = aWindow.document.querySelector("#list-view button.global-warning-checkcompatibility"); 1.29 + is_element_visible(button, "Check Compatibility warning button should be visible"); 1.30 + 1.31 + info("Clicking 'Enable' button"); 1.32 + EventUtils.synthesizeMouse(button, 2, 2, { }, aWindow); 1.33 + is(AddonManager.checkCompatibility, true, "Check Compatibility pref should be cleared"); 1.34 + is_element_hidden(hbox, "Check Compatibility warning hbox should be hidden"); 1.35 + is_element_hidden(button, "Check Compatibility warning button should be hidden"); 1.36 + 1.37 + close_manager(aWindow, function() { 1.38 + run_next_test(); 1.39 + }); 1.40 + }); 1.41 +}); 1.42 + 1.43 +add_test(function() { 1.44 + info("Testing update security checking warning"); 1.45 + 1.46 + var pref = "extensions.checkUpdateSecurity"; 1.47 + info("Setting " + pref + " pref to false") 1.48 + Services.prefs.setBoolPref(pref, false); 1.49 + 1.50 + open_manager(null, function(aWindow) { 1.51 + var hbox = aWindow.document.querySelector("#list-view hbox.global-warning-updatesecurity"); 1.52 + is_element_visible(hbox, "Check Update Security warning hbox should be visible"); 1.53 + var button = aWindow.document.querySelector("#list-view button.global-warning-updatesecurity"); 1.54 + is_element_visible(button, "Check Update Security warning button should be visible"); 1.55 + 1.56 + info("Clicking 'Enable' button"); 1.57 + EventUtils.synthesizeMouse(button, 2, 2, { }, aWindow); 1.58 + is(Services.prefs.prefHasUserValue(pref), false, "Check Update Security pref should be cleared"); 1.59 + is_element_hidden(hbox, "Check Update Security warning hbox should be hidden"); 1.60 + is_element_hidden(button, "Check Update Security warning button should be hidden"); 1.61 + 1.62 + close_manager(aWindow, function() { 1.63 + run_next_test(); 1.64 + }); 1.65 + }); 1.66 +});