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

Side by Side Diff: chrome/test/functional/browser.py

Issue 7834050: Include chrome version info in a test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import os 6 import os
7 import re 7 import re
8 import types 8 import types
9 9
10 import pyauto_functional # Must be imported before pyauto 10 import pyauto_functional # Must be imported before pyauto
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 self.assertFalse(renderer_pid in seen_pids, 'renderer pid not unique') 65 self.assertFalse(renderer_pid in seen_pids, 'renderer pid not unique')
66 seen_pids[renderer_pid] = True 66 seen_pids[renderer_pid] = True
67 67
68 def testBasics(self): 68 def testBasics(self):
69 """Verify basic browser info at startup.""" 69 """Verify basic browser info at startup."""
70 url = self.GetFileURLForDataPath('title2.html') 70 url = self.GetFileURLForDataPath('title2.html')
71 self.NavigateToURL(url) 71 self.NavigateToURL(url)
72 info = self.GetBrowserInfo() 72 info = self.GetBrowserInfo()
73 # Verify valid version string 73 # Verify valid version string
74 version_string = info['properties']['ChromeVersion'] 74 version_string = info['properties']['ChromeVersion']
75 logging.info('ChromeVersion: %s' % version_string)
75 self.assertTrue(re.match('\d+\.\d+\.\d+.\.\d+', version_string)) 76 self.assertTrue(re.match('\d+\.\d+\.\d+.\.\d+', version_string))
76 # Verify browser process 77 # Verify browser process
77 self.assertEqual(types.IntType, type(info['browser_pid'])) 78 self.assertEqual(types.IntType, type(info['browser_pid']))
78 self.assertEqual(1, len(info['windows'])) # one window 79 self.assertEqual(1, len(info['windows'])) # one window
79 self.assertEqual(1, len(info['windows'][0]['tabs'])) # one tab 80 self.assertEqual(1, len(info['windows'][0]['tabs'])) # one tab
80 self.assertEqual(0, info['windows'][0]['selected_tab']) # 1st tab selected 81 self.assertEqual(0, info['windows'][0]['selected_tab']) # 1st tab selected
81 self.assertEqual(url, info['windows'][0]['tabs'][0]['url']) 82 self.assertEqual(url, info['windows'][0]['tabs'][0]['url'])
82 self.assertFalse(info['windows'][0]['fullscreen']) # not fullscreen 83 self.assertFalse(info['windows'][0]['fullscreen']) # not fullscreen
83 self._VerifyUniqueRendererProcesses(info) 84 self._VerifyUniqueRendererProcesses(info)
84 85
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 # Check if both are sharing a process id. 202 # Check if both are sharing a process id.
202 self.assertEquals( 203 self.assertEquals(
203 self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid'], 204 self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid'],
204 self.GetBrowserInfo()['windows'][1]['tabs'][0]['renderer_pid']) 205 self.GetBrowserInfo()['windows'][1]['tabs'][0]['renderer_pid'])
205 # The shared process id should be different from the previous one. 206 # The shared process id should be different from the previous one.
206 self.assertNotEqual(shared_pid, 207 self.assertNotEqual(shared_pid,
207 self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid']) 208 self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid'])
208 209
209 if __name__ == '__main__': 210 if __name__ == '__main__':
210 pyauto_functional.Main() 211 pyauto_functional.Main()
OLDNEW
« 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