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

Side by Side Diff: chrome/test/pyautolib/pyauto.py

Issue 10831029: Revert 148465 - [cros] Fix tests: Reach the "Add user" screen before attempting to login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months 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 | « no previous file | 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/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 4585 matching lines...) Expand 10 before | Expand all | Expand 10 after
4596 will not be noticed here, because the browser has no knowledge of it. In 4596 will not be noticed here, because the browser has no knowledge of it. In
4597 this case the GetNextEvent automation command will always time out. 4597 this case the GetNextEvent automation command will always time out.
4598 4598
4599 Returns: 4599 Returns:
4600 An error string if an error occured. 4600 An error string if an error occured.
4601 None otherwise. 4601 None otherwise.
4602 4602
4603 Raises: 4603 Raises:
4604 pyauto_errors.JSONInterfaceError if the automation call returns an error. 4604 pyauto_errors.JSONInterfaceError if the automation call returns an error.
4605 """ 4605 """
4606 # Go to the 'Add user' screen for login to work.
4607 self.ExecuteJavascriptInOOBEWebUI(
4608 'Oobe.showSigninUI();'
4609 'window.domAutomationController.send("ok");')
4610 self._GetResultFromJSONRequest({'command': 'AddLoginEventObserver'}, 4606 self._GetResultFromJSONRequest({'command': 'AddLoginEventObserver'},
4611 windex=None) 4607 windex=None)
4612 cmd_dict = { 4608 cmd_dict = {
4613 'command': 'SubmitLoginForm', 4609 'command': 'SubmitLoginForm',
4614 'username': username, 4610 'username': username,
4615 'password': password, 4611 'password': password,
4616 } 4612 }
4617 self._GetResultFromJSONRequest(cmd_dict, windex=None) 4613 self._GetResultFromJSONRequest(cmd_dict, windex=None)
4618 try: 4614 try:
4619 # TODO(craigdh): Add login failure events once PyAuto switches to mocked 4615 # TODO(craigdh): Add login failure events once PyAuto switches to mocked
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after
6363 successful = result.wasSuccessful() 6359 successful = result.wasSuccessful()
6364 if not successful: 6360 if not successful:
6365 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) 6361 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename)
6366 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ 6362 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \
6367 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) 6363 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL)
6368 sys.exit(not successful) 6364 sys.exit(not successful)
6369 6365
6370 6366
6371 if __name__ == '__main__': 6367 if __name__ == '__main__':
6372 Main() 6368 Main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698