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

Side by Side Diff: functional/plugins.py

Issue 6260015: Fixing pyauto plugins test... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: Created 9 years, 11 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/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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 def testBlockPluginException(self): 186 def testBlockPluginException(self):
187 """Verify that plugins can be blocked on a domain by adding 187 """Verify that plugins can be blocked on a domain by adding
188 an exception(s).""" 188 an exception(s)."""
189 # We are using the same live site in order to detect if the web page 189 # We are using the same live site in order to detect if the web page
190 # is using shockwave flash process. 190 # is using shockwave flash process.
191 # On few test machines navigation takes more than the default time so 191 # On few test machines navigation takes more than the default time so
192 # setting 1 min of wait time here. 192 # setting 1 min of wait time here.
193 test_utils.CallFunctionWithNewTimeout(self, 1 * 60 * 1000, 193 test_utils.CallFunctionWithNewTimeout(self, 1 * 60 * 1000,
194 lambda: self.NavigateToURL('http://vimeo.com')) 194 lambda: self.NavigateToURL('http://vimeo.com'))
195 pid = self._GetPluginPID('Shockwave Flash') 195 # Wait until Shockwave Flash plugin process loads.
196 self.assertTrue(pid, msg='No plugin process for Shockwave Flash') 196 self.assertTrue(self.WaitUntil(
197 self.Kill(pid) 197 lambda: self._GetPluginPID('Shockwave Flash') is not None),
198 msg='No plugin process for Shockwave Flash')
199 self.Kill(self._GetPluginPID('Shockwave Flash'))
198 self.assertTrue(self.WaitUntil( 200 self.assertTrue(self.WaitUntil(
199 lambda: self._GetPluginPID('Shockwave Flash') is None), 201 lambda: self._GetPluginPID('Shockwave Flash') is None),
200 msg='Expected Shockwave Flash plugin to die after killing') 202 msg='Expected Shockwave Flash plugin to die after killing')
201 203
202 # Add an exception to block plugins on hulu.com. 204 # Add an exception to block plugins on vimeo.com.
203 self.SetPrefs(pyauto.kContentSettingsPatterns, 205 self.SetPrefs(pyauto.kContentSettingsPatterns,
204 {'[*.]vimeo.com': {'plugins': 2}}) 206 {'[*.]vimeo.com': {'plugins': 2}})
205 self.GetBrowserWindow(0).GetTab(0).Reload() 207 self.GetBrowserWindow(0).GetTab(0).Reload()
206 self.assertFalse(self._GetPluginPID('Shockwave Flash'), 208 self.assertFalse(self._GetPluginPID('Shockwave Flash'),
207 msg='Plug-in not blocked.') 209 msg='Shockwave Flash Plug-in not blocked.')
208 210
209 211
210 if __name__ == '__main__': 212 if __name__ == '__main__':
211 pyauto_functional.Main() 213 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