Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: chrome/test/functional/chromeos_crosh.py

Issue 10778006: Adding HTML Terminal test case: 1. TestAddBookmark, 2. Login as guest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed a ling Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 10
(...skipping 26 matching lines...) Expand all
37 # Run a crosh command. 37 # Run a crosh command.
38 self.SendKeysToHterm('help\\n') 38 self.SendKeysToHterm('help\\n')
39 self.WaitForHtermText(text='help_advanced', 39 self.WaitForHtermText(text='help_advanced',
40 msg='Could not find "help_advanced" in help output.') 40 msg='Could not find "help_advanced" in help output.')
41 41
42 # Exit crosh and close tab. 42 # Exit crosh and close tab.
43 self.SendKeysToHterm('exit\\n') 43 self.SendKeysToHterm('exit\\n')
44 self.WaitForHtermText(text='command crosh completed with exit code 0', 44 self.WaitForHtermText(text='command crosh completed with exit code 0',
45 msg='Could not exit crosh.') 45 msg='Could not exit crosh.')
46 46
47 def testAddBookmark(self):
48 """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.
49 self.assertEqual(0, self.GetBrowserWindowCount())
50 self.OpenCrosh()
51 self.assertEqual(1, self.GetBrowserWindowCount())
52 self.assertEqual(1, self.GetTabCount(),
53 msg='Could not open crosh')
54 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.
55
56 # Add bookmark.
57 bookmarks = self.GetBookmarkModel()
58 bar_id = bookmarks.BookmarkBar()['id']
59 name = 'crosh'
60 url = self.GetActiveTabURL()
61 count = bookmarks.NodeCount()
62 self.AddBookmarkURL(bar_id, 0, name, url.spec())
63 bookmarks = self.GetBookmarkModel()
64 node = bookmarks.BookmarkBar()['children'][0]
65 self.assertEqual(count + 1, bookmarks.NodeCount())
66 self.assertEqual(node['type'], 'url')
67 self.assertEqual(node['name'], name)
68 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?
69
47 70
48 if __name__ == '__main__': 71 if __name__ == '__main__':
49 pyauto_functional.Main() 72 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « no previous file | chrome/test/functional/chromeos_login.py » ('j') | chrome/test/functional/chromeos_login.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698