summaryrefslogtreecommitdiffstats
path: root/chrome/test/functional
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-27 14:41:23 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-27 14:41:23 +0000
commitfdb0da2fdec16bde1c24e9c7b8029e64fd0b280c (patch)
tree0ec5940c7c85898e6fffad4c9457191a09116e2c /chrome/test/functional
parentbb439eb81b70c9fa551a9762c3732fbc739e9e8e (diff)
downloadchromium_src-fdb0da2fdec16bde1c24e9c7b8029e64fd0b280c.zip
chromium_src-fdb0da2fdec16bde1c24e9c7b8029e64fd0b280c.tar.gz
chromium_src-fdb0da2fdec16bde1c24e9c7b8029e64fd0b280c.tar.bz2
Make about_plugins_ui.py not use automation apis for checking whether a plugin is enabled or not. Right now, this test only uses webdriver, and pyauto just for starting the browser and navigating to a page.
BUG=143637 Review URL: https://chromiumcodereview.appspot.com/10874045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/functional')
-rwxr-xr-xchrome/test/functional/about_plugins_ui.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/chrome/test/functional/about_plugins_ui.py b/chrome/test/functional/about_plugins_ui.py
index 6a2b723..0ebde00 100755
--- a/chrome/test/functional/about_plugins_ui.py
+++ b/chrome/test/functional/about_plugins_ui.py
@@ -41,18 +41,19 @@ class ChromeAboutPluginsUITest(pyauto.PyUITest):
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 @@ class ChromeAboutPluginsUITest(pyauto.PyUITest):
# 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 @@ class ChromeAboutPluginsUITest(pyauto.PyUITest):
'.//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__':