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

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

Issue 2857018: Add a test that verifies the DNS prefetching preference (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 10 years, 6 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) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 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 logging 6 import logging
7 import os 7 import os
8 import shutil 8 import shutil
9 import sys 9 import sys
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 self.SetPrefs(pyauto.kShowHomeButton, True) 113 self.SetPrefs(pyauto.kShowHomeButton, True)
114 if self.IsMac(): # win/linux don't have the 114 if self.IsMac(): # win/linux don't have the
115 self.assertFalse( # "browser.show_page_options_buttons" pref 115 self.assertFalse( # "browser.show_page_options_buttons" pref
116 self.GetPrefsInfo().Prefs(pyauto.kShowPageOptionsButtons)) 116 self.GetPrefsInfo().Prefs(pyauto.kShowPageOptionsButtons))
117 self.SetPrefs(pyauto.kShowPageOptionsButtons, True) 117 self.SetPrefs(pyauto.kShowPageOptionsButtons, True)
118 self.RestartBrowser(clear_profile=False) 118 self.RestartBrowser(clear_profile=False)
119 self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kShowHomeButton)) 119 self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kShowHomeButton))
120 if self.IsMac(): 120 if self.IsMac():
121 self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kShowPageOptionsButtons)) 121 self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kShowPageOptionsButtons))
122 122
123 def testDnsPrefectchingEnabledPref(self):
124 """Verify DNS prefetching pref"""
125 # Assert default
126 self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kDnsPrefetchingEnabled))
127 self.SetPrefs(pyauto.kDnsPrefetchingEnabled, False)
128 self.RestartBrowser(clear_profile=False)
129 self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kDnsPrefetchingEnabled))
130
123 def testHomepagePrefs(self): 131 def testHomepagePrefs(self):
124 """Verify homepage prefs.""" 132 """Verify homepage prefs."""
125 # "Use the New Tab page" 133 # "Use the New Tab page"
126 self.SetPrefs(pyauto.kHomePageIsNewTabPage, True) 134 self.SetPrefs(pyauto.kHomePageIsNewTabPage, True)
127 logging.debug('Setting %s to 1' % pyauto.kHomePageIsNewTabPage) 135 logging.debug('Setting %s to 1' % pyauto.kHomePageIsNewTabPage)
128 self.RestartBrowser(clear_profile=False) 136 self.RestartBrowser(clear_profile=False)
129 self.assertEqual(self.GetPrefsInfo().Prefs(pyauto.kHomePageIsNewTabPage), 137 self.assertEqual(self.GetPrefsInfo().Prefs(pyauto.kHomePageIsNewTabPage),
130 True) 138 True)
131 # "Open this page" 139 # "Open this page"
132 url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) 140 url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html'))
133 self.SetPrefs(pyauto.kHomePage, url) 141 self.SetPrefs(pyauto.kHomePage, url)
134 self.SetPrefs(pyauto.kHomePageIsNewTabPage, False) 142 self.SetPrefs(pyauto.kHomePageIsNewTabPage, False)
135 self.RestartBrowser(clear_profile=False) 143 self.RestartBrowser(clear_profile=False)
136 self.assertEqual(self.GetPrefsInfo().Prefs(pyauto.kHomePage), url) 144 self.assertEqual(self.GetPrefsInfo().Prefs(pyauto.kHomePage), url)
137 self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kHomePageIsNewTabPage)) 145 self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kHomePageIsNewTabPage))
138 # TODO(nirnimesh): Actually verify that homepage loads. 146 # TODO(nirnimesh): Actually verify that homepage loads.
139 # This requires telling pyauto *not* to set about:blank as homepage. 147 # This requires telling pyauto *not* to set about:blank as homepage.
140 148
141 149
142 if __name__ == '__main__': 150 if __name__ == '__main__':
143 pyauto_functional.Main() 151 pyauto_functional.Main()
144 152
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