summaryrefslogtreecommitdiffstats
path: root/chrome/test/functional/plugins.py
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-06 08:17:05 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-06 08:17:05 +0000
commitf7d48015503c80e2f29df6a59b39a179649a6a5f (patch)
tree42e2bebe5b47cb7448c6ee6e4deffa6e2fbcf1c7 /chrome/test/functional/plugins.py
parent03e32def91b569982af74094c51651924d38e70c (diff)
downloadchromium_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/plugins.py')
-rw-r--r--chrome/test/functional/plugins.py44
1 files changed, 44 insertions, 0 deletions
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()
+