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

Unified Diff: chrome/test/pyautolib/policy_base.py

Issue 8852002: Moved the policy functional tests to their own suite on ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 9 years 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 | « chrome/test/functional/PYAUTO_TESTS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/pyautolib/policy_base.py
diff --git a/chrome/test/pyautolib/policy_base.py b/chrome/test/pyautolib/policy_base.py
index 5e6fdcaa0e6ff04f092d2f9b07a5d91699785fbf..4d8600a309e83ba3e23f04432bfe2c6dcc87800e 100644
--- a/chrome/test/pyautolib/policy_base.py
+++ b/chrome/test/pyautolib/policy_base.py
@@ -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)
« no previous file with comments | « chrome/test/functional/PYAUTO_TESTS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698