Moved the policy functional tests to their own suite on ChromeOS.

Also added a little hack to make session_manager restart chrome.

BUG=chromium-os:23763
TEST=All pyautos/autotests still work

Review URL: http://codereview.chromium.org/8852002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113573 0039d316-1c4b-4281-b951-d872f2087c98
parent 06ca64cf
......@@ -281,6 +281,10 @@
'-imports',
# Multi-profile doesn't apply to chromeos yet.
'-multiprofile',
# These require a custom setup on ChromeOS and have their own suite for
# this platform.
'-policy',
'-policy_prefs_ui',
# ==================================================
# Disabled tests that need to be investigated/fixed.
......@@ -575,6 +579,15 @@
],
},
# ChromeOS policy tests. These are shared with Desktop Chrome tests, but
# require custom setup on ChromeOS.
'CHROMEOS_POLICY': {
'chromeos': [
'policy',
'policy_prefs_ui',
],
},
# ChromeOS volume tests.
'CHROMEOS_VOLUME': {
'chromeos': [
......
......@@ -208,9 +208,29 @@ class PolicyTestBase(pyauto.PyUITest):
cros_ui.stop()
logging.debug('Writing device policy cache')
self._WriteDevicePolicy(policy)
# Ugly hack: session manager won't spawn chrome if this file exists. That's
# usually a good thing (to keep the automation channel open), but in this
# case we really want to restart chrome. PyUITest.setUp() will be called
# after session manager and chrome have restarted, and will setup the
# automation channel.
restore_magic_file = False
if os.path.exists(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE):
logging.debug('DISABLE_BROWSER_RESTART_MAGIC_FILE found. '
'Removing temporarily for the next restart.')
restore_magic_file = True
os.path.remove(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE)
assert not os.path.exists(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE)
logging.debug('Starting session manager again')
cros_ui.start()
# cros_ui.start() waits for the login prompt to be visible, so chrome has
# already started once it returns.
if restore_magic_file:
open(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE, 'w').close()
assert os.path.exists(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE)
def ExtraChromeFlags(self):
"""Sets up Chrome to use cloud policies on ChromeOS."""
flags = pyauto.PyUITest.ExtraChromeFlags(self)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment