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 """PyAuto: Python Interface to Chromium's Automation Proxy. | 6 """PyAuto: Python Interface to Chromium's Automation Proxy. |
7 | 7 |
8 PyAuto uses swig to expose Automation Proxy interfaces to Python. | 8 PyAuto uses swig to expose Automation Proxy interfaces to Python. |
9 For complete documentation on the functionality available, | 9 For complete documentation on the functionality available, |
10 run pydoc on this file. | 10 run pydoc on this file. |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 named_channel_id = self.EnableChromeTestingOnChromeOS() | 187 named_channel_id = self.EnableChromeTestingOnChromeOS() |
188 else: | 188 else: |
189 self._SetExtraChromeFlags() # Flags already previously set for ChromeOS. | 189 self._SetExtraChromeFlags() # Flags already previously set for ChromeOS. |
190 if named_channel_id: | 190 if named_channel_id: |
191 self._named_channel_id = named_channel_id | 191 self._named_channel_id = named_channel_id |
192 self.UseNamedChannelID(named_channel_id) | 192 self.UseNamedChannelID(named_channel_id) |
193 # Initialize automation and fire the browser (does not fire the browser | 193 # Initialize automation and fire the browser (does not fire the browser |
194 # on ChromeOS). | 194 # on ChromeOS). |
195 self.SetUp() | 195 self.SetUp() |
196 | 196 |
| 197 # Forcibly trigger all plugins to get registered. crbug.com/94123 |
| 198 # Sometimes flash files loaded too quickly after firing browser |
| 199 # ends up getting downloaded, which seems to indicate that the plugin |
| 200 # hasn't been registered yet. |
| 201 self.GetPluginsInfo() |
| 202 |
197 # TODO(dtu): Remove this after crosbug.com/4558 is fixed. | 203 # TODO(dtu): Remove this after crosbug.com/4558 is fixed. |
198 if self.IsChromeOS(): | 204 if self.IsChromeOS(): |
199 self.WaitUntil(lambda: not self.GetNetworkInfo()['offline_mode']) | 205 self.WaitUntil(lambda: not self.GetNetworkInfo()['offline_mode']) |
200 | 206 |
201 # If we are connected to any RemoteHosts, create PyAuto | 207 # If we are connected to any RemoteHosts, create PyAuto |
202 # instances on the remote sides and set them up too. | 208 # instances on the remote sides and set them up too. |
203 for remote in self.remotes: | 209 for remote in self.remotes: |
204 remote.CreateTarget(self) | 210 remote.CreateTarget(self) |
205 remote.setUp() | 211 remote.setUp() |
206 | 212 |
(...skipping 4646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4853 successful = result.wasSuccessful() | 4859 successful = result.wasSuccessful() |
4854 if not successful: | 4860 if not successful: |
4855 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) | 4861 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) |
4856 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ | 4862 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ |
4857 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) | 4863 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) |
4858 sys.exit(not successful) | 4864 sys.exit(not successful) |
4859 | 4865 |
4860 | 4866 |
4861 if __name__ == '__main__': | 4867 if __name__ == '__main__': |
4862 Main() | 4868 Main() |
OLD | NEW |