| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 | 9 |
| 10 import pyauto_functional # Must be imported before pyauto | 10 import pyauto_functional # Must be imported before pyauto |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 Returns: | 33 Returns: |
| 34 a list of 2-tuple, corresponding to the html file used for test and the | 34 a list of 2-tuple, corresponding to the html file used for test and the |
| 35 name of the plugin | 35 name of the plugin |
| 36 """ | 36 """ |
| 37 plugins = [('flash-clicktoplay.html', 'Shockwave Flash'), | 37 plugins = [('flash-clicktoplay.html', 'Shockwave Flash'), |
| 38 ('java_new.html', 'Java'),] # common to all platforms | 38 ('java_new.html', 'Java'),] # common to all platforms |
| 39 if self.IsWin() or self.IsMac(): | 39 if self.IsWin() or self.IsMac(): |
| 40 plugins = plugins + [ | 40 plugins = plugins + [ |
| 41 ('silverlight_new.html', 'Silverlight'), | 41 ('silverlight_new.html', 'Silverlight'), |
| 42 ('quicktime.html', 'QuickTime'), | 42 ('quicktime.html', 'Quicktime'), |
| 43 ('wmp_new.html', 'Windows Media'), | 43 ('wmp_new.html', 'Windows Media'), |
| 44 ('real.html', 'RealPlayer'), | 44 ('real.html', 'RealPlayer'), |
| 45 ] | 45 ] |
| 46 | 46 |
| 47 out = [] | 47 out = [] |
| 48 # Emit warnings for plugins that are not installed on the machine and | 48 # Emit warnings for plugins that are not installed on the machine and |
| 49 # therefore cannot be tested. | 49 # therefore cannot be tested. |
| 50 plugins_info = self.GetPluginsInfo() | 50 plugins_info = self.GetPluginsInfo() |
| 51 for fname, name in plugins: | 51 for fname, name in plugins: |
| 52 for a_plugin in plugins_info.Plugins(): | 52 for a_plugin in plugins_info.Plugins(): |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 # Add an exception to block plugins on hulu.com. | 198 # Add an exception to block plugins on hulu.com. |
| 199 self.SetPrefs(pyauto.kContentSettingsPatterns, | 199 self.SetPrefs(pyauto.kContentSettingsPatterns, |
| 200 {'[*.]hulu.com': {'plugins': 2}}) | 200 {'[*.]hulu.com': {'plugins': 2}}) |
| 201 self.GetBrowserWindow(0).GetTab(0).Reload() | 201 self.GetBrowserWindow(0).GetTab(0).Reload() |
| 202 self.assertFalse(self._GetPluginPID('Shockwave Flash'), | 202 self.assertFalse(self._GetPluginPID('Shockwave Flash'), |
| 203 msg='Plug-in not blocked.') | 203 msg='Plug-in not blocked.') |
| 204 | 204 |
| 205 | 205 |
| 206 if __name__ == '__main__': | 206 if __name__ == '__main__': |
| 207 pyauto_functional.Main() | 207 pyauto_functional.Main() |
| OLD | NEW |