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

Side by Side Diff: client/site_tests/graphics_WebGLConformance/graphics_WebGLConformance.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 graphics_WebGLConformance(ui_test.UITest): 10 class graphics_WebGLConformance(cros_ui_test.UITest):
11 version = 1 11 version = 1
12 12
13 13
14 def initialize(self, creds = '$default'): 14 def initialize(self, creds = '$default'):
15 self._test_url = 'http://localhost:8000/webgl-conformance-tests.html' 15 self._test_url = 'http://localhost:8000/webgl-conformance-tests.html'
16 self._testServer = httpd.HTTPListener(8000, docroot=self.srcdir) 16 self._testServer = httpd.HTTPListener(8000, docroot=self.srcdir)
17 self._testServer.run() 17 self._testServer.run()
18 ui_test.UITest.initialize(self, creds) 18 cros_ui_test.UITest.initialize(self, creds)
19 19
20 20
21 def setup(self, tarball='webgl-tests-0.0.1.tar.bz2'): 21 def setup(self, tarball='webgl-tests-0.0.1.tar.bz2'):
22 shutil.rmtree(self.srcdir, ignore_errors=True) 22 shutil.rmtree(self.srcdir, ignore_errors=True)
23 23
24 dst_path = os.path.join(self.bindir, 'WebGL') 24 dst_path = os.path.join(self.bindir, 'WebGL')
25 tarball_path = os.path.join(self.bindir, tarball) 25 tarball_path = os.path.join(self.bindir, tarball)
26 if not os.path.exists(dst_path): 26 if not os.path.exists(dst_path):
27 if not os.path.exists(tarball_path): 27 if not os.path.exists(tarball_path):
28 utils.get_file( 28 utils.get_file(
29 'http://commondatastorage.googleapis.com/chromeos-localmirro r/distfiles/' + tarball, 29 'http://commondatastorage.googleapis.com/chromeos-localmirro r/distfiles/' + tarball,
30 tarball_path) 30 tarball_path)
31 utils.extract_tarball_to_dir(tarball_path, dst_path) 31 utils.extract_tarball_to_dir(tarball_path, dst_path)
32 32
33 shutil.copytree(os.path.join(self.bindir, 'WebGL'), self.srcdir) 33 shutil.copytree(os.path.join(self.bindir, 'WebGL'), self.srcdir)
34 os.chdir(self.srcdir) 34 os.chdir(self.srcdir)
35 utils.system('patch -p1 < ../r11002.patch') 35 utils.system('patch -p1 < ../r11002.patch')
36 36
37 37
38 def cleanup(self): 38 def cleanup(self):
39 self._testServer.stop() 39 self._testServer.stop()
40 ui_test.UITest.cleanup(self) 40 cros_ui_test.UITest.cleanup(self)
41 41
42 42
43 def run_once(self, timeout=300): 43 def run_once(self, timeout=300):
44 latch = self._testServer.add_wait_url('/WebGL/results') 44 latch = self._testServer.add_wait_url('/WebGL/results')
45 session = ui.ChromeSession(' --enable-webgl %s' % self._test_url) 45 session = ui.ChromeSession(' --enable-webgl %s' % self._test_url)
46 logging.debug('Chrome session started.') 46 logging.debug('Chrome session started.')
47 latch.wait(timeout) 47 latch.wait(timeout)
48 session.close() 48 session.close()
49 49
50 if not latch.is_set(): 50 if not latch.is_set():
51 raise error.TestFail('Never received callback from browser.') 51 raise error.TestFail('Never received callback from browser.')
52 results = self._testServer.get_form_entries() 52 results = self._testServer.get_form_entries()
53 total = int(results['total']) 53 total = int(results['total'])
54 passed = int(results['pass']) 54 passed = int(results['pass'])
55 if passed < total: 55 if passed < total:
56 raise error.TestFail('Results: %d out of %d tests failed!' % 56 raise error.TestFail('Results: %d out of %d tests failed!' %
57 (total - passed, total)) 57 (total - passed, total))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698