OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env 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 import os | 7 import os |
8 | 8 |
9 import pyauto_functional # must come before pyauto. | 9 import pyauto_functional # must come before pyauto. |
10 import policy_base | 10 import policy_base |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS_CONSOLE)) | 169 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS_CONSOLE)) |
170 | 170 |
171 # The Developer Tools still work when javascript is disabled. | 171 # The Developer Tools still work when javascript is disabled. |
172 policy['JavascriptEnabled'] = False | 172 policy['JavascriptEnabled'] = False |
173 self.SetPolicies(policy) | 173 self.SetPolicies(policy) |
174 self.NavigateToURL('about:blank') | 174 self.NavigateToURL('about:blank') |
175 self.assertFalse(self._IsJavascriptEnabled()) | 175 self.assertFalse(self._IsJavascriptEnabled()) |
176 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS)) | 176 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS)) |
177 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS_CONSOLE)) | 177 self.assertTrue(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS_CONSOLE)) |
178 # Javascript is always enabled for internal Chrome pages. | 178 # Javascript is always enabled for internal Chrome pages. |
179 self.NavigateToURL('chrome://settings') | 179 self.NavigateToURL('chrome://settings-frame') |
180 self.assertTrue(self._IsJavascriptEnabled()) | 180 self.assertTrue(self._IsJavascriptEnabled()) |
181 | 181 |
182 # The Developer Tools can be explicitly disabled. | 182 # The Developer Tools can be explicitly disabled. |
183 policy['DeveloperToolsDisabled'] = True | 183 policy['DeveloperToolsDisabled'] = True |
184 self.SetPolicies(policy) | 184 self.SetPolicies(policy) |
185 self.NavigateToURL('about:blank') | 185 self.NavigateToURL('about:blank') |
186 self.assertFalse(self._IsJavascriptEnabled()) | 186 self.assertFalse(self._IsJavascriptEnabled()) |
187 self.assertFalse(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS)) | 187 self.assertFalse(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS)) |
188 self.assertFalse(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS_CONSOLE)) | 188 self.assertFalse(self.IsMenuCommandEnabled(pyauto.IDC_DEV_TOOLS_CONSOLE)) |
189 | 189 |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 # Give the system 30 seconds to go get this extension. We are not sure how | 686 # Give the system 30 seconds to go get this extension. We are not sure how |
687 # long it will take the policy to take affect and download the extension. | 687 # long it will take the policy to take affect and download the extension. |
688 self.assertTrue(self.WaitUntil(lambda: | 688 self.assertTrue(self.WaitUntil(lambda: |
689 self._CheckForExtensionByID(self._SCREEN_CAPTURE_CRX_ID), | 689 self._CheckForExtensionByID(self._SCREEN_CAPTURE_CRX_ID), |
690 expect_retval=True), | 690 expect_retval=True), |
691 msg='The force install extension was never installed.') | 691 msg='The force install extension was never installed.') |
692 | 692 |
693 | 693 |
694 if __name__ == '__main__': | 694 if __name__ == '__main__': |
695 pyauto_functional.Main() | 695 pyauto_functional.Main() |
OLD | NEW |