| 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 | 8 |
| 9 import pyauto_functional # must come before pyauto. | 9 import pyauto_functional # must come before pyauto. |
| 10 import policy_base | 10 import policy_base |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 policy = {'DisableSpdy': True} | 360 policy = {'DisableSpdy': True} |
| 361 self.SetUserPolicy(policy) | 361 self.SetUserPolicy(policy) |
| 362 self.NavigateToURL('chrome://net-internals/#spdy') | 362 self.NavigateToURL('chrome://net-internals/#spdy') |
| 363 self.assertEquals(0, self.FindInPage('SPDY Enabled: true')['match_count']) | 363 self.assertEquals(0, self.FindInPage('SPDY Enabled: true')['match_count']) |
| 364 self.assertEquals( | 364 self.assertEquals( |
| 365 1, | 365 1, |
| 366 self.FindInPage('SPDY Enabled: false', tab_index=0)['match_count'], | 366 self.FindInPage('SPDY Enabled: false', tab_index=0)['match_count'], |
| 367 msg='SPDY is not disabled.') | 367 msg='SPDY is not disabled.') |
| 368 policy = {'DisableSpdy': False} | 368 policy = {'DisableSpdy': False} |
| 369 self.SetUserPolicy(policy) | 369 self.SetUserPolicy(policy) |
| 370 self.GetBrowserWindow(0).GetTab(0).Reload() | 370 self.ReloadTab() |
| 371 self.assertEquals( | 371 self.assertEquals( |
| 372 1, | 372 1, |
| 373 self.FindInPage('SPDY Enabled: true', tab_index=0)['match_count'], | 373 self.FindInPage('SPDY Enabled: true', tab_index=0)['match_count'], |
| 374 msg='SPDY is not disabled.') | 374 msg='SPDY is not disabled.') |
| 375 | 375 |
| 376 def testDisabledPlugins(self): | 376 def testDisabledPlugins(self): |
| 377 """Verify that disabled plugins cannot be enabled.""" | 377 """Verify that disabled plugins cannot be enabled.""" |
| 378 policy = {'DisabledPlugins': ['Shockwave Flash']} | 378 policy = {'DisabledPlugins': ['Shockwave Flash']} |
| 379 self.SetUserPolicy(policy) | 379 self.SetUserPolicy(policy) |
| 380 for plugin in self.GetPluginsInfo().Plugins(): | 380 for plugin in self.GetPluginsInfo().Plugins(): |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 'ClearSiteDataOnExit': True | 691 'ClearSiteDataOnExit': True |
| 692 }) | 692 }) |
| 693 self.RestartBrowser(clear_profile=False) | 693 self.RestartBrowser(clear_profile=False) |
| 694 self.assertFalse( | 694 self.assertFalse( |
| 695 self.GetCookie(pyauto.GURL(cookie_url)), | 695 self.GetCookie(pyauto.GURL(cookie_url)), |
| 696 msg='Cookie present on ' + cookie_url + '.'); | 696 msg='Cookie present on ' + cookie_url + '.'); |
| 697 | 697 |
| 698 | 698 |
| 699 if __name__ == '__main__': | 699 if __name__ == '__main__': |
| 700 pyauto_functional.Main() | 700 pyauto_functional.Main() |
| OLD | NEW |