Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import subprocess | 8 import subprocess |
| 9 import re | 9 import re |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 | 132 |
| 133 # Tests for options in Under the Hood | 133 # Tests for options in Under the Hood |
| 134 def testPrivacyPrefs(self): | 134 def testPrivacyPrefs(self): |
| 135 """Verify that the managed preferences cannot be modified.""" | 135 """Verify that the managed preferences cannot be modified.""" |
| 136 if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome': | 136 if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome': |
| 137 return | 137 return |
| 138 prefs_list = [ | 138 prefs_list = [ |
| 139 # (preference key, default value, new value) | 139 # (preference key, default value, new value) |
| 140 (pyauto.kAlternateErrorPagesEnabled, True, False), | 140 (pyauto.kAlternateErrorPagesEnabled, True, False), |
| 141 (pyauto.kAutofillEnabled, False, True), | 141 (pyauto.kAutofillEnabled, False, True), |
| 142 (pyauto.kDnsPrefetchingEnabled, True, False), | 142 (pyauto.kNetworkPredictionEnabled, True, False), |
|
Nirnimesh
2011/04/05 19:11:02
This test depends on enterprise policy settings. D
cbentzel
2011/04/05 20:30:30
Sorry, I did not change chrome-add.reg.
Is that f
| |
| 143 (pyauto.kSafeBrowsingEnabled, True, False), | 143 (pyauto.kSafeBrowsingEnabled, True, False), |
| 144 (pyauto.kSearchSuggestEnabled, True, False), | 144 (pyauto.kSearchSuggestEnabled, True, False), |
| 145 ] | 145 ] |
| 146 # Check if the policies got applied by trying to modify | 146 # Check if the policies got applied by trying to modify |
| 147 for key, defaultval, newval in prefs_list: | 147 for key, defaultval, newval in prefs_list: |
| 148 logging.info('Checking pref %s', key) | 148 logging.info('Checking pref %s', key) |
| 149 self._CheckIfPrefCanBeModified(key, defaultval, newval) | 149 self._CheckIfPrefCanBeModified(key, defaultval, newval) |
| 150 | 150 |
| 151 def testClearSiteDataOnExit(self): | 151 def testClearSiteDataOnExit(self): |
| 152 """Verify that clear data on exit preference cannot be modified.""" | 152 """Verify that clear data on exit preference cannot be modified.""" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome': | 224 if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome': |
| 225 return | 225 return |
| 226 url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'empty.html')) | 226 url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'empty.html')) |
| 227 self.NavigateToURL(url) | 227 self.NavigateToURL(url) |
| 228 self.assertFalse(self.GetHistoryInfo().History(), | 228 self.assertFalse(self.GetHistoryInfo().History(), |
| 229 msg='History is being saved.') | 229 msg='History is being saved.') |
| 230 | 230 |
| 231 | 231 |
| 232 if __name__ == '__main__': | 232 if __name__ == '__main__': |
| 233 pyauto_functional.Main() | 233 pyauto_functional.Main() |
| OLD | NEW |