OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 | 9 |
10 import pyauto_functional # Must be imported before pyauto | 10 import pyauto_functional # Must be imported before pyauto |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 'triggerGeoWithCallback(arguments[arguments.length - 1]);') | 172 'triggerGeoWithCallback(arguments[arguments.length - 1]);') |
173 self.assertEqual( | 173 self.assertEqual( |
174 behavior, Behaviors.BLOCK, | 174 behavior, Behaviors.BLOCK, |
175 msg='Behavior is "%s" when it should be BLOCKED.' % behavior) | 175 msg='Behavior is "%s" when it should be BLOCKED.' % behavior) |
176 | 176 |
177 def testUnderTheHoodPref(self): | 177 def testUnderTheHoodPref(self): |
178 """Verify the security preferences for Under the Hood. | 178 """Verify the security preferences for Under the Hood. |
179 The setting is enabled by default.""" | 179 The setting is enabled by default.""" |
180 pref_list = [pyauto.kNetworkPredictionEnabled, pyauto.kSafeBrowsingEnabled, | 180 pref_list = [pyauto.kNetworkPredictionEnabled, pyauto.kSafeBrowsingEnabled, |
181 pyauto.kAlternateErrorPagesEnabled, | 181 pyauto.kAlternateErrorPagesEnabled, |
182 pyauto.kSearchSuggestEnabled, pyauto.kShowOmniboxSearchHint] | 182 pyauto.kSearchSuggestEnabled] |
183 for pref in pref_list: | 183 for pref in pref_list: |
184 # Verify the default value | 184 # Verify the default value |
185 self.assertEqual(self.GetPrefsInfo().Prefs(pref), True) | 185 self.assertEqual(self.GetPrefsInfo().Prefs(pref), True) |
186 self.SetPrefs(pref, False) | 186 self.SetPrefs(pref, False) |
187 self.RestartBrowser(clear_profile=False) | 187 self.RestartBrowser(clear_profile=False) |
188 for pref in pref_list: | 188 for pref in pref_list: |
189 self.assertEqual(self.GetPrefsInfo().Prefs(pref), False) | 189 self.assertEqual(self.GetPrefsInfo().Prefs(pref), False) |
190 | 190 |
191 def testJavaScriptEnableDisable(self): | 191 def testJavaScriptEnableDisable(self): |
192 """Verify enabling disabling javascript prefs work """ | 192 """Verify enabling disabling javascript prefs work """ |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 self.assertTrue( | 341 self.assertTrue( |
342 self._driver.execute_script( | 342 self._driver.execute_script( |
343 'return doesQueryConformsToProtocol("%s", "%s")' | 343 'return doesQueryConformsToProtocol("%s", "%s")' |
344 % (asked_handler_dict['query_key'], | 344 % (asked_handler_dict['query_key'], |
345 asked_handler_dict['query_value'])), | 345 asked_handler_dict['query_value'])), |
346 msg='Protocol did not register correctly.') | 346 msg='Protocol did not register correctly.') |
347 | 347 |
348 | 348 |
349 if __name__ == '__main__': | 349 if __name__ == '__main__': |
350 pyauto_functional.Main() | 350 pyauto_functional.Main() |
OLD | NEW |