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

Unified Diff: enterprise.py

Issue 7633008: Added code for testing popup blocker when policy is configured. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/chrome/test/functional/
Patch Set: Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: enterprise.py
===================================================================
--- enterprise.py (revision 95908)
+++ enterprise.py (working copy)
@@ -325,6 +325,17 @@
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 @@
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()
« 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