diff options
author | sunandt@google.com <sunandt@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-01 23:08:45 +0000 |
---|---|---|
committer | sunandt@google.com <sunandt@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-01 23:08:45 +0000 |
commit | 8342c6beca58598458040aab7576cb44c8c3bce1 (patch) | |
tree | 2abf270d2c790364b78ee9c9b745186e4a828b7a /chrome/test | |
parent | 4b99402b089ba598ae26c82d99c3c3d2fe0cd574 (diff) | |
download | chromium_src-8342c6beca58598458040aab7576cb44c8c3bce1.zip chromium_src-8342c6beca58598458040aab7576cb44c8c3bce1.tar.gz chromium_src-8342c6beca58598458040aab7576cb44c8c3bce1.tar.bz2 |
Adding some enterprise pyauto tests.
testApplicationLocale
testDisabledPlugins
testDisabledPluginsException
BUG=55480
TEST=none
Review URL: http://codereview.chromium.org/6735016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80239 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/data/enterprise/chrome-add.reg | bin | 5632 -> 5908 bytes | |||
-rw-r--r-- | chrome/test/functional/enterprise.py | 46 |
2 files changed, 38 insertions, 8 deletions
diff --git a/chrome/test/data/enterprise/chrome-add.reg b/chrome/test/data/enterprise/chrome-add.reg Binary files differindex a7317d1..399c263 100644 --- a/chrome/test/data/enterprise/chrome-add.reg +++ b/chrome/test/data/enterprise/chrome-add.reg diff --git a/chrome/test/functional/enterprise.py b/chrome/test/functional/enterprise.py index 9cc0707..17d9999 100644 --- a/chrome/test/functional/enterprise.py +++ b/chrome/test/functional/enterprise.py @@ -6,7 +6,7 @@ import logging
import os
import subprocess
-
+import re
import pyauto_functional # must be imported before pyauto
import pyauto
@@ -161,6 +161,25 @@ class EnterpriseTest(pyauto.PyUITest): self._CheckIfPrefCanBeModified(pyauto.kBlockThirdPartyCookies, True, False)
# Tests for general options
+ def testApplicationLocale(self):
+ """Verify that Chrome can be launched only in a specific locale."""
+ if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome':
+ return
+ self.assertTrue(re.search('hi',
+ self.GetPrefsInfo().Prefs()['intl']['accept_languages']),
+ msg='Chrome locale is not Hindi.')
+ # TODO(sunandt): Try changing the application locale to another language.
+
+ def testDisableDevTools(self):
+ """Verify that devtools window cannot be launched."""
+ if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome':
+ return
+ # DevTools process can be seen by PyAuto only when it's undocked.
+ self.SetPrefs(pyauto.kDevToolsOpenDocked, False)
+ self.ApplyAccelerator(pyauto.IDC_DEV_TOOLS)
+ self.assertEquals(1, len(self.GetBrowserInfo()['windows']),
+ msg='Devtools window launched.')
+
def testDisableSPDY(self):
"""Verify that SPDY is disabled."""
self.NavigateToURL('chrome://net-internals/#spdy')
@@ -172,15 +191,26 @@ class EnterpriseTest(pyauto.PyUITest): self.assertEquals(0,
self.FindInPage('encrypted.google.com', tab_index=0)['match_count'])
- def testDisableDevTools(self):
- """Verify that we cannot launch dev tools."""
+ def testDisabledPlugins(self):
+ """Verify that disabled plugins cannot be enabled."""
if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome':
return
- # DevTools process can be seen by PyAuto only when it's undocked.
- self.SetPrefs(pyauto.kDevToolsOpenDocked, False)
- self.ApplyAccelerator(pyauto.IDC_DEV_TOOLS)
- self.assertEquals(1, len(self.GetBrowserInfo()['windows']),
- msg='Devtools window launched.')
+ for plugin in self.GetPluginsInfo().Plugins():
+ if re.search('Flash', plugin['name']):
+ self.assertRaises(pyauto.JSONInterfaceError,
+ lambda: self.EnablePlugin(plugin['path']))
+
+ def testDisabledPluginsException(self):
+ """Verify that plugins given exceptions can be managed by users.
+ Chrome PDF Viewer is disabled using DisabledPlugins policy.
+ User can still toggle the plugin setting when an exception is given for a
+ plugin. So we are trying to enable Chrome PDF Viewer.
+ """
+ if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome':
+ return
+ for plugin in self.GetPluginsInfo().Plugins():
+ if re.search('Chrome PDF Viewer', plugin['name']):
+ self.EnablePlugin(plugin['path'])
def testIncognitoEnabled(self):
"""Verify that incognito window can be launched."""
|