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

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

Issue 7337007: Introduce a field trial for Instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reverting ifdef'ed constructor Created 9 years, 4 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 | « chrome/test/data/webui/options.js ('k') | 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) 2011 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2011 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 cgi 7 import cgi
8 import os 8 import os
9 9
10 import pyauto_functional # Must be imported before pyauto 10 import pyauto_functional # Must be imported before pyauto
11 import pyauto 11 import pyauto
12 12
13 13
14 class InstantSettingsTest(pyauto.PyUITest): 14 class InstantSettingsTest(pyauto.PyUITest):
15 """Test Chrome Instant settings.""" 15 """Test Chrome Instant settings."""
16 16
17 def testEnableDisableInstant(self): 17 def testEnableDisableInstant(self):
18 """Test to verify default Chrome Instant setting. 18 """Test to verify default Chrome Instant setting.
19 Check if the setting can be enabled and disabled.""" 19 Check if the setting can be enabled and disabled."""
20 self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kInstantEnabled), 20 self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kInstantEnabled),
21 msg='Instant is enabled by default.') 21 msg='Instant is enabled by default.')
22 # Enable instant. 22 # Enable instant.
23 self.SetPrefs(pyauto.kInstantEnabled, True) 23 self.SetPrefs(pyauto.kInstantEnabled, True)
24 self.SetPrefs(pyauto.kInstantEnabledOnce, True)
24 self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kInstantEnabled), 25 self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kInstantEnabled),
25 msg='Instant is not enabled.') 26 msg='Instant is not enabled.')
26 self.SetOmniboxText('google.com') 27 self.SetOmniboxText('google.com')
27 self.assertTrue(self.WaitUntil( 28 self.assertTrue(self.WaitUntil(
28 lambda: self.GetInstantInfo().get('current') and not 29 lambda: self.GetInstantInfo().get('current') and not
29 self.GetInstantInfo().get('loading'))) 30 self.GetInstantInfo().get('loading')))
30 title = self.GetInstantInfo()['title'] 31 title = self.GetInstantInfo()['title']
31 self.assertEqual('Google', title, msg='Instant did not load.') 32 self.assertEqual('Google', title, msg='Instant did not load.')
32 # Disable Instant. 33 # Disable Instant.
33 self.SetPrefs(pyauto.kInstantEnabled, False) 34 self.SetPrefs(pyauto.kInstantEnabled, False)
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 """Test that instant loads PNG file.""" 266 """Test that instant loads PNG file."""
266 self._AssertInstantLoadsFile(os.path.join('save_page', '1.png')) 267 self._AssertInstantLoadsFile(os.path.join('save_page', '1.png'))
267 268
268 def testInstantLoadsSVG(self): 269 def testInstantLoadsSVG(self):
269 """Test that instant loads SVG file.""" 270 """Test that instant loads SVG file."""
270 self._AssertInstantLoadsFile(os.path.join('circle.svg')) 271 self._AssertInstantLoadsFile(os.path.join('circle.svg'))
271 272
272 273
273 if __name__ == '__main__': 274 if __name__ == '__main__':
274 pyauto_functional.Main() 275 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « chrome/test/data/webui/options.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698