Index: chrome/test/functional/chromeos_crosh.py |
diff --git a/chrome/test/functional/chromeos_crosh.py b/chrome/test/functional/chromeos_crosh.py |
index 31dcc21e50368792e6ba935157934e725bc8c08c..c81a9d07f720bebd79ddb488476c41f0c2e5321b 100755 |
--- a/chrome/test/functional/chromeos_crosh.py |
+++ b/chrome/test/functional/chromeos_crosh.py |
@@ -44,6 +44,29 @@ class CroshTest(pyauto.PyUITest): |
self.WaitForHtermText(text='command crosh completed with exit code 0', |
msg='Could not exit crosh.') |
+ def testAddBookmark(self): |
+ """Test bookmark crosh.""" |
Nirnimesh
2012/07/25 07:03:45
Make this better. It's not clear what the test is.
tturchetto
2012/07/26 22:44:28
Done.
|
+ self.assertEqual(0, self.GetBrowserWindowCount()) |
+ self.OpenCrosh() |
+ self.assertEqual(1, self.GetBrowserWindowCount()) |
+ self.assertEqual(1, self.GetTabCount(), |
+ msg='Could not open crosh') |
+ self.assertEqual('crosh', self.GetActiveTabTitle()) |
Nirnimesh
2012/07/25 07:03:45
49-54 is the same as 23-28. Refactor to a separate
tturchetto
2012/07/26 22:44:28
Done.
|
+ |
+ # Add bookmark. |
+ bookmarks = self.GetBookmarkModel() |
+ bar_id = bookmarks.BookmarkBar()['id'] |
+ name = 'crosh' |
+ url = self.GetActiveTabURL() |
+ count = bookmarks.NodeCount() |
+ self.AddBookmarkURL(bar_id, 0, name, url.spec()) |
+ bookmarks = self.GetBookmarkModel() |
+ node = bookmarks.BookmarkBar()['children'][0] |
+ self.assertEqual(count + 1, bookmarks.NodeCount()) |
+ self.assertEqual(node['type'], 'url') |
+ self.assertEqual(node['name'], name) |
+ self.assertTrue(url.spec() in node['url']) |
Nirnimesh
2012/07/25 07:03:45
use assertEqual
tturchetto
2012/07/26 22:44:28
I am verifying condition, therefore assertTrue?
|
+ |
if __name__ == '__main__': |
pyauto_functional.Main() |