Chromium Code Reviews| Index: chrome/test/functional/close_tab.py |
| diff --git a/chrome/test/functional/close_tab.py b/chrome/test/functional/close_tab.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..9ee468874f3384db52c914c1009585843d2c6db2 |
| --- /dev/null |
| +++ b/chrome/test/functional/close_tab.py |
| @@ -0,0 +1,30 @@ |
| +#!/usr/bin/python |
|
dennis_jeffrey
2011/08/25 23:09:20
Since it looks like this test is chromeos-specific
tturchetto
2011/08/26 00:49:38
Renamed the file to chromeos_browser.py
On 2011/0
|
| +# 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 |
|
dennis_jeffrey
2011/08/25 23:09:20
I recommend adding a comment saying that this impo
tturchetto
2011/08/26 00:49:38
Done.
|
| +import pyauto |
| + |
| + |
| +class CloseTab(pyauto.PyUITest): |
| + """Close last tab test for ChromeOS. |
|
dennis_jeffrey
2011/08/25 23:09:20
Although there's only 1 test in this class right n
tturchetto
2011/08/26 00:49:38
Done.
|
| + |
| + Requires ChromeOS to be logged in. |
| + """ |
| + |
| + def testCloseAllTabs(self): |
| + """Close all tabs. There should be 1 tab open on Chrome OS""" |
|
dennis_jeffrey
2011/08/25 23:09:20
"Closes all tabs and verifies 1 tab is still open
tturchetto
2011/08/26 00:49:38
Done.
|
| + tab_count = self.GetTabCount() |
| + |
| + for tab_index in xrange(tab_count - 1, -1, -1): |
|
dennis_jeffrey
2011/08/25 23:09:20
how about using xrange(tab_count, 0, -1)? It seem
tturchetto
2011/08/26 00:49:38
this will give error message, therefore, I keep th
|
| + self.GetBrowserWindow(0).GetTab(tab_index).Close(True) |
| + |
| + info = self.GetBrowserInfo() |
| + self.assertEqual(1, len(info['windows'])) # one window |
|
dennis_jeffrey
2011/08/25 23:09:20
I think the comment is not necessary; it's easy to
tturchetto
2011/08/26 00:49:38
Done.
|
| + self.assertEqual(1, len(info['windows'][0]['tabs'])) # one tab |
|
dennis_jeffrey
2011/08/25 23:09:20
I think the comment is not necessary; it's easy to
tturchetto
2011/08/26 00:49:38
Done.
|
| + self.assertEqual('chrome://newtab/', |
| + info['windows'][0]['tabs'][0]['url']) # empty URL |
|
dennis_jeffrey
2011/08/25 23:09:20
I think the comment is not necessary, but it also
dennis_jeffrey
2011/08/25 23:09:20
For each of the 3 assertions above, you may want t
tturchetto
2011/08/26 00:49:38
Done.
tturchetto
2011/08/26 00:49:38
Done.
|
| + |
|
dennis_jeffrey
2011/08/25 23:09:20
Add 1 more blank line here.
tturchetto
2011/08/26 00:49:38
Done.
|
| +if __name__ == '__main__': |
| + pyauto_functional.Main() |