OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import copy | 5 import copy |
6 import ctypes | 6 import ctypes |
7 import email | 7 import email |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import platform | 10 import platform |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
357 test.assertTrue(test.GetSyncInfo()['last synced'] == 'Never') | 357 test.assertTrue(test.GetSyncInfo()['last synced'] == 'Never') |
358 test.assertTrue(test.SignInToSync(username, password)) | 358 test.assertTrue(test.SignInToSync(username, password)) |
359 test.assertTrue(test.GetSyncInfo()['last synced'] == 'Just now') | 359 test.assertTrue(test.GetSyncInfo()['last synced'] == 'Just now') |
360 | 360 |
361 | 361 |
362 def LoginToDevice(test, test_account='test_google_account'): | 362 def LoginToDevice(test, test_account='test_google_account'): |
363 """Login to the Chromeos device using the given test account. | 363 """Login to the Chromeos device using the given test account. |
364 | 364 |
365 If no test account is specified, we use test_google_account as the default. | 365 If no test account is specified, we use test_google_account as the default. |
366 You can choose test accounts from - | 366 You can choose test accounts from - |
367 chrome/test/data/pyauto_private/private_tests_info.txt | 367 chrome/test/data/pyauto_private/private_tests_info.txt |
368 | 368 |
369 Args: | 369 Args: |
370 test_account: The account used to login to the Chromeos device. | 370 test_account: The account used to login to the Chromeos device. |
371 """ | 371 """ |
372 if not test.GetLoginInfo()['is_logged_in']: | 372 if not test.GetLoginInfo()['is_logged_in']: |
373 credentials = test.GetPrivateInfo()[test_account] | 373 credentials = test.GetPrivateInfo()[test_account] |
374 test.Login(credentials['username'], credentials['password']) | 374 test.Login(credentials['username'], credentials['password']) |
375 login_info = test.GetLoginInfo() | 375 login_info = test.GetLoginInfo() |
376 test.assertTrue(login_info['is_logged_in'], msg='Login failed.') | 376 test.assertTrue(login_info['is_logged_in'], msg='Login failed.') |
377 else: | 377 else: |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
427 test: Derived from pyauto.PyUITest - base class for UI test cases. | 427 test: Derived from pyauto.PyUITest - base class for UI test cases. |
428 infobar_type: The infobar type to look for. | 428 infobar_type: The infobar type to look for. |
429 windex: Window index. Defaults to 0 (first window). | 429 windex: Window index. Defaults to 0 (first window). |
430 tab_index: Tab index. Defaults to 0 (first tab). | 430 tab_index: Tab index. Defaults to 0 (first tab). |
431 """ | 431 """ |
432 test.assertFalse( | 432 test.assertFalse( |
433 test.WaitUntil(lambda: GetInfobarIndexByType( | 433 test.WaitUntil(lambda: GetInfobarIndexByType( |
434 test, infobar_type, windex, tab_index) is not None, timeout=20), | 434 test, infobar_type, windex, tab_index) is not None, timeout=20), |
435 msg=('Infobar type for %s appeared when it should be hidden.' | 435 msg=('Infobar type for %s appeared when it should be hidden.' |
436 % infobar_type)) | 436 % infobar_type)) |
437 | |
438 def OpenCroshVerification(self): | |
439 """ Verify that crosh is opened correctly. | |
Nirnimesh
2012/07/26 23:09:03
Remove space after """
Mention that this test ope
tturchetto
2012/07/26 23:37:47
Done.
| |
440 | |
441 This function verifies crosh is opened correctly - verify all browser window | |
442 is closed before open crosh, then verify crosh is opened in first window | |
443 and first tab, ready for further corsh test. | |
444 """ | |
445 self.assertEqual(0, self.GetBrowserWindowCount()) | |
446 self.OpenCrosh() | |
447 self.assertEqual(1, self.GetBrowserWindowCount()) | |
448 self.assertEqual(1, self.GetTabCount(), | |
449 msg='Could not open crosh') | |
450 self.assertEqual('crosh', self.GetActiveTabTitle()) | |
OLD | NEW |