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 | |
|
Nirnimesh
2011/08/26 01:14:59
nit: put another space before #
tturchetto
2011/08/26 01:22:24
Done.
| |
| 7 import pyauto | |
| 8 | |
| 9 | |
| 10 class ChromeosBrowserTest(pyauto.PyUITest): | |
| 11 """Close last tab test for ChromeOS. | |
|
Nirnimesh
2011/08/26 01:14:59
Remove this
tturchetto
2011/08/26 01:22:24
Done.
| |
| 12 | |
| 13 Requires ChromeOS to be logged in. | |
|
Nirnimesh
2011/08/26 01:14:59
Remove this
tturchetto
2011/08/26 01:22:24
Done.
| |
| 14 """ | |
| 15 | |
| 16 def testCloseAllTabs(self): | |
| 17 """Close all tabs and verifies 1 tab is still open on Chrome OS.""" | |
| 18 tab_count = self.GetTabCount() | |
| 19 | |
| 20 for tab_index in xrange(tab_count - 1, -1, -1): | |
| 21 self.GetBrowserWindow(0).GetTab(tab_index).Close(True) | |
| 22 | |
| 23 info = self.GetBrowserInfo() | |
| 24 self.assertEqual(1, len(info['windows'])) | |
| 25 self.assertEqual(1, len(info['windows'][0]['tabs'])) | |
| 26 self.assertEqual('chrome://newtab/', info['windows'][0]['tabs'][0]['url']) | |
| 27 url = info['windows'][0]['tabs'][0]['url'] | |
| 28 self.assertEqual('chrome://newtab/', url, | |
| 29 msg = 'Unexpected URL: %s' % url) | |
| 30 | |
|
Nirnimesh
2011/08/26 01:14:59
need another blank line here
tturchetto
2011/08/26 01:22:24
Done.
| |
| 31 if __name__ == '__main__': | |
| 32 pyauto_functional.Main() | |
| OLD | NEW |