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

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

Issue 9553016: pyauto: Don't need --multi-profiles flag anymore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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):
11 """Tests for Multi-Profile / Multi-users""" 11 """Tests for Multi-Profile / Multi-users"""
12 12
13 def Debug(self): 13 def Debug(self):
14 """Test method for experimentation. 14 """Test method for experimentation.
15 15
16 This method will not run automatically. 16 This method will not run automatically.
17 """ 17 """
18 while True: 18 while True:
19 raw_input('Hit <enter> to dump info.. ') 19 raw_input('Hit <enter> to dump info.. ')
20 self.pprint(self.GetMultiProfileInfo()) 20 self.pprint(self.GetMultiProfileInfo())
21 21
22 def ExtraChromeFlags(self):
23 """Enable multi-profiles on linux too."""
24 # TODO: Remove when --multi-profiles is enabled by default on linux.
25 flags = pyauto.PyUITest.ExtraChromeFlags(self)
26 if self.IsLinux():
27 flags.append('--multi-profiles')
28 return flags
29
30 def _CheckNumProfiles(self, expected_number): 22 def _CheckNumProfiles(self, expected_number):
31 """Returns True if |expected_number| is equal to the number of profiles.""" 23 """Returns True if |expected_number| is equal to the number of profiles."""
32 # TODO: Remove when crbug.com/108761 is fixed. 24 # TODO: Remove when crbug.com/108761 is fixed.
33 multi_profile = self.GetMultiProfileInfo() 25 multi_profile = self.GetMultiProfileInfo()
34 return expected_number == len(multi_profile['profiles']) 26 return expected_number == len(multi_profile['profiles'])
35 27
36 def testBasic(self): 28 def testBasic(self):
37 """Multi-profile windows can open.""" 29 """Multi-profile windows can open."""
38 self.assertEqual(1, self.GetBrowserWindowCount()) 30 self.assertEqual(1, self.GetBrowserWindowCount())
39 self.assertTrue(self.GetMultiProfileInfo()['enabled'], 31 self.assertTrue(self.GetMultiProfileInfo()['enabled'],
(...skipping 23 matching lines...) Expand all
63 # TODO: Remove when crbug.com/108761 is fixed. 55 # TODO: Remove when crbug.com/108761 is fixed.
64 self.WaitUntil(self._CheckNumProfiles, args=[index + 1]) 56 self.WaitUntil(self._CheckNumProfiles, args=[index + 1])
65 multi_profile = self.GetMultiProfileInfo() 57 multi_profile = self.GetMultiProfileInfo()
66 self.assertEqual(index + 1, len(multi_profile['profiles']), 58 self.assertEqual(index + 1, len(multi_profile['profiles']),
67 msg='Expected %d profiles after adding %d new users. Got %d' % ( 59 msg='Expected %d profiles after adding %d new users. Got %d' % (
68 index + 1, index, len(multi_profile['profiles']))) 60 index + 1, index, len(multi_profile['profiles'])))
69 61
70 62
71 if __name__ == '__main__': 63 if __name__ == '__main__':
72 pyauto_functional.Main() 64 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698