| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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() |
| OLD | NEW |