Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: chrome/test/functional/policy_prefs_ui.py

Issue 10542023: Disable modifying extensions when in managed mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fixed Evan's nits Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_settings_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # If this test is failing, please check these steps. 6 # If this test is failing, please check these steps.
7 # 7 #
8 # - You introduced a new policy: 8 # - You introduced a new policy:
9 # Cool! Edit |policies| in policy_test_cases.py and add an entry for it. 9 # Cool! Edit |policies| in policy_test_cases.py and add an entry for it.
10 # See the comment above it for the format. 10 # See the comment above it for the format.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 settings_pages += [ 43 settings_pages += [
44 'chrome://settings-frame/accounts', 44 'chrome://settings-frame/accounts',
45 ] 45 ]
46 46
47 def setUp(self): 47 def setUp(self):
48 policy_base.PolicyTestBase.setUp(self) 48 policy_base.PolicyTestBase.setUp(self)
49 if self.IsChromeOS(): 49 if self.IsChromeOS():
50 self.LoginWithTestAccount() 50 self.LoginWithTestAccount()
51 51
52 def IsAnyBannerVisible(self): 52 def IsAnyBannerVisible(self):
53 """Returns true if any managed prefs banner is visible in the current page. 53 """Returns true if any banner (e.g. for managed prefs) is visible."""
54 """
55 ret = self.ExecuteJavascript(""" 54 ret = self.ExecuteJavascript("""
56 var visible = false; 55 var visible = false;
57 var banners = document.querySelectorAll('.managed-prefs-banner'); 56 var banners = document.querySelectorAll('.page-banner');
58 for (var i=0; i<banners.length; i++) { 57 for (var i=0; i<banners.length; i++) {
59 if (banners[i].parentElement.id == 'templates') 58 if (banners[i].parentElement.id == 'templates')
60 continue; 59 continue;
61 60
62 if (window.getComputedStyle(banners[i]).display != 'none') 61 if (window.getComputedStyle(banners[i]).display != 'none')
63 visible = true; 62 visible = true;
64 } 63 }
65 domAutomationController.send(visible.toString()); 64 domAutomationController.send(visible.toString());
66 """) 65 """)
67 return ret == 'true' 66 return ret == 'true'
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 172
174 self.SetUserPolicy(policy_dict) 173 self.SetUserPolicy(policy_dict)
175 self.assertTrue(self.IsAnyBannerVisible()) 174 self.assertTrue(self.IsAnyBannerVisible())
176 175
177 self.SetUserPolicy({}) 176 self.SetUserPolicy({})
178 self.assertFalse(self.IsAnyBannerVisible()) 177 self.assertFalse(self.IsAnyBannerVisible())
179 178
180 179
181 if __name__ == '__main__': 180 if __name__ == '__main__':
182 pyauto_functional.Main() 181 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_settings_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698