diff options
author | aocampo@chromium.org <aocampo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-16 02:33:38 +0000 |
---|---|---|
committer | aocampo@chromium.org <aocampo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-16 02:33:38 +0000 |
commit | bdb3eaaa2a6a6de13c2abbd7f8366f2fb8764194 (patch) | |
tree | 25fd84dc7285ea098112bfd554346fe7b1bea787 /chrome/test | |
parent | 36e87aaac35cab8cdb7fbb507d8d6db7381d5479 (diff) | |
download | chromium_src-bdb3eaaa2a6a6de13c2abbd7f8366f2fb8764194.zip chromium_src-bdb3eaaa2a6a6de13c2abbd7f8366f2fb8764194.tar.gz chromium_src-bdb3eaaa2a6a6de13c2abbd7f8366f2fb8764194.tar.bz2 |
Added code for testing popup blocker when policy is configured.
BUG=NONE
Review URL: http://codereview.chromium.org/7633008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96887 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/functional/enterprise.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/test/functional/enterprise.py b/chrome/test/functional/enterprise.py index a0f76b6..1f7b85e 100644 --- a/chrome/test/functional/enterprise.py +++ b/chrome/test/functional/enterprise.py @@ -325,6 +325,17 @@ class EnterpriseTest(pyauto.PyUITest): pid = self._GetPluginPID('Java') self.assertTrue(pid, 'No plugin process for java') + def testDisablePopups(self): + """Verify popups are not allowed if policy disables popups.""" + if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome': + return + url = self.GetFileURLForDataPath('popup_blocker', 'popup-window-open.html') + self.NavigateToURL(url) + self.assertEqual(1, len(self.GetBlockedPopupsInfo()), + msg='Popup not blocked') + self.assertRaises(pyauto.JSONInterfaceError, + lambda: self.SetPrefs(pyauto.kManagedDefaultPopupsSetting, 1)) + class EnterpriseTestReverse(pyauto.PyUITest): """Test for the Enterprise features that uses the opposite values of the policies used by above test class 'EnterpriseTest'. @@ -586,6 +597,17 @@ class EnterpriseTestReverse(pyauto.PyUITest): pid = self._GetPluginPID('Java') self.assertFalse(pid, 'There is a plugin process for java') + def testEnablePopups(self): + """Verify popups are allowed if policy enables popups.""" + if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome': + return + url = self.GetFileURLForDataPath('popup_blocker', 'popup-window-open.html') + self.NavigateToURL(url) + self.assertEqual(2, self.GetBrowserWindowCount(), + msg='Popup could not be launched'); + self.assertRaises(pyauto.JSONInterfaceError, + lambda: self.SetPrefs(pyauto.kManagedDefaultPopupsSetting, 2)) + if __name__ == '__main__': pyauto_functional.Main() |