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

Unified Diff: chrome/test/functional/about_plugins_ui.py

Issue 10874045: Make about_plugins_ui.py not use automation apis for checking whether a plugin is enabled or not. R… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/about_plugins_ui.py
===================================================================
--- chrome/test/functional/about_plugins_ui.py (revision 153070)
+++ chrome/test/functional/about_plugins_ui.py (working copy)
@@ -41,18 +41,19 @@
import pdb
pdb.set_trace()
- def _IsEnabled(self, plugin_name):
+ def _IsEnabled(self, driver, plugin_name):
"""Checks if plugin is enabled.
Args:
+ driver: A Chrome driver object.
plugin_name: Plugin name to verify.
Returns:
True, if plugin is enabled, or False otherwise.
"""
- for plugin in self.GetPluginsInfo().Plugins():
- if re.search(plugin_name, plugin['name']):
- return plugin['enabled']
+ check_plugin_enabled_js = 'return navigator.plugins["%s"] != undefined' % \
+ plugin_name
+ return driver.execute_script(check_plugin_enabled_js)
def _ExpandDetailInfoLink(self, driver):
"""Expand detail info link.
@@ -99,13 +100,13 @@
# Disable PDF viewer plugin in about:plugins.
pdf_disable_link.click()
self.assertTrue(self.WaitUntil(lambda: not
- self._IsEnabled('Chrome PDF Viewer')))
+ self._IsEnabled(driver, 'Chrome PDF Viewer')))
# Re-enable PDF viewer plugin.
pdf_enable_link = driver.find_element_by_xpath(pdf_enable_path)
pdf_enable_link.click()
self.assertTrue(self.WaitUntil(lambda:
- self._IsEnabled('Chrome PDF Viewer')))
+ self._IsEnabled(driver, 'Chrome PDF Viewer')))
def testEnableAndDisableFlashPlugin(self):
"""Verify enable and disable flash plugins from about:plugins page."""
@@ -123,14 +124,14 @@
'.//a[text()="Disable"]')
flash_disable_link.click()
self.assertTrue(self.WaitUntil(lambda: not
- self._IsEnabled('Shockwave Flash')))
+ self._IsEnabled(driver, 'Shockwave Flash')))
# Re-enable Flash plugin from flash detail info.
flash_enable_link = flash_plugins_elem.find_element_by_xpath(
'.//a[text()="Enable"]')
flash_enable_link.click()
self.assertTrue(self.WaitUntil(lambda:
- self._IsEnabled('Shockwave Flash')))
+ self._IsEnabled(driver, 'Shockwave Flash')))
if __name__ == '__main__':
« 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