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..607a9a97051c9850f20e160258fa5b74e01b6264 100755 |
--- a/chrome/test/functional/chromeos_login.py |
+++ b/chrome/test/functional/chromeos_login.py |
@@ -10,6 +10,7 @@ import sys |
import pyauto_functional # Must be imported before pyauto |
import pyauto |
import pyauto_errors |
+import test_utils |
sys.path.append('/usr/local') # To make autotest libs importable. |
@@ -221,6 +222,33 @@ class ChromeosLogin(pyauto.PyUITest): |
self.testGoodLogin() # Re-login with same account. |
_VerifyProfile() |
+ def testGuestCrosh(self): |
+ """Verify we can use crosh in guest mode.""" |
+ 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) |
+ test_utils.OpenCroshVerification(self) |
+ |
+ # 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.') |
+ |
if __name__ == '__main__': |
pyauto_functional.Main() |