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

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/port/test.py

Issue 546133003: Reformat webkitpy.layout_tests w/ format-webkitpy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 24 matching lines...) Expand all
35 from webkitpy.layout_tests.port.base import VirtualTestSuite 35 from webkitpy.layout_tests.port.base import VirtualTestSuite
36 from webkitpy.layout_tests.models.test_configuration import TestConfiguration 36 from webkitpy.layout_tests.models.test_configuration import TestConfiguration
37 from webkitpy.layout_tests.models import test_run_results 37 from webkitpy.layout_tests.models import test_run_results
38 from webkitpy.common.system.filesystem_mock import MockFileSystem 38 from webkitpy.common.system.filesystem_mock import MockFileSystem
39 from webkitpy.common.system.crashlogs import CrashLogs 39 from webkitpy.common.system.crashlogs import CrashLogs
40 40
41 41
42 # This sets basic expectations for a test. Each individual expectation 42 # This sets basic expectations for a test. Each individual expectation
43 # can be overridden by a keyword argument in TestList.add(). 43 # can be overridden by a keyword argument in TestList.add().
44 class TestInstance(object): 44 class TestInstance(object):
45
45 def __init__(self, name): 46 def __init__(self, name):
46 self.name = name 47 self.name = name
47 self.base = name[(name.rfind("/") + 1):name.rfind(".")] 48 self.base = name[(name.rfind('/') + 1):name.rfind('.')]
48 self.crash = False 49 self.crash = False
49 self.web_process_crash = False 50 self.web_process_crash = False
50 self.exception = False 51 self.exception = False
51 self.keyboard = False 52 self.keyboard = False
52 self.error = '' 53 self.error = ''
53 self.timeout = False 54 self.timeout = False
54 self.is_reftest = False 55 self.is_reftest = False
55 self.device_failure = False 56 self.device_failure = False
56 self.leak = False 57 self.leak = False
57 58
(...skipping 10 matching lines...) Expand all
68 self.expected_text = self.actual_text 69 self.expected_text = self.actual_text
69 self.expected_image = self.actual_image 70 self.expected_image = self.actual_image
70 71
71 self.actual_audio = None 72 self.actual_audio = None
72 self.expected_audio = None 73 self.expected_audio = None
73 74
74 75
75 # This is an in-memory list of tests, what we want them to produce, and 76 # This is an in-memory list of tests, what we want them to produce, and
76 # what we want to claim are the expected results. 77 # what we want to claim are the expected results.
77 class TestList(object): 78 class TestList(object):
79
78 def __init__(self): 80 def __init__(self):
79 self.tests = {} 81 self.tests = {}
80 82
81 def add(self, name, **kwargs): 83 def add(self, name, **kwargs):
82 test = TestInstance(name) 84 test = TestInstance(name)
83 for key, value in kwargs.items(): 85 for key, value in kwargs.items():
84 test.__dict__[key] = value 86 test.__dict__[key] = value
85 self.tests[name] = test 87 self.tests[name] = test
86 88
87 def add_reftest(self, name, reference_name, same_image, crash=False): 89 def add_reftest(self, name, reference_name, same_image, crash=False):
(...skipping 14 matching lines...) Expand all
102 104
103 # 105 #
104 # These numbers may need to be updated whenever we add or delete tests. This inc ludes virtual tests. 106 # These numbers may need to be updated whenever we add or delete tests. This inc ludes virtual tests.
105 # 107 #
106 TOTAL_TESTS = 113 108 TOTAL_TESTS = 113
107 TOTAL_SKIPS = 29 109 TOTAL_SKIPS = 29
108 110
109 UNEXPECTED_PASSES = 1 111 UNEXPECTED_PASSES = 1
110 UNEXPECTED_FAILURES = 26 112 UNEXPECTED_FAILURES = 26
111 113
114
112 def unit_test_list(): 115 def unit_test_list():
113 tests = TestList() 116 tests = TestList()
114 tests.add('failures/expected/crash.html', crash=True) 117 tests.add('failures/expected/crash.html', crash=True)
115 tests.add('failures/expected/exception.html', exception=True) 118 tests.add('failures/expected/exception.html', exception=True)
116 tests.add('failures/expected/device_failure.html', device_failure=True) 119 tests.add('failures/expected/device_failure.html', device_failure=True)
117 tests.add('failures/expected/timeout.html', timeout=True) 120 tests.add('failures/expected/timeout.html', timeout=True)
118 tests.add('failures/expected/leak.html', leak=True) 121 tests.add('failures/expected/leak.html', leak=True)
119 tests.add('failures/expected/missing_text.html', expected_text=None) 122 tests.add('failures/expected/missing_text.html', expected_text=None)
120 tests.add('failures/expected/needsrebaseline.html', actual_text='needsrebase line text') 123 tests.add('failures/expected/needsrebaseline.html', actual_text='needsrebase line text')
121 tests.add('failures/expected/needsmanualrebaseline.html', actual_text='needs manualrebaseline text') 124 tests.add('failures/expected/needsmanualrebaseline.html', actual_text='needs manualrebaseline text')
(...skipping 11 matching lines...) Expand all
133 tests.add('failures/expected/keyboard.html', keyboard=True) 136 tests.add('failures/expected/keyboard.html', keyboard=True)
134 tests.add('failures/expected/missing_check.html', 137 tests.add('failures/expected/missing_check.html',
135 expected_image='missing_check-png') 138 expected_image='missing_check-png')
136 tests.add('failures/expected/missing_image.html', expected_image=None) 139 tests.add('failures/expected/missing_image.html', expected_image=None)
137 tests.add('failures/expected/missing_audio.html', expected_audio=None, 140 tests.add('failures/expected/missing_audio.html', expected_audio=None,
138 actual_text=None, expected_text=None, 141 actual_text=None, expected_text=None,
139 actual_image=None, expected_image=None, 142 actual_image=None, expected_image=None,
140 actual_checksum=None) 143 actual_checksum=None)
141 tests.add('failures/expected/missing_text.html', expected_text=None) 144 tests.add('failures/expected/missing_text.html', expected_text=None)
142 tests.add('failures/expected/newlines_leading.html', 145 tests.add('failures/expected/newlines_leading.html',
143 expected_text="\nfoo\n", actual_text="foo\n") 146 expected_text='\nfoo\n', actual_text='foo\n')
144 tests.add('failures/expected/newlines_trailing.html', 147 tests.add('failures/expected/newlines_trailing.html',
145 expected_text="foo\n\n", actual_text="foo\n") 148 expected_text='foo\n\n', actual_text='foo\n')
146 tests.add('failures/expected/newlines_with_excess_CR.html', 149 tests.add('failures/expected/newlines_with_excess_CR.html',
147 expected_text="foo\r\r\r\n", actual_text="foo\n") 150 expected_text='foo\r\r\r\n', actual_text='foo\n')
148 tests.add('failures/expected/text.html', actual_text='text_fail-png') 151 tests.add('failures/expected/text.html', actual_text='text_fail-png')
149 tests.add('failures/expected/crash_then_text.html') 152 tests.add('failures/expected/crash_then_text.html')
150 tests.add('failures/expected/skip_text.html', actual_text='text diff') 153 tests.add('failures/expected/skip_text.html', actual_text='text diff')
151 tests.add('failures/flaky/text.html') 154 tests.add('failures/flaky/text.html')
152 tests.add('failures/unexpected/missing_text.html', expected_text=None) 155 tests.add('failures/unexpected/missing_text.html', expected_text=None)
153 tests.add('failures/unexpected/missing_check.html', expected_image='missing- check-png') 156 tests.add('failures/unexpected/missing_check.html', expected_image='missing- check-png')
154 tests.add('failures/unexpected/missing_image.html', expected_image=None) 157 tests.add('failures/unexpected/missing_image.html', expected_image=None)
155 tests.add('failures/unexpected/missing_render_tree_dump.html', actual_text=" ""layer at (0,0) size 800x600 158 tests.add('failures/unexpected/missing_render_tree_dump.html', actual_text=" ""layer at (0,0) size 800x600
156 RenderView at (0,0) size 800x600 159 RenderView at (0,0) size 800x600
157 layer at (0,0) size 800x34 160 layer at (0,0) size 800x34
158 RenderBlock {HTML} at (0,0) size 800x34 161 RenderBlock {HTML} at (0,0) size 800x34
159 RenderBody {BODY} at (8,8) size 784x18 162 RenderBody {BODY} at (8,8) size 784x18
160 RenderText {#text} at (0,0) size 133x18 163 RenderText {#text} at (0,0) size 133x18
161 text run at (0,0) width 133: "This is an image test!" 164 text run at (0,0) width 133: "This is an image test!"
162 """, expected_text=None) 165 """, expected_text=None)
163 tests.add('failures/unexpected/crash.html', crash=True) 166 tests.add('failures/unexpected/crash.html', crash=True)
164 tests.add('failures/unexpected/crash-with-stderr.html', crash=True, 167 tests.add('failures/unexpected/crash-with-stderr.html', crash=True,
165 error="mock-std-error-output") 168 error='mock-std-error-output')
166 tests.add('failures/unexpected/web-process-crash-with-stderr.html', web_proc ess_crash=True, 169 tests.add('failures/unexpected/web-process-crash-with-stderr.html', web_proc ess_crash=True,
167 error="mock-std-error-output") 170 error='mock-std-error-output')
168 tests.add('failures/unexpected/pass.html') 171 tests.add('failures/unexpected/pass.html')
169 tests.add('failures/unexpected/text-checksum.html', 172 tests.add('failures/unexpected/text-checksum.html',
170 actual_text='text-checksum_fail-txt', 173 actual_text='text-checksum_fail-txt',
171 actual_checksum='text-checksum_fail-checksum') 174 actual_checksum='text-checksum_fail-checksum')
172 tests.add('failures/unexpected/text-image-checksum.html', 175 tests.add('failures/unexpected/text-image-checksum.html',
173 actual_text='text-image-checksum_fail-txt', 176 actual_text='text-image-checksum_fail-txt',
174 actual_image='text-image-checksum_fail-pngtEXtchecksum\x00checksum _fail', 177 actual_image='text-image-checksum_fail-pngtEXtchecksum\x00checksum _fail',
175 actual_checksum='text-image-checksum_fail-checksum') 178 actual_checksum='text-image-checksum_fail-checksum')
176 tests.add('failures/unexpected/checksum-with-matching-image.html', 179 tests.add('failures/unexpected/checksum-with-matching-image.html',
177 actual_checksum='text-image-checksum_fail-checksum') 180 actual_checksum='text-image-checksum_fail-checksum')
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 213
211 # This adds a different virtual reference to ensure that that also works. 214 # This adds a different virtual reference to ensure that that also works.
212 tests.add('virtual/passes/reftest-expected.html', actual_checksum='xxx', act ual_image='XXX', is_reftest=True) 215 tests.add('virtual/passes/reftest-expected.html', actual_checksum='xxx', act ual_image='XXX', is_reftest=True)
213 216
214 tests.add_reftest('passes/mismatch.html', 'passes/mismatch-expected-mismatch .html', same_image=False) 217 tests.add_reftest('passes/mismatch.html', 'passes/mismatch-expected-mismatch .html', same_image=False)
215 tests.add_reftest('passes/svgreftest.svg', 'passes/svgreftest-expected.svg', same_image=True) 218 tests.add_reftest('passes/svgreftest.svg', 'passes/svgreftest-expected.svg', same_image=True)
216 tests.add_reftest('passes/xhtreftest.xht', 'passes/xhtreftest-expected.html' , same_image=True) 219 tests.add_reftest('passes/xhtreftest.xht', 'passes/xhtreftest-expected.html' , same_image=True)
217 tests.add_reftest('passes/phpreftest.php', 'passes/phpreftest-expected-misma tch.svg', same_image=False) 220 tests.add_reftest('passes/phpreftest.php', 'passes/phpreftest-expected-misma tch.svg', same_image=False)
218 tests.add_reftest('failures/expected/reftest.html', 'failures/expected/refte st-expected.html', same_image=False) 221 tests.add_reftest('failures/expected/reftest.html', 'failures/expected/refte st-expected.html', same_image=False)
219 tests.add_reftest('failures/expected/mismatch.html', 'failures/expected/mism atch-expected-mismatch.html', same_image=True) 222 tests.add_reftest('failures/expected/mismatch.html', 'failures/expected/mism atch-expected-mismatch.html', same_image=True)
220 tests.add_reftest('failures/unexpected/crash-reftest.html', 'failures/unexpe cted/crash-reftest-expected.html', same_image=True, crash=True) 223 tests.add_reftest(
224 'failures/unexpected/crash-reftest.html',
225 'failures/unexpected/crash-reftest-expected.html',
226 same_image=True,
227 crash=True)
221 tests.add_reftest('failures/unexpected/reftest.html', 'failures/unexpected/r eftest-expected.html', same_image=False) 228 tests.add_reftest('failures/unexpected/reftest.html', 'failures/unexpected/r eftest-expected.html', same_image=False)
222 tests.add_reftest('failures/unexpected/mismatch.html', 'failures/unexpected/ mismatch-expected-mismatch.html', same_image=True) 229 tests.add_reftest('failures/unexpected/mismatch.html', 'failures/unexpected/ mismatch-expected-mismatch.html', same_image=True)
223 tests.add('failures/unexpected/reftest-nopixel.html', actual_checksum=None, actual_image=None, is_reftest=True) 230 tests.add('failures/unexpected/reftest-nopixel.html', actual_checksum=None, actual_image=None, is_reftest=True)
224 tests.add('failures/unexpected/reftest-nopixel-expected.html', actual_checks um=None, actual_image=None, is_reftest=True) 231 tests.add('failures/unexpected/reftest-nopixel-expected.html', actual_checks um=None, actual_image=None, is_reftest=True)
225 tests.add('reftests/foo/test.html') 232 tests.add('reftests/foo/test.html')
226 tests.add('reftests/foo/test-ref.html') 233 tests.add('reftests/foo/test-ref.html')
227 234
228 tests.add('reftests/foo/multiple-match-success.html', actual_checksum='abc', actual_image='abc') 235 tests.add('reftests/foo/multiple-match-success.html', actual_checksum='abc', actual_image='abc')
229 tests.add('reftests/foo/multiple-match-failure.html', actual_checksum='abc', actual_image='abc') 236 tests.add('reftests/foo/multiple-match-failure.html', actual_checksum='abc', actual_image='abc')
230 tests.add('reftests/foo/multiple-mismatch-success.html', actual_checksum='ab c', actual_image='abc') 237 tests.add('reftests/foo/multiple-mismatch-success.html', actual_checksum='ab c', actual_image='abc')
(...skipping 15 matching lines...) Expand all
246 # For testing that we don't run tests under platform/. Note that these don't contribute to TOTAL_TESTS. 253 # For testing that we don't run tests under platform/. Note that these don't contribute to TOTAL_TESTS.
247 tests.add('platform/test-mac-leopard/http/test.html') 254 tests.add('platform/test-mac-leopard/http/test.html')
248 tests.add('platform/test-win-win7/http/test.html') 255 tests.add('platform/test-win-win7/http/test.html')
249 256
250 # For testing if perf tests are running in a locked shard. 257 # For testing if perf tests are running in a locked shard.
251 tests.add('perf/foo/test.html') 258 tests.add('perf/foo/test.html')
252 tests.add('perf/foo/test-ref.html') 259 tests.add('perf/foo/test-ref.html')
253 260
254 # For testing --pixel-test-directories. 261 # For testing --pixel-test-directories.
255 tests.add('failures/unexpected/pixeldir/image_in_pixeldir.html', 262 tests.add('failures/unexpected/pixeldir/image_in_pixeldir.html',
256 actual_image='image_in_pixeldir-pngtEXtchecksum\x00checksum_fail', 263 actual_image='image_in_pixeldir-pngtEXtchecksum\x00checksum_fail',
257 expected_image='image_in_pixeldir-pngtEXtchecksum\x00checksum-png') 264 expected_image='image_in_pixeldir-pngtEXtchecksum\x00checksum-png' )
258 tests.add('failures/unexpected/image_not_in_pixeldir.html', 265 tests.add('failures/unexpected/image_not_in_pixeldir.html',
259 actual_image='image_not_in_pixeldir-pngtEXtchecksum\x00checksum_fail', 266 actual_image='image_not_in_pixeldir-pngtEXtchecksum\x00checksum_fa il',
260 expected_image='image_not_in_pixeldir-pngtEXtchecksum\x00checksum-png') 267 expected_image='image_not_in_pixeldir-pngtEXtchecksum\x00checksum- png')
261 268
262 # For testing that virtual test suites don't expand names containing themsel ves 269 # For testing that virtual test suites don't expand names containing themsel ves
263 # See webkit.org/b/97925 and base_unittest.PortTest.test_tests(). 270 # See webkit.org/b/97925 and base_unittest.PortTest.test_tests().
264 tests.add('passes/test-virtual-passes.html') 271 tests.add('passes/test-virtual-passes.html')
265 tests.add('passes/passes/test-virtual-passes.html') 272 tests.add('passes/passes/test-virtual-passes.html')
266 273
267 return tests 274 return tests
268 275
269 276
270 # Here we use a non-standard location for the layout tests, to ensure that 277 # Here we use a non-standard location for the layout tests, to ensure that
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 default_port_name = 'test-mac-leopard' 370 default_port_name = 'test-mac-leopard'
364 371
365 """Test implementation of the Port interface.""" 372 """Test implementation of the Port interface."""
366 ALL_BASELINE_VARIANTS = ( 373 ALL_BASELINE_VARIANTS = (
367 'test-linux-x86_64', 374 'test-linux-x86_64',
368 'test-mac-snowleopard', 'test-mac-leopard', 375 'test-mac-snowleopard', 'test-mac-leopard',
369 'test-win-win7', 'test-win-xp', 376 'test-win-win7', 'test-win-xp',
370 ) 377 )
371 378
372 FALLBACK_PATHS = { 379 FALLBACK_PATHS = {
373 'xp': ['test-win-win7', 'test-win-xp'], 380 'xp': ['test-win-win7', 'test-win-xp'],
374 'win7': ['test-win-win7'], 381 'win7': ['test-win-win7'],
375 'leopard': ['test-mac-leopard', 'test-mac-snowleopard'], 382 'leopard': ['test-mac-leopard', 'test-mac-snowleopard'],
376 'snowleopard': ['test-mac-snowleopard'], 383 'snowleopard': ['test-mac-snowleopard'],
377 'lucid': ['test-linux-x86_64', 'test-win-win7'], 384 'lucid': ['test-linux-x86_64', 'test-win-win7'],
378 } 385 }
379 386
380 @classmethod 387 @classmethod
381 def determine_full_port_name(cls, host, options, port_name): 388 def determine_full_port_name(cls, host, options, port_name):
382 if port_name == 'test': 389 if port_name == 'test':
383 return TestPort.default_port_name 390 return TestPort.default_port_name
384 return port_name 391 return port_name
385 392
386 def __init__(self, host, port_name=None, **kwargs): 393 def __init__(self, host, port_name=None, **kwargs):
387 Port.__init__(self, host, port_name or TestPort.default_port_name, **kwa rgs) 394 Port.__init__(self, host, port_name or TestPort.default_port_name, **kwa rgs)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 def default_configuration(self): 450 def default_configuration(self):
444 return 'Release' 451 return 'Release'
445 452
446 def diff_image(self, expected_contents, actual_contents): 453 def diff_image(self, expected_contents, actual_contents):
447 diffed = actual_contents != expected_contents 454 diffed = actual_contents != expected_contents
448 if not actual_contents and not expected_contents: 455 if not actual_contents and not expected_contents:
449 return (None, None) 456 return (None, None)
450 if not actual_contents or not expected_contents: 457 if not actual_contents or not expected_contents:
451 return (True, None) 458 return (True, None)
452 if diffed: 459 if diffed:
453 return ("< %s\n---\n> %s\n" % (expected_contents, actual_contents), None) 460 return ('< %s\n---\n> %s\n' % (expected_contents, actual_contents), None)
454 return (None, None) 461 return (None, None)
455 462
456 def layout_tests_dir(self): 463 def layout_tests_dir(self):
457 return LAYOUT_TEST_DIR 464 return LAYOUT_TEST_DIR
458 465
459 def perf_tests_dir(self): 466 def perf_tests_dir(self):
460 return PERF_TEST_DIR 467 return PERF_TEST_DIR
461 468
462 def webkit_base(self): 469 def webkit_base(self):
463 return '/test.checkout' 470 return '/test.checkout'
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 def stop_http_server(self): 504 def stop_http_server(self):
498 pass 505 pass
499 506
500 def stop_websocket_server(self): 507 def stop_websocket_server(self):
501 pass 508 pass
502 509
503 def release_http_lock(self): 510 def release_http_lock(self):
504 pass 511 pass
505 512
506 def path_to_apache(self): 513 def path_to_apache(self):
507 return "/usr/sbin/httpd" 514 return '/usr/sbin/httpd'
508 515
509 def path_to_apache_config_file(self): 516 def path_to_apache_config_file(self):
510 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'h ttpd.conf') 517 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'h ttpd.conf')
511 518
512 def path_to_generic_test_expectations_file(self): 519 def path_to_generic_test_expectations_file(self):
513 return self._generic_expectations_path 520 return self._generic_expectations_path
514 521
515 def _port_specific_expectations_files(self): 522 def _port_specific_expectations_files(self):
516 return [self._filesystem.join(self._webkit_baseline_path(d), 'TestExpect ations') for d in ['test', 'test-win-xp']] 523 return [self._filesystem.join(self._webkit_baseline_path(d), 'TestExpect ations') for d in ['test', 'test-win-xp']]
517 524
(...skipping 29 matching lines...) Expand all
547 return self.ALL_BASELINE_VARIANTS 554 return self.ALL_BASELINE_VARIANTS
548 555
549 def virtual_test_suites(self): 556 def virtual_test_suites(self):
550 return [ 557 return [
551 VirtualTestSuite('passes', 'passes', ['--virtual-arg'], use_legacy_n aming=True), 558 VirtualTestSuite('passes', 'passes', ['--virtual-arg'], use_legacy_n aming=True),
552 VirtualTestSuite('skipped', 'failures/expected', ['--virtual-arg2'], use_legacy_naming=True), 559 VirtualTestSuite('skipped', 'failures/expected', ['--virtual-arg2'], use_legacy_naming=True),
553 ] 560 ]
554 561
555 562
556 class TestDriver(Driver): 563 class TestDriver(Driver):
564
557 """Test/Dummy implementation of the driver interface.""" 565 """Test/Dummy implementation of the driver interface."""
558 next_pid = 1 566 next_pid = 1
559 567
560 def __init__(self, *args, **kwargs): 568 def __init__(self, *args, **kwargs):
561 super(TestDriver, self).__init__(*args, **kwargs) 569 super(TestDriver, self).__init__(*args, **kwargs)
562 self.started = False 570 self.started = False
563 self.pid = 0 571 self.pid = 0
564 572
565 def cmd_line(self, pixel_tests, per_test_args): 573 def cmd_line(self, pixel_tests, per_test_args):
566 pixel_tests_flag = '-p' if pixel_tests else '' 574 pixel_tests_flag = '-p' if pixel_tests else ''
567 return [self._port._path_to_driver()] + [pixel_tests_flag] + self._port. get_option('additional_drt_flag', []) + per_test_args 575 return [self._port._path_to_driver()] + [pixel_tests_flag] + \
576 self._port.get_option('additional_drt_flag', []) + per_test_args
568 577
569 def run_test(self, driver_input, stop_when_done): 578 def run_test(self, driver_input, stop_when_done):
570 if not self.started: 579 if not self.started:
571 self.started = True 580 self.started = True
572 self.pid = TestDriver.next_pid 581 self.pid = TestDriver.next_pid
573 TestDriver.next_pid += 1 582 TestDriver.next_pid += 1
574 583
575 start_time = time.time() 584 start_time = time.time()
576 test_name = driver_input.test_name 585 test_name = driver_input.test_name
577 test_args = driver_input.args or [] 586 test_args = driver_input.args or []
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 crash_log = crash_logs.find_newest_log(crashed_process_name, None) o r '' 639 crash_log = crash_logs.find_newest_log(crashed_process_name, None) o r ''
631 640
632 if stop_when_done: 641 if stop_when_done:
633 self.stop() 642 self.stop()
634 643
635 if test.actual_checksum == driver_input.image_hash: 644 if test.actual_checksum == driver_input.image_hash:
636 image = None 645 image = None
637 else: 646 else:
638 image = test.actual_image 647 image = test.actual_image
639 return DriverOutput(actual_text, image, test.actual_checksum, audio, 648 return DriverOutput(actual_text, image, test.actual_checksum, audio,
640 crash=(crash or web_process_crash), crashed_process_name=crashed_pro cess_name, 649 crash=(crash or web_process_crash), crashed_process_ name=crashed_process_name,
641 crashed_pid=crashed_pid, crash_log=crash_log, 650 crashed_pid=crashed_pid, crash_log=crash_log,
642 test_time=time.time() - start_time, timeout=test.timeout, error=test .error, pid=self.pid, 651 test_time=time.time() - start_time, timeout=test.tim eout, error=test.error, pid=self.pid,
643 leak=test.leak) 652 leak=test.leak)
644 653
645 def stop(self): 654 def stop(self):
646 self.started = False 655 self.started = False
OLDNEW
« no previous file with comments | « Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py ('k') | Tools/Scripts/webkitpy/layout_tests/port/win.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698