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

Side by Side Diff: client/site_tests/desktopui_SunSpiderBench/desktopui_SunSpiderBench.py

Issue 5740004: Move site_chrome_test, site_logging, site_log_reader, site_crash_test into cros dir. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging, os, shutil 5 import logging, os, shutil
6 from autotest_lib.client.bin import utils 6 from autotest_lib.client.bin import utils
7 from autotest_lib.client.common_lib import error 7 from autotest_lib.client.common_lib import error
8 from autotest_lib.client.cros import httpd, ui, ui_test 8 from autotest_lib.client.cros import cros_ui_test, httpd, ui
9 9
10 class desktopui_SunSpiderBench(ui_test.UITest): 10 class desktopui_SunSpiderBench(cros_ui_test.UITest):
11 version = 1 11 version = 1
12 12
13 def initialize(self, creds = '$default'): 13 def initialize(self, creds = '$default'):
14 self._test_url = 'http://localhost:8000/sunspider-driver.html' 14 self._test_url = 'http://localhost:8000/sunspider-driver.html'
15 self._testServer = httpd.HTTPListener(8000, docroot=self.srcdir) 15 self._testServer = httpd.HTTPListener(8000, docroot=self.srcdir)
16 self._testServer.run() 16 self._testServer.run()
17 ui_test.UITest.initialize(self, creds) 17 cros_ui_test.UITest.initialize(self, creds)
18 18
19 19
20 def setup(self, tarball = 'sunspider-0.9.tar.bz2'): 20 def setup(self, tarball = 'sunspider-0.9.tar.bz2'):
21 shutil.rmtree(self.srcdir, ignore_errors=True) 21 shutil.rmtree(self.srcdir, ignore_errors=True)
22 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) 22 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
23 utils.extract_tarball_to_dir(tarball, self.srcdir) 23 utils.extract_tarball_to_dir(tarball, self.srcdir)
24 os.chdir(self.srcdir) 24 os.chdir(self.srcdir)
25 utils.system('patch -p1 < ../sunspider.patch') 25 utils.system('patch -p1 < ../sunspider.patch')
26 26
27 27
28 def cleanup(self): 28 def cleanup(self):
29 self._testServer.stop() 29 self._testServer.stop()
30 ui_test.UITest.cleanup(self) 30 cros_ui_test.UITest.cleanup(self)
31 31
32 32
33 def run_once(self, timeout=180): 33 def run_once(self, timeout=180):
34 latch = self._testServer.add_wait_url('/sunspider/scores') 34 latch = self._testServer.add_wait_url('/sunspider/scores')
35 35
36 session = ui.ChromeSession(self._test_url) 36 session = ui.ChromeSession(self._test_url)
37 logging.debug('Chrome session started.') 37 logging.debug('Chrome session started.')
38 latch.wait(timeout) 38 latch.wait(timeout)
39 session.close() 39 session.close()
40 40
41 if not latch.is_set(): 41 if not latch.is_set():
42 raise error.TestFail('Never received callback from browser.') 42 raise error.TestFail('Never received callback from browser.')
43 43
44 self.write_perf_keyval(self._testServer.get_form_entries()) 44 self.write_perf_keyval(self._testServer.get_form_entries())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698