Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/usr/bin/python | |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 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.
| |
| 7 import pyauto | |
| 8 | |
| 9 | |
| 10 class ChromeosBrowserTest(pyauto.PyUITest): | |
| 11 | |
| 12 def testCloseAllTabs(self): | |
| 13 """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.
| |
| 14 tab_count = self.GetTabCount() | |
| 15 | |
| 16 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
| |
| 17 self.GetBrowserWindow(0).GetTab(tab_index).Close(True) | |
| 18 | |
| 19 info = self.GetBrowserInfo() | |
| 20 self.assertEqual(1, len(info['windows'])) | |
| 21 self.assertEqual(1, len(info['windows'][0]['tabs'])) | |
| 22 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.
| |
| 23 url = info['windows'][0]['tabs'][0]['url'] | |
| 24 self.assertEqual('chrome://newtab/', url, | |
| 25 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.
| |
| 26 | |
| 27 | |
| 28 if __name__ == '__main__': | |
| 29 pyauto_functional.Main() | |
| OLD | NEW |