| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 pyauto_functional | 6 import pyauto_functional |
| 7 import pyauto | 7 import pyauto |
| 8 | 8 |
| 9 | 9 |
| 10 class MultiprofileTest(pyauto.PyUITest): | 10 class MultiprofileTest(pyauto.PyUITest): |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 multi_profile = self.GetMultiProfileInfo() | 38 multi_profile = self.GetMultiProfileInfo() |
| 39 self.assertEqual(2, len(multi_profile['profiles'])) | 39 self.assertEqual(2, len(multi_profile['profiles'])) |
| 40 new_profile = multi_profile['profiles'][1] | 40 new_profile = multi_profile['profiles'][1] |
| 41 self.assertEqual('User 1', new_profile['name']) | 41 self.assertEqual('User 1', new_profile['name']) |
| 42 | 42 |
| 43 # Verify browser windows. | 43 # Verify browser windows. |
| 44 self.assertEqual(2, self.GetBrowserWindowCount(), | 44 self.assertEqual(2, self.GetBrowserWindowCount(), |
| 45 msg='New browser window did not open') | 45 msg='New browser window did not open') |
| 46 info = self.GetBrowserInfo() | 46 info = self.GetBrowserInfo() |
| 47 new_profile_window = info['windows'][1] | 47 new_profile_window = info['windows'][1] |
| 48 self.assertEqual('profile_1', new_profile_window['profile_path']) | 48 self.assertEqual('Profile 1', new_profile_window['profile_path']) |
| 49 self.assertEqual(1, len(new_profile_window['tabs'])) | 49 self.assertEqual(1, len(new_profile_window['tabs'])) |
| 50 self.assertEqual('chrome://newtab/', new_profile_window['tabs'][0]['url']) | 50 self.assertEqual('chrome://newtab/', new_profile_window['tabs'][0]['url']) |
| 51 | 51 |
| 52 def test20NewProfiles(self): | 52 def test20NewProfiles(self): |
| 53 """Verify we can create 20 new profiles.""" | 53 """Verify we can create 20 new profiles.""" |
| 54 for index in range(1, 21): | 54 for index in range(1, 21): |
| 55 self.OpenNewBrowserWindowWithNewProfile() | 55 self.OpenNewBrowserWindowWithNewProfile() |
| 56 multi_profile = self.GetMultiProfileInfo() | 56 multi_profile = self.GetMultiProfileInfo() |
| 57 self.assertEqual(index + 1, len(multi_profile['profiles']), | 57 self.assertEqual(index + 1, len(multi_profile['profiles']), |
| 58 msg='Expected %d profiles after adding %d new users. Got %d' % ( | 58 msg='Expected %d profiles after adding %d new users. Got %d' % ( |
| 59 index + 1, index, len(multi_profile['profiles']))) | 59 index + 1, index, len(multi_profile['profiles']))) |
| 60 | 60 |
| 61 | 61 |
| 62 if __name__ == '__main__': | 62 if __name__ == '__main__': |
| 63 pyauto_functional.Main() | 63 pyauto_functional.Main() |
| OLD | NEW |