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 import os | 6 import os |
7 | 7 |
8 import pyauto_functional | 8 import pyauto_functional |
9 import pyauto | 9 import pyauto |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 self.chrome_proc_name = self.CHROME_PROCESS_NAME['win'] | 46 self.chrome_proc_name = self.CHROME_PROCESS_NAME['win'] |
47 elif self.IsMac(): | 47 elif self.IsMac(): |
48 self.proc_count_fresh_profile = self.FRESH_PROFILE_PROC_COUNT['mac'] | 48 self.proc_count_fresh_profile = self.FRESH_PROFILE_PROC_COUNT['mac'] |
49 self.chrome_proc_name = self.CHROME_PROCESS_NAME['mac'] | 49 self.chrome_proc_name = self.CHROME_PROCESS_NAME['mac'] |
50 elif self.IsLinux(): | 50 elif self.IsLinux(): |
51 self.proc_count_fresh_profile = self.FRESH_PROFILE_PROC_COUNT['linux'] | 51 self.proc_count_fresh_profile = self.FRESH_PROFILE_PROC_COUNT['linux'] |
52 self.chrome_proc_name = self.CHROME_PROCESS_NAME['linux'] | 52 self.chrome_proc_name = self.CHROME_PROCESS_NAME['linux'] |
53 | 53 |
54 pyauto.PyUITest.setUp(self) | 54 pyauto.PyUITest.setUp(self) |
55 | 55 |
56 # Forcibly trigger all plugins to get registered. crbug.com/94123 | |
57 # Sometimes flash files loaded too quickly after firing browser | |
58 # ends up getting downloaded, which seems to indicate that the plugin | |
59 # hasn't been registered yet. | |
60 self.GetPluginsInfo() | |
61 | |
62 def _VerifyProcessCount(self, num_expected): | 56 def _VerifyProcessCount(self, num_expected): |
63 """Verifies the number of Chrome-related processes is as expected. | 57 """Verifies the number of Chrome-related processes is as expected. |
64 | 58 |
65 Args: | 59 Args: |
66 num_expected: An integer representing the expected number of Chrome- | 60 num_expected: An integer representing the expected number of Chrome- |
67 related processes that should currently exist. | 61 related processes that should currently exist. |
68 """ | 62 """ |
69 proc_info = self.GetProcessInfo() | 63 proc_info = self.GetProcessInfo() |
70 browser_info = [x for x in proc_info['browsers'] | 64 browser_info = [x for x in proc_info['browsers'] |
71 if x['process_name'] == self.chrome_proc_name] | 65 if x['process_name'] == self.chrome_proc_name] |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 self.OpenNewBrowserWindow(True) | 129 self.OpenNewBrowserWindow(True) |
136 | 130 |
137 for _ in xrange(3): | 131 for _ in xrange(3): |
138 self.AppendTab(pyauto.GURL('about:blank'), 1) | 132 self.AppendTab(pyauto.GURL('about:blank'), 1) |
139 | 133 |
140 self._VerifyProcessCount(self.proc_count_fresh_profile + 8) | 134 self._VerifyProcessCount(self.proc_count_fresh_profile + 8) |
141 | 135 |
142 | 136 |
143 if __name__ == '__main__': | 137 if __name__ == '__main__': |
144 pyauto_functional.Main() | 138 pyauto_functional.Main() |
OLD | NEW |