Index: chrome/test/functional/chromeos_browser.py |
diff --git a/chrome/test/functional/chromeos_browser.py b/chrome/test/functional/chromeos_browser.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..f5af7a3a74db175d97e79385e112101a294a561a |
--- /dev/null |
+++ b/chrome/test/functional/chromeos_browser.py |
@@ -0,0 +1,29 @@ |
+#!/usr/bin/python |
+# Copyright (c) 2011 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 pyauto_functional # pyauto_functional must come before pyauto |
dennis_jeffrey
2011/08/26 01:35:50
nit: add period at end of comment sentence
tturchetto
2011/08/26 02:07:37
Done.
|
+import pyauto |
+ |
+ |
+class ChromeosBrowserTest(pyauto.PyUITest): |
+ |
+ def testCloseAllTabs(self): |
+ """Close all tabs and verifies 1 tab is still open on Chrome OS.""" |
dennis_jeffrey
2011/08/26 01:35:50
nit: choose 1 of the following:
1) 'verifies' -->
tturchetto
2011/08/26 02:07:37
Done.
|
+ tab_count = self.GetTabCount() |
+ |
+ for tab_index in xrange(tab_count - 1, -1, -1): |
dennis_jeffrey
2011/08/26 01:35:50
(optional): I think it should work the same if you
tturchetto
2011/08/26 02:07:37
Chatted this offline. Will keep as it is.
On 2011
dennis_jeffrey
2011/08/26 02:12:45
Yes, I had made a mistake: if we make the change I
|
+ self.GetBrowserWindow(0).GetTab(tab_index).Close(True) |
+ |
+ info = self.GetBrowserInfo() |
+ self.assertEqual(1, len(info['windows'])) |
+ self.assertEqual(1, len(info['windows'][0]['tabs'])) |
+ self.assertEqual('chrome://newtab/', info['windows'][0]['tabs'][0]['url']) |
dennis_jeffrey
2011/08/26 01:35:50
Remove this line; this is already checked now in l
tturchetto
2011/08/26 02:07:37
Done.
|
+ url = info['windows'][0]['tabs'][0]['url'] |
+ self.assertEqual('chrome://newtab/', url, |
+ msg = 'Unexpected URL: %s' % url) |
dennis_jeffrey
2011/08/26 01:35:50
remove the spaces before and after the '='
tturchetto
2011/08/26 02:07:37
Done.
|
+ |
+ |
+if __name__ == '__main__': |
+ pyauto_functional.Main() |