summaryrefslogtreecommitdiffstats
path: root/chrome/test/functional
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 21:09:14 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 21:09:14 +0000
commitef413cad1e7daa23b6b52062066462d4e76f2374 (patch)
tree9228a268fdcf652aae0d2c2da449ba4081232903 /chrome/test/functional
parent8e27873fcab3f343096e43ffa72f4ee78597380c (diff)
downloadchromium_src-ef413cad1e7daa23b6b52062066462d4e76f2374.zip
chromium_src-ef413cad1e7daa23b6b52062066462d4e76f2374.tar.gz
chromium_src-ef413cad1e7daa23b6b52062066462d4e76f2374.tar.bz2
Fetch a bunch of info from the browser
This includes info about the browser/renderer/extension/other PIDs, window size. Add a method to set window size. Add tests to verify window size, and verify flash loading. BUG=43234 TEST=python chrome/test/functional/browser.py Review URL: http://codereview.chromium.org/2133013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48192 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/functional')
-rw-r--r--chrome/test/functional/PYAUTO_TESTS1
-rw-r--r--chrome/test/functional/browser.py35
2 files changed, 31 insertions, 5 deletions
diff --git a/chrome/test/functional/PYAUTO_TESTS b/chrome/test/functional/PYAUTO_TESTS
index a0c80c0..656f2b99 100644
--- a/chrome/test/functional/PYAUTO_TESTS
+++ b/chrome/test/functional/PYAUTO_TESTS
@@ -44,6 +44,7 @@
'linux': [
'-omnibox', # http://crbug.com/44203
+ '-browser.BrowserTest.testWindowResize', # crbug.com/44963
],
# TODO(nirnimesh): Add a ChromeOS section
diff --git a/chrome/test/functional/browser.py b/chrome/test/functional/browser.py
index 7d2b08b..05aea1e 100644
--- a/chrome/test/functional/browser.py
+++ b/chrome/test/functional/browser.py
@@ -3,6 +3,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import os
import re
import pyauto_functional # Must be imported before pyauto
@@ -21,14 +22,38 @@ class BrowserTest(pyauto.PyUITest):
pp = pprint.PrettyPrinter(indent=2)
while True:
raw_input('Hit <enter> to dump info.. ')
- properties = self.GetBrowserInfo()
- self.assertTrue(properties)
- pp.pprint(properties)
+ info = self.GetBrowserInfo()
+ pp.pprint(info)
def testGotVersion(self):
"""Verify there's a valid version string."""
- version_string = self.GetBrowserInfo()['ChromeVersion']
- self.assertTrue(re.match("\d+\.\d+\.\d+.\.\d+", version_string))
+ version_string = self.GetBrowserInfo()['properties']['ChromeVersion']
+ self.assertTrue(re.match('\d+\.\d+\.\d+.\.\d+', version_string))
+
+ def testWindowResize(self):
+ """Verify window resizing and persistence after restart."""
+ def _VerifySize(x, y, width, height):
+ info = self.GetBrowserInfo()
+ self.assertEqual(x, info['windows'][0]['x'])
+ self.assertEqual(y, info['windows'][0]['y'])
+ self.assertEqual(width, info['windows'][0]['width'])
+ self.assertEqual(height, info['windows'][0]['height'])
+ self.SetWindowDimensions(x=20, y=40, width=600, height=300)
+ _VerifySize(20, 40, 600, 300)
+ self.RestartBrowser(clear_profile=False)
+ _VerifySize(20, 40, 600, 300)
+
+ def testCanLoadFlash(self):
+ """Verify that we can play Flash.
+
+ We merely check that the flash process kicks in.
+ """
+ flash_url = self.GetFileURLForPath(os.path.join(self.DataDir(),
+ 'plugin', 'flash.swf'))
+ self.NavigateToURL(flash_url)
+ child_processes = self.GetBrowserInfo()['child_processes']
+ self.assertTrue([x for x in child_processes
+ if x['type'] == 'Plug-in' and x['name'] == 'Shockwave Flash'])
if __name__ == '__main__':