OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import os | 6 import os |
7 | 7 |
8 import pyauto_functional # must be imported before pyauto | 8 import pyauto_functional # must be imported before pyauto |
9 import pyauto | 9 import pyauto |
10 import test_utils | 10 import test_utils |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 url = self.GetActiveTabURL() | 51 url = self.GetActiveTabURL() |
52 count = bookmarks.NodeCount() | 52 count = bookmarks.NodeCount() |
53 self.AddBookmarkURL(bar_id, 0, name, url.spec()) | 53 self.AddBookmarkURL(bar_id, 0, name, url.spec()) |
54 bookmarks = self.GetBookmarkModel() | 54 bookmarks = self.GetBookmarkModel() |
55 node = bookmarks.BookmarkBar()['children'][0] | 55 node = bookmarks.BookmarkBar()['children'][0] |
56 self.assertEqual(count + 1, bookmarks.NodeCount()) | 56 self.assertEqual(count + 1, bookmarks.NodeCount()) |
57 self.assertEqual(node['type'], 'url') | 57 self.assertEqual(node['type'], 'url') |
58 self.assertEqual(node['name'], name) | 58 self.assertEqual(node['name'], name) |
59 self.assertEqual(url.spec(), node['url']) | 59 self.assertEqual(url.spec(), node['url']) |
60 | 60 |
61 def testMultipleWindowCrosh(self): | |
62 """Test that crosh can be opened in multiple windows.""" | |
63 test_utils.OpenCroshVerification(self) | |
64 | |
65 for windex in range (1, 4): # 3 new windows | |
66 self.OpenNewBrowserWindow(True) | |
67 self.OpenCrosh() | |
68 self.assertEqual('crosh', self.GetActiveTabTitle()) | |
69 | |
70 # Verify crosh prompt. | |
71 self.WaitForHtermText(text='crosh> ', tab_index=1, windex=windex, | |
Nirnimesh
2012/08/06 21:49:48
why is the tab_index hardcoded to 1?
tturchetto
2012/08/06 21:53:48
Because open browser takes tab 0, open crosh takes
Nirnimesh
2012/08/06 22:03:02
What's the point of checking the same thing 3 time
tturchetto
2012/08/06 22:28:53
Because if it doesn't mention the tab, test would
Nirnimesh
2012/08/06 22:34:46
You're telling me symptoms for what's not working.
| |
72 msg='Could not find "crosh> " prompt') | |
73 self.assertTrue( | |
74 self.GetHtermRowsText(start=0, end=2, tab_index=1, | |
Nirnimesh
2012/08/06 21:49:48
ditto
tturchetto
2012/08/06 21:53:48
ditto
| |
75 windex=windex).endswith('crosh> '), | |
76 msg='Could not find "crosh> " prompt') | |
77 | |
78 # Exit crosh. | |
79 self.SendKeysToHterm('exit\\n', tab_index=1, windex=windex) | |
80 self.WaitForHtermText(text='command crosh completed with exit code 0', | |
81 tab_index=1, windex=windex, | |
82 msg='Could not exit crosh.') | |
83 | |
61 | 84 |
62 if __name__ == '__main__': | 85 if __name__ == '__main__': |
63 pyauto_functional.Main() | 86 pyauto_functional.Main() |
OLD | NEW |