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

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

Issue 8486021: Fixed the policy.PolicyTest.testJavascriptPolicies test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/test/functional/PYAUTO_TESTS ('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/python 1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 import logging 6 import logging
7 7
8 import pyauto_functional # must come before pyauto. 8 import pyauto_functional # must come before pyauto.
9 import pyauto 9 import pyauto
10 from pyauto_errors import JSONInterfaceError 10 from pyauto_errors import JSONInterfaceError
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 policy['DeveloperToolsDisabled'] = False 137 policy['DeveloperToolsDisabled'] = False
138 self.SetPolicies(policy) 138 self.SetPolicies(policy)
139 self.assertTrue(self.IsJavascriptEnabled()) 139 self.assertTrue(self.IsJavascriptEnabled())
140 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS)) 140 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS))
141 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS_CONSOLE)) 141 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS_CONSOLE))
142 142
143 # The Developer Tools still work when javascript is disabled. 143 # The Developer Tools still work when javascript is disabled.
144 policy['JavascriptEnabled'] = False 144 policy['JavascriptEnabled'] = False
145 self.SetPolicies(policy) 145 self.SetPolicies(policy)
146 self.NavigateToURL('about:blank')
146 self.assertFalse(self.IsJavascriptEnabled()) 147 self.assertFalse(self.IsJavascriptEnabled())
147 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS)) 148 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS))
148 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS_CONSOLE)) 149 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS_CONSOLE))
149 # Javascript is always enabled for internal Chrome pages. 150 # Javascript is always enabled for internal Chrome pages.
150 self.NavigateToURL('chrome://settings') 151 self.NavigateToURL('chrome://settings')
151 self.assertTrue(self.IsJavascriptEnabled()) 152 self.assertTrue(self.IsJavascriptEnabled())
152 153
153 # The Developer Tools can be explicitly disabled. 154 # The Developer Tools can be explicitly disabled.
154 policy['DeveloperToolsDisabled'] = True 155 policy['DeveloperToolsDisabled'] = True
155 self.SetPolicies(policy) 156 self.SetPolicies(policy)
(...skipping 30 matching lines...) Expand all
186 'Disable3DAPIs': True 187 'Disable3DAPIs': True
187 }) 188 })
188 self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kDisable3DAPIs)) 189 self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kDisable3DAPIs))
189 # The Disable3DAPIs policy only applies updated values to new renderers. 190 # The Disable3DAPIs policy only applies updated values to new renderers.
190 self.RestartRenderer() 191 self.RestartRenderer()
191 self.assertFalse(self.IsWebGLEnabled()) 192 self.assertFalse(self.IsWebGLEnabled())
192 193
193 194
194 if __name__ == '__main__': 195 if __name__ == '__main__':
195 pyauto_functional.Main() 196 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « chrome/test/functional/PYAUTO_TESTS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698