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 # Must import this first | 6 # Must import this first |
7 import pyauto_functional | 7 import pyauto_functional |
8 | 8 |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 self.assertEqual(1, len(nodes)) | 657 self.assertEqual(1, len(nodes)) |
658 self.SetBookmarkTitle(nodes[0]['id'], 'YouTube', 2) | 658 self.SetBookmarkTitle(nodes[0]['id'], 'YouTube', 2) |
659 self.SetBookmarkURL(nodes[0]['id'], 'http://www.youtube.com', 2) | 659 self.SetBookmarkURL(nodes[0]['id'], 'http://www.youtube.com', 2) |
660 default_path, profile1_path, profile2_path = self._GetProfilePath() | 660 default_path, profile1_path, profile2_path = self._GetProfilePath() |
661 # Close profile1/profile2 windows. | 661 # Close profile1/profile2 windows. |
662 self.CloseBrowserWindow(2) | 662 self.CloseBrowserWindow(2) |
663 self.CloseBrowserWindow(1) | 663 self.CloseBrowserWindow(1) |
664 # Launch profile1, verify bookmark is same as before. | 664 # Launch profile1, verify bookmark is same as before. |
665 self.OpenProfileWindow(path=profile1_path) | 665 self.OpenProfileWindow(path=profile1_path) |
666 self._AssertBookmark('GoogleNews', 'http://news.google.com/', windex=1) | 666 self._AssertBookmark('GoogleNews', 'http://news.google.com/', windex=1) |
667 # Launch default, verify bookmark is changed to 'YouTube'. | 667 self.CloseBrowserWindow(1) |
668 self.OpenProfileWindow(path=default_path) | |
669 self._AssertBookmark('YouTube', 'http://www.youtube.com/') | 668 self._AssertBookmark('YouTube', 'http://www.youtube.com/') |
670 | 669 |
671 def testSearchBookmarksInMultiProfile(self): | 670 def testSearchBookmarksInMultiProfile(self): |
672 """Verify user can not search bookmarks in other profile.""" | 671 """Verify user can not search bookmarks in other profile.""" |
673 # Add 'GoogleNews', 'Youtube' as bookmarks in default profile. | 672 # Add 'GoogleNews', 'Youtube' as bookmarks in default profile. |
674 self.OpenNewBrowserWindowWithNewProfile() | 673 self.OpenNewBrowserWindowWithNewProfile() |
675 bookmarks = self.GetBookmarkModel(windex=1) | 674 bookmarks = self.GetBookmarkModel(windex=1) |
676 bar_id = bookmarks.BookmarkBar()['id'] | 675 bar_id = bookmarks.BookmarkBar()['id'] |
677 self.AddBookmarkURL(bar_id, 0, 'GoogleNews', | 676 self.AddBookmarkURL(bar_id, 0, 'GoogleNews', |
678 'http://news.google.com/', 1) | 677 'http://news.google.com/', 1) |
(...skipping 15 matching lines...) Expand all Loading... |
694 self.assertEqual(0, len(node)) | 693 self.assertEqual(0, len(node)) |
695 # Search 'DB' in profile 1. | 694 # Search 'DB' in profile 1. |
696 self.OpenProfileWindow(path=profile2_path) | 695 self.OpenProfileWindow(path=profile2_path) |
697 bookmarks = self.GetBookmarkModel(windex=2) | 696 bookmarks = self.GetBookmarkModel(windex=2) |
698 node = bookmarks.FindByTitle('GoogleNews') | 697 node = bookmarks.FindByTitle('GoogleNews') |
699 self.assertEqual(0, len(node)) | 698 self.assertEqual(0, len(node)) |
700 | 699 |
701 | 700 |
702 if __name__ == '__main__': | 701 if __name__ == '__main__': |
703 pyauto_functional.Main() | 702 pyauto_functional.Main() |
OLD | NEW |