diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 08:17:05 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 08:17:05 +0000 |
commit | f7d48015503c80e2f29df6a59b39a179649a6a5f (patch) | |
tree | 42e2bebe5b47cb7448c6ee6e4deffa6e2fbcf1c7 /chrome/test/functional | |
parent | 03e32def91b569982af74094c51651924d38e70c (diff) | |
download | chromium_src-f7d48015503c80e2f29df6a59b39a179649a6a5f.zip chromium_src-f7d48015503c80e2f29df6a59b39a179649a6a5f.tar.gz chromium_src-f7d48015503c80e2f29df6a59b39a179649a6a5f.tar.bz2 |
Add hooks to fetch about:plugins info for PyAuto.
Also, hooks for to enable/disable a plugin.
Add a test which excercises them.
Review URL: http://codereview.chromium.org/1935003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46553 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/functional')
-rw-r--r-- | chrome/test/functional/PYAUTO_TESTS | 1 | ||||
-rw-r--r-- | chrome/test/functional/plugins.py | 44 |
2 files changed, 45 insertions, 0 deletions
diff --git a/chrome/test/functional/PYAUTO_TESTS b/chrome/test/functional/PYAUTO_TESTS index c556fc0..146f039 100644 --- a/chrome/test/functional/PYAUTO_TESTS +++ b/chrome/test/functional/PYAUTO_TESTS @@ -22,6 +22,7 @@ 'downloads', 'history', 'navigation', + 'plugins', 'prefs', 'special_tabs', 'test_basic.SimpleTest.testCanOpenGoogle', diff --git a/chrome/test/functional/plugins.py b/chrome/test/functional/plugins.py new file mode 100644 index 0000000..4ac9267 --- /dev/null +++ b/chrome/test/functional/plugins.py @@ -0,0 +1,44 @@ +#!/usr/bin/python +# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import pyauto_functional # Must be imported before pyauto +import pyauto + + +class PluginsTest(pyauto.PyUITest): + """TestCase for Plugins.""" + + def Debug(self): + """Test method for experimentation. + + This method will not run automatically. + """ + import pprint + pp = pprint.PrettyPrinter(indent=2) + while True: + raw_input('Interact with the browser and hit <enter> to list plugins... ') + pp.pprint(self.GetPluginsInfo().Plugins()) + + def testHasFlash(self): + """Verify that Flash plugin loads and is enabled.""" + flash = self.GetPluginsInfo().FirstPluginForName('Shockwave Flash') + self.assertTrue(flash) + self.assertTrue(flash['enabled']) + + def testEnableDisableFlash(self): + """Verify that flash plugin can be enabled/disabled.""" + flash = self.GetPluginsInfo().FirstPluginForName('Shockwave Flash') + self.assertTrue(flash['enabled']) + self.DisablePlugin(flash['path']) + flash = self.GetPluginsInfo().FirstPluginForName('Shockwave Flash') + self.assertFalse(flash['enabled']) + self.EnablePlugin(flash['path']) + flash = self.GetPluginsInfo().FirstPluginForName('Shockwave Flash') + self.assertTrue(flash['enabled']) + + +if __name__ == '__main__': + pyauto_functional.Main() + |