summaryrefslogtreecommitdiffstats
path: root/chrome/test/functional/chromeos_crosh.py
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-28 22:56:20 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-28 22:56:20 +0000
commited50d3ee0ed2e26da0ff805dc52ee0c03f80df2e (patch)
treec14a5de61bda8fb4cc694c7ea742c25838436026 /chrome/test/functional/chromeos_crosh.py
parenta43d46103fd0b4243332a9249f95649edb18200f (diff)
downloadchromium_src-ed50d3ee0ed2e26da0ff805dc52ee0c03f80df2e.zip
chromium_src-ed50d3ee0ed2e26da0ff805dc52ee0c03f80df2e.tar.gz
chromium_src-ed50d3ee0ed2e26da0ff805dc52ee0c03f80df2e.tar.bz2
Enable crosh tests on chromeos.
Rename chromeos_html_terminal.py to chromeos_crosh.py. Remove secure shell install test from it, since I'm putting a similar one in secure_shell.py BUG=None TEST=None R=craigdh@chromium.org Review URL: https://chromiumcodereview.appspot.com/10677019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144823 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/functional/chromeos_crosh.py')
-rwxr-xr-xchrome/test/functional/chromeos_crosh.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/chrome/test/functional/chromeos_crosh.py b/chrome/test/functional/chromeos_crosh.py
new file mode 100755
index 0000000..31dcc21
--- /dev/null
+++ b/chrome/test/functional/chromeos_crosh.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+
+import pyauto_functional # must be imported before pyauto
+import pyauto
+
+
+class CroshTest(pyauto.PyUITest):
+ """Tests for crosh."""
+
+ def setUp(self):
+ """Close all windows at startup."""
+ pyauto.PyUITest.setUp(self)
+ for _ in range(self.GetBrowserWindowCount()):
+ self.CloseBrowserWindow(0)
+
+ def testBasic(self):
+ """Verify crosh basic flow."""
+ self.assertEqual(0, self.GetBrowserWindowCount())
+ 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.')
+
+
+if __name__ == '__main__':
+ pyauto_functional.Main()