| 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 """PyAuto: Python Interface to Chromium's Automation Proxy. | 6 """PyAuto: Python Interface to Chromium's Automation Proxy. |
| 7 | 7 |
| 8 PyAuto uses swig to expose Automation Proxy interfaces to Python. | 8 PyAuto uses swig to expose Automation Proxy interfaces to Python. |
| 9 For complete documentation on the functionality available, | 9 For complete documentation on the functionality available, |
| 10 run pydoc on this file. | 10 run pydoc on this file. |
| (...skipping 4512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4523 A dictionary with the following keys: | 4523 A dictionary with the following keys: |
| 4524 | 4524 |
| 4525 'next_screen': The title of the next OOBE screen as a string. | 4525 'next_screen': The title of the next OOBE screen as a string. |
| 4526 | 4526 |
| 4527 Raises: | 4527 Raises: |
| 4528 pyauto_errors.JSONInterfaceError if the automation call returns an error. | 4528 pyauto_errors.JSONInterfaceError if the automation call returns an error. |
| 4529 """ | 4529 """ |
| 4530 cmd_dict = { 'command': 'AcceptOOBENetworkScreen' } | 4530 cmd_dict = { 'command': 'AcceptOOBENetworkScreen' } |
| 4531 return self._GetResultFromJSONRequest(cmd_dict, windex=None) | 4531 return self._GetResultFromJSONRequest(cmd_dict, windex=None) |
| 4532 | 4532 |
| 4533 def AcceptOOBEEula(self, accepted, usage_stats_reporting=False, | 4533 def AcceptOOBEEula(self, accepted, usage_stats_reporting=False): |
| 4534 rlz_enabled=False): | |
| 4535 """Accepts OOBE EULA and advances to the next screen. | 4534 """Accepts OOBE EULA and advances to the next screen. |
| 4536 | 4535 |
| 4537 Assumes that we're already at the OOBE EULA screen. | 4536 Assumes that we're already at the OOBE EULA screen. |
| 4538 | 4537 |
| 4539 Args: | 4538 Args: |
| 4540 accepted: Boolean indicating whether the EULA should be accepted. | 4539 accepted: Boolean indicating whether the EULA should be accepted. |
| 4541 usage_stats_reporting: Boolean indicating whether UMA should be enabled. | 4540 usage_stats_reporting: Boolean indicating whether UMA should be enabled. |
| 4542 rlz_enabled: Boolean indicating whether RLZ should be enabled. | |
| 4543 | 4541 |
| 4544 Returns: | 4542 Returns: |
| 4545 A dictionary with the following keys: | 4543 A dictionary with the following keys: |
| 4546 | 4544 |
| 4547 'next_screen': The title of the next OOBE screen as a string. | 4545 'next_screen': The title of the next OOBE screen as a string. |
| 4548 | 4546 |
| 4549 Raises: | 4547 Raises: |
| 4550 pyauto_errors.JSONInterfaceError if the automation call returns an error. | 4548 pyauto_errors.JSONInterfaceError if the automation call returns an error. |
| 4551 """ | 4549 """ |
| 4552 cmd_dict = { 'command': 'AcceptOOBEEula', | 4550 cmd_dict = { 'command': 'AcceptOOBEEula', |
| 4553 'accepted': accepted, | 4551 'accepted': accepted, |
| 4554 'usage_stats_reporting': usage_stats_reporting, | 4552 'usage_stats_reporting': usage_stats_reporting } |
| 4555 'rlz_enabled': rlz_enabled } | |
| 4556 return self._GetResultFromJSONRequest(cmd_dict, windex=None) | 4553 return self._GetResultFromJSONRequest(cmd_dict, windex=None) |
| 4557 | 4554 |
| 4558 def CancelOOBEUpdate(self): | 4555 def CancelOOBEUpdate(self): |
| 4559 """Skips update on OOBE and advances to the next screen. | 4556 """Skips update on OOBE and advances to the next screen. |
| 4560 | 4557 |
| 4561 Returns: | 4558 Returns: |
| 4562 A dictionary with the following keys: | 4559 A dictionary with the following keys: |
| 4563 | 4560 |
| 4564 'next_screen': The title of the next OOBE screen as a string. | 4561 'next_screen': The title of the next OOBE screen as a string. |
| 4565 | 4562 |
| (...skipping 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6534 successful = result.wasSuccessful() | 6531 successful = result.wasSuccessful() |
| 6535 if not successful: | 6532 if not successful: |
| 6536 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) | 6533 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) |
| 6537 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ | 6534 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ |
| 6538 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) | 6535 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) |
| 6539 sys.exit(not successful) | 6536 sys.exit(not successful) |
| 6540 | 6537 |
| 6541 | 6538 |
| 6542 if __name__ == '__main__': | 6539 if __name__ == '__main__': |
| 6543 Main() | 6540 Main() |
| OLD | NEW |