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

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

Issue 6325003: Adding pyAuto tests for Chrome Instant features (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 2
3 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import os
8
7 import pyauto_functional # Must be imported before pyauto 9 import pyauto_functional # Must be imported before pyauto
8 import pyauto 10 import pyauto
9 11
10 12
11 class InstantTest(pyauto.PyUITest): 13 class InstantTest(pyauto.PyUITest):
12 """TestCase for Omnibox Instant feature.""" 14 """TestCase for Omnibox Instant feature."""
13 15
14 def setUp(self): 16 def setUp(self):
15 pyauto.PyUITest.setUp(self) 17 pyauto.PyUITest.setUp(self)
16 self.SetPrefs(pyauto.kInstantEnabled, True) 18 self.SetPrefs(pyauto.kInstantEnabled, True)
(...skipping 16 matching lines...) Expand all
33 self.assertTrue('google.es' in location, 35 self.assertTrue('google.es' in location,
34 msg='No google.es in %s' % location) 36 msg='No google.es in %s' % location)
35 37
36 # Initiate instant search (at default google.com). 38 # Initiate instant search (at default google.com).
37 self.SetOmniboxText('chrome instant') 39 self.SetOmniboxText('chrome instant')
38 self.assertTrue(self.WaitUntil(self._DoneLoading)) 40 self.assertTrue(self.WaitUntil(self._DoneLoading))
39 location = self.GetInstantInfo()['location'] 41 location = self.GetInstantInfo()['location']
40 self.assertTrue('google.com' in location, 42 self.assertTrue('google.com' in location,
41 msg='No google.com in %s' % location) 43 msg='No google.com in %s' % location)
42 44
45 def testInstantDisabledInIncognito(self):
46 """Test that instant is disabled in Incognito mode."""
47 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW)
48 self.SetOmniboxText('google.com', windex=1)
49 self.assertFalse(self.GetInstantInfo()['active'],
50 'Instant enabled in Incognito mode.')
51
52 def testInstantOverlayNotStoredInHistory(self):
53 """Test that instant overlay page is not stored in history."""
54 url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title2.html'))
55 self.SetOmniboxText(url)
56 self.assertTrue(self.WaitUntil(self._DoneLoading))
57 history = self.GetHistoryInfo().History()
58 self.assertEqual(0, len(history))
59
60 def testInstantDisabledForJavaScript(self):
61 """Test that instant is disabled for javascript URLs."""
62 self.SetOmniboxText('javascript:')
63 self.assertFalse(self.GetInstantInfo()['active'],
64 'Instant enabled for javascript URL.')
65
43 66
44 if __name__ == '__main__': 67 if __name__ == '__main__':
45 pyauto_functional.Main() 68 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