Index: chrome/test/functional/chromeos_login.py |
diff --git a/chrome/test/functional/chromeos_login.py b/chrome/test/functional/chromeos_login.py |
index ebfe4e73e70ecbf5dceee7befebc023d0529ab56..bd6fb240932e031dca0e68ad473f647b1805c4f0 100755 |
--- a/chrome/test/functional/chromeos_login.py |
+++ b/chrome/test/functional/chromeos_login.py |
@@ -221,6 +221,46 @@ class ChromeosLogin(pyauto.PyUITest): |
self.testGoodLogin() # Re-login with same account. |
_VerifyProfile() |
+class CroshLoginTest(pyauto.PyUITest): |
+ """Tests for crosh in guest mode.""" |
+ def setUp(self): |
Nirnimesh
2012/07/25 07:03:45
Do not create a separate class so that you can reu
tturchetto
2012/07/26 22:44:28
Done.
|
+ pyauto.PyUITest.setUp(self) |
+ if self.GetLoginInfo()['is_logged_in']: |
+ self.Logout() |
+ |
+ def testGuestCrosh(self): |
+ """Test we can use crosh in guest mode.""" |
Nirnimesh
2012/07/25 07:03:45
Test we can use -> Verify
tturchetto
2012/07/26 22:44:28
Done.
|
+ self.LoginAsGuest() |
+ login_info = self.GetLoginInfo() |
+ self.assertTrue(login_info['is_logged_in'], msg='Not logged in at all.') |
+ self.assertTrue(login_info['is_guest'], msg='Not logged in as guest.') |
+ for _ in range(self.GetBrowserWindowCount()): |
+ self.CloseBrowserWindow(0) |
+ |
+ self.assertEqual(0, self.GetBrowserWindowCount()) |
Nirnimesh
2012/07/25 07:03:45
hereafter this test is very similar to the test in
tturchetto
2012/07/26 22:44:28
Done.
|
+ self.OpenCrosh() |
+ self.assertEqual(1, self.GetBrowserWindowCount()) |
+ self.assertEqual(1, self.GetTabCount(),msg='Could not open crosh') |
+ self.assertEqual('crosh', self.GetActiveTabTitle()) |
+ |
+ # Verify crosh prompt. |
+ self.WaitForHtermText(text='crosh> ', |
+ msg='Could not find "crosh> " prompt') |
+ self.assertTrue( |
+ self.GetHtermRowsText(start=0, end=2).endswith('crosh> '), |
+ msg='Could not find "crosh> " prompt') |
+ |
+ # Run a crosh command. |
+ self.SendKeysToHterm('help\\n') |
+ self.WaitForHtermText(text='help_advanced', |
+ msg='Could not find "help_advanced" in help output.') |
+ |
+ # Exit crosh and close tab. |
+ self.SendKeysToHterm('exit\\n') |
+ self.WaitForHtermText(text='command crosh completed with exit code 0', |
+ msg='Could not exit crosh.') |
+ self.Logout() |
Nirnimesh
2012/07/25 07:03:45
remove. Not necessary. Line 30 ensures that we get
tturchetto
2012/07/26 22:44:28
Done.
|
+ |
if __name__ == '__main__': |
pyauto_functional.Main() |