OLD | NEW |
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 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 self.assertTrue('search.my.company' in self.GetActiveTabURL().spec()) | 523 self.assertTrue('search.my.company' in self.GetActiveTabURL().spec()) |
524 policy = { | 524 policy = { |
525 'DefaultSearchProviderEnabled': False, | 525 'DefaultSearchProviderEnabled': False, |
526 } | 526 } |
527 self.SetUserPolicy(policy) | 527 self.SetUserPolicy(policy) |
528 self.assertFalse( | 528 self.assertFalse( |
529 self._GetPrefIsManagedError(pyauto.kDefaultSearchProviderEnabled, | 529 self._GetPrefIsManagedError(pyauto.kDefaultSearchProviderEnabled, |
530 False)) | 530 False)) |
531 self.SetOmniboxText('deli') | 531 self.SetOmniboxText('deli') |
532 self.WaitUntilOmniboxQueryDone() | 532 self.WaitUntilOmniboxQueryDone() |
533 self.OmniboxAcceptInput() | 533 self.assertRaises(pyauto.JSONInterfaceError, |
534 self.assertFalse('search.my.company' in self.GetActiveTabURL().spec()) | 534 lambda: self.OmniboxAcceptInput()) |
535 | 535 |
536 # Needed for extension tests | 536 # Needed for extension tests |
537 _GOOD_CRX_ID = 'ldnnhddmnhbkjipkidpdiheffobcpfmf' | 537 _GOOD_CRX_ID = 'ldnnhddmnhbkjipkidpdiheffobcpfmf' |
538 _ADBLOCK_CRX_ID = 'dojnnbeimaimaojcialkkgajdnefpgcn' | 538 _ADBLOCK_CRX_ID = 'dojnnbeimaimaojcialkkgajdnefpgcn' |
539 _SCREEN_CAPTURE_CRX_ID = 'cpngackimfmofbokmjmljamhdncknpmg' | 539 _SCREEN_CAPTURE_CRX_ID = 'cpngackimfmofbokmjmljamhdncknpmg' |
540 | 540 |
541 def _BuildCRXPath(self, crx_file_name): | 541 def _BuildCRXPath(self, crx_file_name): |
542 """Returns the complete path to a crx_file in the data directory. | 542 """Returns the complete path to a crx_file in the data directory. |
543 | 543 |
544 Args: | 544 Args: |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 # Give the system 30 seconds to go get this extension. We are not sure how | 658 # Give the system 30 seconds to go get this extension. We are not sure how |
659 # long it will take the policy to take affect and download the extension. | 659 # long it will take the policy to take affect and download the extension. |
660 self.assertTrue(self.WaitUntil(lambda: | 660 self.assertTrue(self.WaitUntil(lambda: |
661 self._CheckForExtensionByID(self._SCREEN_CAPTURE_CRX_ID), | 661 self._CheckForExtensionByID(self._SCREEN_CAPTURE_CRX_ID), |
662 expect_retval=True), | 662 expect_retval=True), |
663 msg='The force install extension was never installed.') | 663 msg='The force install extension was never installed.') |
664 | 664 |
665 | 665 |
666 if __name__ == '__main__': | 666 if __name__ == '__main__': |
667 pyauto_functional.Main() | 667 pyauto_functional.Main() |
OLD | NEW |