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

Unified Diff: chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoFunctionalTests/desktopui_PyAutoFunctionalTests.py

Issue 6410134: Use named automation interface to control primary chrome on ChromeOS (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: nit Created 9 years, 10 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
Index: chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoFunctionalTests/desktopui_PyAutoFunctionalTests.py
diff --git a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoFunctionalTests/desktopui_PyAutoFunctionalTests.py b/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoFunctionalTests/desktopui_PyAutoFunctionalTests.py
index 8c495e0979b4eb24e682d693b7fd8ea49192e155..e7b071c26f760d9a74554be20bb276a590007493 100644
--- a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoFunctionalTests/desktopui_PyAutoFunctionalTests.py
+++ b/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoFunctionalTests/desktopui_PyAutoFunctionalTests.py
@@ -3,15 +3,47 @@
# found in the LICENSE file.
import os
-from autotest_lib.client.cros import chrome_test
+import shutil
+import subprocess
+
+from autotest_lib.client.bin import utils
+from autotest_lib.client.cros import constants, chrome_test, cros_ui
+
class desktopui_PyAutoFunctionalTests(chrome_test.ChromeTestBase):
- """Wrapper for running Chrome's PyAuto-based functional tests."""
+ """Wrapper for running Chrome's PyAuto-based functional tests.
+
+ Performs all setup and fires of PRIMARY_CHROME suite.
+ """
version = 1
def run_once(self):
+ assert os.geteuid() == 0, 'Need superuser privileges'
+
deps_dir = os.path.join(self.autodir, 'deps')
- self.test_binary_dir = ''
- pyauto_script = '%s/chrome_test/test_src/chrome/test/functional/' \
- 'pyauto_functional.py' % deps_dir
- self.run_chrome_test(pyauto_script)
+ cr_src = os.path.join(deps_dir, 'chrome_test', 'test_src')
+ subprocess.check_call(['chown', '-R', 'chronos', cr_src])
+
+ # Setup /tmp/disable_chrome_restart
+ if not os.path.exists(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE):
+ open(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE, 'w').close()
+
+ # Setup suid python binary which can enable chrome testing interface
+ suid_python = os.path.join(cr_src, 'out', 'Release', 'python')
+ shutil.copy('/usr/local/bin/python2.6', suid_python)
Chris Masone 2011/02/22 15:58:41 Shouldn't this copy of python be deleted after the
Nirnimesh 2011/02/22 22:17:18 I thought about that but decided that it'd be conv
+ os.chown(suid_python, 0, 0)
+ os.chmod(suid_python, 04755)
+
+ # Enable chrome testing interface and Login
+ pyautolib_dir = os.path.join(cr_src, 'chrome', 'test', 'pyautolib')
+ login_cmd = cros_ui.xcommand_as(
+ 'python %s chromeos_utils.ChromeosUtils.LoginToDefaultAccount '
+ '-v --no-http-server' %
+ os.path.join(pyautolib_dir, 'chromeos', 'chromeos_utils.py'))
+ utils.system(login_cmd)
Chris Masone 2011/02/22 15:58:41 seems like pretty much all the above should be in
Nirnimesh 2011/02/22 22:17:18 Done.
+
+ functional_cmd = cros_ui.xcommand_as(
+ '%s/chrome_test/test_src/chrome/test/functional/' \
+ 'pyauto_functional.py --suite=PRIMARY_CHROME ' \
+ '-v --no-http-server' % deps_dir)
+ utils.system(functional_cmd)
« no previous file with comments | « no previous file | chrome/test/functional/PYAUTO_TESTS » ('j') | chrome/test/pyautolib/chromeos/enable_testing.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698