OLD | NEW |
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 30 matching lines...) Expand all Loading... |
41 from webkitpy.common.system.outputcapture import OutputCapture | 41 from webkitpy.common.system.outputcapture import OutputCapture |
42 from webkitpy.common.system.systemhost_mock import MockSystemHost | 42 from webkitpy.common.system.systemhost_mock import MockSystemHost |
43 from webkitpy.layout_tests.models import test_run_results | 43 from webkitpy.layout_tests.models import test_run_results |
44 from webkitpy.layout_tests.port.base import Port, TestConfiguration | 44 from webkitpy.layout_tests.port.base import Port, TestConfiguration |
45 from webkitpy.layout_tests.port.server_process_mock import MockServerProcess | 45 from webkitpy.layout_tests.port.server_process_mock import MockServerProcess |
46 from webkitpy.tool.mocktool import MockOptions | 46 from webkitpy.tool.mocktool import MockOptions |
47 | 47 |
48 | 48 |
49 # FIXME: get rid of this fixture | 49 # FIXME: get rid of this fixture |
50 class TestWebKitPort(Port): | 50 class TestWebKitPort(Port): |
51 port_name = "testwebkitport" | 51 port_name = 'testwebkitport' |
52 | 52 |
53 def __init__(self, port_name=None, symbols_string=None, | 53 def __init__(self, port_name=None, symbols_string=None, |
54 expectations_file=None, skips_file=None, host=None, config=None
, | 54 expectations_file=None, skips_file=None, host=None, config=None
, |
55 **kwargs): | 55 **kwargs): |
56 port_name = port_name or TestWebKitPort.port_name | 56 port_name = port_name or TestWebKitPort.port_name |
57 self.symbols_string = symbols_string # Passing "" disables all staticly
-detectable features. | 57 self.symbols_string = symbols_string # Passing "" disables all staticly
-detectable features. |
58 host = host or MockSystemHost() | 58 host = host or MockSystemHost() |
59 super(TestWebKitPort, self).__init__(host, port_name=port_name, **kwargs
) | 59 super(TestWebKitPort, self).__init__(host, port_name=port_name, **kwargs
) |
60 | 60 |
61 def all_test_configurations(self): | 61 def all_test_configurations(self): |
62 return [self.test_configuration()] | 62 return [self.test_configuration()] |
63 | 63 |
64 def _symbols_string(self): | 64 def _symbols_string(self): |
65 return self.symbols_string | 65 return self.symbols_string |
66 | 66 |
67 def _tests_for_disabled_features(self): | 67 def _tests_for_disabled_features(self): |
68 return ["accessibility", ] | 68 return ['accessibility', ] |
69 | 69 |
70 | 70 |
71 class FakePrinter(object): | 71 class FakePrinter(object): |
| 72 |
72 def write_update(self, msg): | 73 def write_update(self, msg): |
73 pass | 74 pass |
74 | 75 |
75 def write_throttled_update(self, msg): | 76 def write_throttled_update(self, msg): |
76 pass | 77 pass |
77 | 78 |
78 | 79 |
| 80 class PortTestCase(unittest.TestCase): |
79 | 81 |
80 class PortTestCase(unittest.TestCase): | |
81 """Tests that all Port implementations must pass.""" | 82 """Tests that all Port implementations must pass.""" |
82 HTTP_PORTS = (8000, 8080, 8443) | 83 HTTP_PORTS = (8000, 8080, 8443) |
83 WEBSOCKET_PORTS = (8880,) | 84 WEBSOCKET_PORTS = (8880,) |
84 | 85 |
85 # Subclasses override this to point to their Port subclass. | 86 # Subclasses override this to point to their Port subclass. |
86 os_name = None | 87 os_name = None |
87 os_version = None | 88 os_version = None |
88 port_maker = TestWebKitPort | 89 port_maker = TestWebKitPort |
89 port_name = None | 90 port_name = None |
90 | 91 |
(...skipping 25 matching lines...) Expand all Loading... |
116 finally: | 117 finally: |
117 out, err, logs = oc.restore_output() | 118 out, err, logs = oc.restore_output() |
118 self.assertIn('pretty patches', logs) # We should get a warn
ing about PrettyPatch being missing, | 119 self.assertIn('pretty patches', logs) # We should get a warn
ing about PrettyPatch being missing, |
119 self.assertNotIn('build requirements', logs) # but not the driver i
tself. | 120 self.assertNotIn('build requirements', logs) # but not the driver i
tself. |
120 | 121 |
121 port._check_file_exists = lambda path, desc: False | 122 port._check_file_exists = lambda path, desc: False |
122 port._check_driver_build_up_to_date = lambda config: False | 123 port._check_driver_build_up_to_date = lambda config: False |
123 try: | 124 try: |
124 oc.capture_output() | 125 oc.capture_output() |
125 self.assertEqual(port.check_build(needs_http=True, printer=FakePrint
er()), | 126 self.assertEqual(port.check_build(needs_http=True, printer=FakePrint
er()), |
126 test_run_results.UNEXPECTED_ERROR_EXIT_STATUS) | 127 test_run_results.UNEXPECTED_ERROR_EXIT_STATUS) |
127 finally: | 128 finally: |
128 out, err, logs = oc.restore_output() | 129 out, err, logs = oc.restore_output() |
129 self.assertIn('pretty patches', logs) # And, hereere we shoul
d get warnings about both. | 130 self.assertIn('pretty patches', logs) # And, hereere we shoul
d get warnings about both. |
130 self.assertIn('build requirements', logs) | 131 self.assertIn('build requirements', logs) |
131 | 132 |
132 def test_default_max_locked_shards(self): | 133 def test_default_max_locked_shards(self): |
133 port = self.make_port() | 134 port = self.make_port() |
134 port.default_child_processes = lambda: 16 | 135 port.default_child_processes = lambda: 16 |
135 self.assertEqual(port.default_max_locked_shards(), 4) | 136 self.assertEqual(port.default_max_locked_shards(), 4) |
136 port.default_child_processes = lambda: 2 | 137 port.default_child_processes = lambda: 2 |
(...skipping 15 matching lines...) Expand all Loading... |
152 cmd_line = port.driver_cmd_line() | 153 cmd_line = port.driver_cmd_line() |
153 self.assertTrue('--foo=bar' in cmd_line) | 154 self.assertTrue('--foo=bar' in cmd_line) |
154 self.assertTrue('--foo=baz' in cmd_line) | 155 self.assertTrue('--foo=baz' in cmd_line) |
155 | 156 |
156 def assert_servers_are_down(self, host, ports): | 157 def assert_servers_are_down(self, host, ports): |
157 for port in ports: | 158 for port in ports: |
158 try: | 159 try: |
159 test_socket = socket.socket() | 160 test_socket = socket.socket() |
160 test_socket.connect((host, port)) | 161 test_socket.connect((host, port)) |
161 self.fail() | 162 self.fail() |
162 except IOError, e: | 163 except IOError as e: |
163 self.assertTrue(e.errno in (errno.ECONNREFUSED, errno.ECONNRESET
)) | 164 self.assertTrue(e.errno in (errno.ECONNREFUSED, errno.ECONNRESET
)) |
164 finally: | 165 finally: |
165 test_socket.close() | 166 test_socket.close() |
166 | 167 |
167 def assert_servers_are_up(self, host, ports): | 168 def assert_servers_are_up(self, host, ports): |
168 for port in ports: | 169 for port in ports: |
169 try: | 170 try: |
170 test_socket = socket.socket() | 171 test_socket = socket.socket() |
171 test_socket.connect((host, port)) | 172 test_socket.connect((host, port)) |
172 except IOError, e: | 173 except IOError as e: |
173 self.fail('failed to connect to %s:%d' % (host, port)) | 174 self.fail('failed to connect to %s:%d' % (host, port)) |
174 finally: | 175 finally: |
175 test_socket.close() | 176 test_socket.close() |
176 | 177 |
177 def test_diff_image__missing_both(self): | 178 def test_diff_image__missing_both(self): |
178 port = self.make_port() | 179 port = self.make_port() |
179 self.assertEqual(port.diff_image(None, None), (None, None)) | 180 self.assertEqual(port.diff_image(None, None), (None, None)) |
180 self.assertEqual(port.diff_image(None, ''), (None, None)) | 181 self.assertEqual(port.diff_image(None, ''), (None, None)) |
181 self.assertEqual(port.diff_image('', None), (None, None)) | 182 self.assertEqual(port.diff_image('', None), (None, None)) |
182 | 183 |
183 self.assertEqual(port.diff_image('', ''), (None, None)) | 184 self.assertEqual(port.diff_image('', ''), (None, None)) |
184 | 185 |
185 def test_diff_image__missing_actual(self): | 186 def test_diff_image__missing_actual(self): |
186 port = self.make_port() | 187 port = self.make_port() |
187 self.assertEqual(port.diff_image(None, 'foo'), ('foo', None)) | 188 self.assertEqual(port.diff_image(None, 'foo'), ('foo', None)) |
188 self.assertEqual(port.diff_image('', 'foo'), ('foo', None)) | 189 self.assertEqual(port.diff_image('', 'foo'), ('foo', None)) |
189 | 190 |
190 def test_diff_image__missing_expected(self): | 191 def test_diff_image__missing_expected(self): |
191 port = self.make_port() | 192 port = self.make_port() |
192 self.assertEqual(port.diff_image('foo', None), ('foo', None)) | 193 self.assertEqual(port.diff_image('foo', None), ('foo', None)) |
193 self.assertEqual(port.diff_image('foo', ''), ('foo', None)) | 194 self.assertEqual(port.diff_image('foo', ''), ('foo', None)) |
194 | 195 |
195 def test_diff_image(self): | 196 def test_diff_image(self): |
196 def _path_to_image_diff(): | 197 def _path_to_image_diff(): |
197 return "/path/to/image_diff" | 198 return '/path/to/image_diff' |
198 | 199 |
199 port = self.make_port() | 200 port = self.make_port() |
200 port._path_to_image_diff = _path_to_image_diff | 201 port._path_to_image_diff = _path_to_image_diff |
201 | 202 |
202 mock_image_diff = "MOCK Image Diff" | 203 mock_image_diff = 'MOCK Image Diff' |
203 | 204 |
204 def mock_run_command(args): | 205 def mock_run_command(args): |
205 port._filesystem.write_binary_file(args[4], mock_image_diff) | 206 port._filesystem.write_binary_file(args[4], mock_image_diff) |
206 return 1 | 207 return 1 |
207 | 208 |
208 # Images are different. | 209 # Images are different. |
209 port._executive = MockExecutive2(run_command_fn=mock_run_command) | 210 port._executive = MockExecutive2(run_command_fn=mock_run_command) |
210 self.assertEqual(mock_image_diff, port.diff_image("EXPECTED", "ACTUAL")[
0]) | 211 self.assertEqual(mock_image_diff, port.diff_image('EXPECTED', 'ACTUAL')[
0]) |
211 | 212 |
212 # Images are the same. | 213 # Images are the same. |
213 port._executive = MockExecutive2(exit_code=0) | 214 port._executive = MockExecutive2(exit_code=0) |
214 self.assertEqual(None, port.diff_image("EXPECTED", "ACTUAL")[0]) | 215 self.assertEqual(None, port.diff_image('EXPECTED', 'ACTUAL')[0]) |
215 | 216 |
216 # There was some error running image_diff. | 217 # There was some error running image_diff. |
217 port._executive = MockExecutive2(exit_code=2) | 218 port._executive = MockExecutive2(exit_code=2) |
218 exception_raised = False | 219 exception_raised = False |
219 try: | 220 try: |
220 port.diff_image("EXPECTED", "ACTUAL") | 221 port.diff_image('EXPECTED', 'ACTUAL') |
221 except ValueError, e: | 222 except ValueError as e: |
222 exception_raised = True | 223 exception_raised = True |
223 self.assertFalse(exception_raised) | 224 self.assertFalse(exception_raised) |
224 | 225 |
225 def test_diff_image_crashed(self): | 226 def test_diff_image_crashed(self): |
226 port = self.make_port() | 227 port = self.make_port() |
227 port._executive = MockExecutive2(exit_code=2) | 228 port._executive = MockExecutive2(exit_code=2) |
228 self.assertEqual(port.diff_image("EXPECTED", "ACTUAL"), (None, 'Image di
ff returned an exit code of 2. See http://crbug.com/278596')) | 229 self.assertEqual( |
| 230 port.diff_image( |
| 231 'EXPECTED', |
| 232 'ACTUAL'), |
| 233 (None, |
| 234 'Image diff returned an exit code of 2. See http://crbug.com/278596
')) |
229 | 235 |
230 def test_check_wdiff(self): | 236 def test_check_wdiff(self): |
231 port = self.make_port() | 237 port = self.make_port() |
232 port.check_wdiff() | 238 port.check_wdiff() |
233 | 239 |
234 def test_wdiff_text_fails(self): | 240 def test_wdiff_text_fails(self): |
235 host = MockSystemHost(os_name=self.os_name, os_version=self.os_version) | 241 host = MockSystemHost(os_name=self.os_name, os_version=self.os_version) |
236 host.executive = MockExecutive(should_throw=True) | 242 host.executive = MockExecutive(should_throw=True) |
237 port = self.make_port(host=host) | 243 port = self.make_port(host=host) |
238 port._executive = host.executive # AndroidPortTest.make_port sets its o
wn executive, so reset that as well. | 244 port._executive = host.executive # AndroidPortTest.make_port sets its o
wn executive, so reset that as well. |
239 | 245 |
240 # This should raise a ScriptError that gets caught and turned into the | 246 # This should raise a ScriptError that gets caught and turned into the |
241 # error text, and also mark wdiff as not available. | 247 # error text, and also mark wdiff as not available. |
242 self.make_wdiff_available(port) | 248 self.make_wdiff_available(port) |
243 self.assertTrue(port.wdiff_available()) | 249 self.assertTrue(port.wdiff_available()) |
244 diff_txt = port.wdiff_text("/tmp/foo.html", "/tmp/bar.html") | 250 diff_txt = port.wdiff_text('/tmp/foo.html', '/tmp/bar.html') |
245 self.assertEqual(diff_txt, port._wdiff_error_html) | 251 self.assertEqual(diff_txt, port._wdiff_error_html) |
246 self.assertFalse(port.wdiff_available()) | 252 self.assertFalse(port.wdiff_available()) |
247 | 253 |
248 def test_missing_symbol_to_skipped_tests(self): | 254 def test_missing_symbol_to_skipped_tests(self): |
249 # Test that we get the chromium skips and not the webkit default skips | 255 # Test that we get the chromium skips and not the webkit default skips |
250 port = self.make_port() | 256 port = self.make_port() |
251 skip_dict = port._missing_symbol_to_skipped_tests() | 257 skip_dict = port._missing_symbol_to_skipped_tests() |
252 if port.PORT_HAS_AUDIO_CODECS_BUILT_IN: | 258 if port.PORT_HAS_AUDIO_CODECS_BUILT_IN: |
253 self.assertEqual(skip_dict, {}) | 259 self.assertEqual(skip_dict, {}) |
254 else: | 260 else: |
(...skipping 22 matching lines...) Expand all Loading... |
277 TestConfiguration('xp', 'x86', 'release'), | 283 TestConfiguration('xp', 'x86', 'release'), |
278 TestConfiguration('win7', 'x86', 'debug'), | 284 TestConfiguration('win7', 'x86', 'debug'), |
279 TestConfiguration('win7', 'x86', 'release'), | 285 TestConfiguration('win7', 'x86', 'release'), |
280 TestConfiguration('lucid', 'x86', 'debug'), | 286 TestConfiguration('lucid', 'x86', 'debug'), |
281 TestConfiguration('lucid', 'x86', 'release'), | 287 TestConfiguration('lucid', 'x86', 'release'), |
282 TestConfiguration('lucid', 'x86_64', 'debug'), | 288 TestConfiguration('lucid', 'x86_64', 'debug'), |
283 TestConfiguration('lucid', 'x86_64', 'release'), | 289 TestConfiguration('lucid', 'x86_64', 'release'), |
284 TestConfiguration('icecreamsandwich', 'x86', 'debug'), | 290 TestConfiguration('icecreamsandwich', 'x86', 'debug'), |
285 TestConfiguration('icecreamsandwich', 'x86', 'release'), | 291 TestConfiguration('icecreamsandwich', 'x86', 'release'), |
286 ])) | 292 ])) |
| 293 |
287 def test_get_crash_log(self): | 294 def test_get_crash_log(self): |
288 port = self.make_port() | 295 port = self.make_port() |
289 self.assertEqual(port._get_crash_log(None, None, None, None, newer_than=
None), | 296 self.assertEqual(port._get_crash_log(None, None, None, None, newer_than=
None), |
290 (None, | 297 (None, |
291 'crash log for <unknown process name> (pid <unknown>):\n' | 298 'crash log for <unknown process name> (pid <unknown>):
\n' |
292 'STDOUT: <empty>\n' | 299 'STDOUT: <empty>\n' |
293 'STDERR: <empty>\n')) | 300 'STDERR: <empty>\n')) |
294 | 301 |
295 self.assertEqual(port._get_crash_log('foo', 1234, 'out bar\nout baz', 'e
rr bar\nerr baz\n', newer_than=None), | 302 self.assertEqual(port._get_crash_log('foo', 1234, 'out bar\nout baz', 'e
rr bar\nerr baz\n', newer_than=None), |
296 ('err bar\nerr baz\n', | 303 ('err bar\nerr baz\n', |
297 'crash log for foo (pid 1234):\n' | 304 'crash log for foo (pid 1234):\n' |
298 'STDOUT: out bar\n' | 305 'STDOUT: out bar\n' |
299 'STDOUT: out baz\n' | 306 'STDOUT: out baz\n' |
300 'STDERR: err bar\n' | 307 'STDERR: err bar\n' |
301 'STDERR: err baz\n')) | 308 'STDERR: err baz\n')) |
302 | 309 |
303 self.assertEqual(port._get_crash_log('foo', 1234, 'foo\xa6bar', 'foo\xa6
bar', newer_than=None), | 310 self.assertEqual(port._get_crash_log('foo', 1234, 'foo\xa6bar', 'foo\xa6
bar', newer_than=None), |
304 ('foo\xa6bar', | 311 ('foo\xa6bar', |
305 u'crash log for foo (pid 1234):\n' | 312 u'crash log for foo (pid 1234):\n' |
306 u'STDOUT: foo\ufffdbar\n' | 313 u'STDOUT: foo\ufffdbar\n' |
307 u'STDERR: foo\ufffdbar\n')) | 314 u'STDERR: foo\ufffdbar\n')) |
308 | 315 |
309 self.assertEqual(port._get_crash_log('foo', 1234, 'foo\xa6bar', 'foo\xa6
bar', newer_than=1.0), | 316 self.assertEqual(port._get_crash_log('foo', 1234, 'foo\xa6bar', 'foo\xa6
bar', newer_than=1.0), |
310 ('foo\xa6bar', | 317 ('foo\xa6bar', |
311 u'crash log for foo (pid 1234):\n' | 318 u'crash log for foo (pid 1234):\n' |
312 u'STDOUT: foo\ufffdbar\n' | 319 u'STDOUT: foo\ufffdbar\n' |
313 u'STDERR: foo\ufffdbar\n')) | 320 u'STDERR: foo\ufffdbar\n')) |
314 | 321 |
315 def assert_build_path(self, options, dirs, expected_path): | 322 def assert_build_path(self, options, dirs, expected_path): |
316 port = self.make_port(options=options) | 323 port = self.make_port(options=options) |
317 for directory in dirs: | 324 for directory in dirs: |
318 port.host.filesystem.maybe_make_directory(directory) | 325 port.host.filesystem.maybe_make_directory(directory) |
319 self.assertEqual(port._build_path(), expected_path) | 326 self.assertEqual(port._build_path(), expected_path) |
320 | 327 |
321 def test_expectations_files(self): | 328 def test_expectations_files(self): |
322 port = self.make_port() | 329 port = self.make_port() |
323 | 330 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 for path in port.expectations_files(): | 383 for path in port.expectations_files(): |
377 port._filesystem.write_text_file(path, '') | 384 port._filesystem.write_text_file(path, '') |
378 port._filesystem.write_text_file('/tmp/foo', 'foo') | 385 port._filesystem.write_text_file('/tmp/foo', 'foo') |
379 port._filesystem.write_text_file('/tmp/bar', 'bar') | 386 port._filesystem.write_text_file('/tmp/bar', 'bar') |
380 ordered_dict = port.expectations_dict() | 387 ordered_dict = port.expectations_dict() |
381 self.assertEqual(ordered_dict.keys()[-2:], options.additional_expectatio
ns) # pylint: disable=E1101 | 388 self.assertEqual(ordered_dict.keys()[-2:], options.additional_expectatio
ns) # pylint: disable=E1101 |
382 self.assertEqual(ordered_dict.values()[-2:], ['foo', 'bar']) | 389 self.assertEqual(ordered_dict.values()[-2:], ['foo', 'bar']) |
383 | 390 |
384 def test_skipped_directories_for_symbols(self): | 391 def test_skipped_directories_for_symbols(self): |
385 # This first test confirms that the commonly found symbols result in the
expected skipped directories. | 392 # This first test confirms that the commonly found symbols result in the
expected skipped directories. |
386 symbols_string = " ".join(["fooSymbol"]) | 393 symbols_string = ' '.join(['fooSymbol']) |
387 expected_directories = set([ | 394 expected_directories = set([ |
388 "webaudio/codec-tests/mp3", | 395 'webaudio/codec-tests/mp3', |
389 "webaudio/codec-tests/aac", | 396 'webaudio/codec-tests/aac', |
390 ]) | 397 ]) |
391 | 398 |
392 result_directories = set(TestWebKitPort(symbols_string=symbols_string)._
skipped_tests_for_unsupported_features(test_list=['webaudio/codec-tests/mp3/foo.
html'])) | 399 result_directories = set( |
| 400 TestWebKitPort( |
| 401 symbols_string=symbols_string)._skipped_tests_for_unsupported_fe
atures( |
| 402 test_list=['webaudio/codec-tests/mp3/foo.html'])) |
393 self.assertEqual(result_directories, expected_directories) | 403 self.assertEqual(result_directories, expected_directories) |
394 | 404 |
395 # Test that the nm string parsing actually works: | 405 # Test that the nm string parsing actually works: |
396 symbols_string = """ | 406 symbols_string = """ |
397 000000000124f498 s __ZZN7WebCore13ff_mp3_decoder12replaceChildEPS0_S1_E19__PRETT
Y_FUNCTION__ | 407 000000000124f498 s __ZZN7WebCore13ff_mp3_decoder12replaceChildEPS0_S1_E19__PRETT
Y_FUNCTION__ |
398 000000000124f500 s __ZZN7WebCore13ff_mp3_decoder13addChildAboveEPS0_S1_E19__PRET
TY_FUNCTION__ | 408 000000000124f500 s __ZZN7WebCore13ff_mp3_decoder13addChildAboveEPS0_S1_E19__PRET
TY_FUNCTION__ |
399 000000000124f670 s __ZZN7WebCore13ff_mp3_decoder13addChildBelowEPS0_S1_E19__PRET
TY_FUNCTION__ | 409 000000000124f670 s __ZZN7WebCore13ff_mp3_decoder13addChildBelowEPS0_S1_E19__PRET
TY_FUNCTION__ |
400 """ | 410 """ |
401 # Note 'compositing' is not in the list of skipped directories (hence th
e parsing of GraphicsLayer worked): | 411 # Note 'compositing' is not in the list of skipped directories (hence th
e parsing of GraphicsLayer worked): |
402 expected_directories = set([ | 412 expected_directories = set([ |
403 "webaudio/codec-tests/aac", | 413 'webaudio/codec-tests/aac', |
404 ]) | 414 ]) |
405 result_directories = set(TestWebKitPort(symbols_string=symbols_string)._
skipped_tests_for_unsupported_features(test_list=['webaudio/codec-tests/mp3/foo.
html'])) | 415 result_directories = set( |
| 416 TestWebKitPort( |
| 417 symbols_string=symbols_string)._skipped_tests_for_unsupported_fe
atures( |
| 418 test_list=['webaudio/codec-tests/mp3/foo.html'])) |
406 self.assertEqual(result_directories, expected_directories) | 419 self.assertEqual(result_directories, expected_directories) |
407 | 420 |
408 def _assert_config_file_for_platform(self, port, platform, config_file): | 421 def _assert_config_file_for_platform(self, port, platform, config_file): |
409 self.assertEqual(port._apache_config_file_name_for_platform(platform), c
onfig_file) | 422 self.assertEqual(port._apache_config_file_name_for_platform(platform), c
onfig_file) |
410 | 423 |
411 def test_linux_distro_detection(self): | 424 def test_linux_distro_detection(self): |
412 port = TestWebKitPort() | 425 port = TestWebKitPort() |
413 self.assertFalse(port._is_redhat_based()) | 426 self.assertFalse(port._is_redhat_based()) |
414 self.assertFalse(port._is_debian_based()) | 427 self.assertFalse(port._is_debian_based()) |
415 | 428 |
(...skipping 15 matching lines...) Expand all Loading... |
431 port._is_redhat_based = lambda: True | 444 port._is_redhat_based = lambda: True |
432 port._apache_version = lambda: '2.2' | 445 port._apache_version = lambda: '2.2' |
433 self._assert_config_file_for_platform(port, 'linux2', 'fedora-httpd-2.2.
conf') | 446 self._assert_config_file_for_platform(port, 'linux2', 'fedora-httpd-2.2.
conf') |
434 | 447 |
435 port = TestWebKitPort() | 448 port = TestWebKitPort() |
436 port._is_debian_based = lambda: True | 449 port._is_debian_based = lambda: True |
437 port._apache_version = lambda: '2.2' | 450 port._apache_version = lambda: '2.2' |
438 self._assert_config_file_for_platform(port, 'linux2', 'debian-httpd-2.2.
conf') | 451 self._assert_config_file_for_platform(port, 'linux2', 'debian-httpd-2.2.
conf') |
439 | 452 |
440 self._assert_config_file_for_platform(port, 'mac', 'apache2-httpd.conf') | 453 self._assert_config_file_for_platform(port, 'mac', 'apache2-httpd.conf') |
441 self._assert_config_file_for_platform(port, 'win32', 'apache2-httpd.conf
') # win32 isn't a supported sys.platform. AppleWin/WinCairo/WinCE ports all u
se cygwin. | 454 # win32 isn't a supported sys.platform. AppleWin/WinCairo/WinCE ports a
ll use cygwin. |
| 455 self._assert_config_file_for_platform(port, 'win32', 'apache2-httpd.conf
') |
442 self._assert_config_file_for_platform(port, 'barf', 'apache2-httpd.conf'
) | 456 self._assert_config_file_for_platform(port, 'barf', 'apache2-httpd.conf'
) |
443 | 457 |
444 def test_path_to_apache_config_file(self): | 458 def test_path_to_apache_config_file(self): |
445 port = TestWebKitPort() | 459 port = TestWebKitPort() |
446 | 460 |
447 saved_environ = os.environ.copy() | 461 saved_environ = os.environ.copy() |
448 try: | 462 try: |
449 os.environ['WEBKIT_HTTP_SERVER_CONF_PATH'] = '/path/to/httpd.conf' | 463 os.environ['WEBKIT_HTTP_SERVER_CONF_PATH'] = '/path/to/httpd.conf' |
450 self.assertRaises(IOError, port.path_to_apache_config_file) | 464 self.assertRaises(IOError, port.path_to_apache_config_file) |
451 port._filesystem.write_text_file('/existing/httpd.conf', 'Hello, wor
ld!') | 465 port._filesystem.write_text_file('/existing/httpd.conf', 'Hello, wor
ld!') |
(...skipping 10 matching lines...) Expand all Loading... |
462 saved_environ = os.environ.copy() | 476 saved_environ = os.environ.copy() |
463 try: | 477 try: |
464 os.environ['WEBKIT_HTTP_SERVER_CONF_PATH'] = '/existing/httpd.conf' | 478 os.environ['WEBKIT_HTTP_SERVER_CONF_PATH'] = '/existing/httpd.conf' |
465 self.assertEqual(port.path_to_apache_config_file(), '/existing/httpd
.conf') | 479 self.assertEqual(port.path_to_apache_config_file(), '/existing/httpd
.conf') |
466 finally: | 480 finally: |
467 os.environ = saved_environ.copy() | 481 os.environ = saved_environ.copy() |
468 | 482 |
469 def test_additional_platform_directory(self): | 483 def test_additional_platform_directory(self): |
470 port = self.make_port(options=MockOptions(additional_platform_directory=
['/tmp/foo'])) | 484 port = self.make_port(options=MockOptions(additional_platform_directory=
['/tmp/foo'])) |
471 self.assertEqual(port.baseline_search_path()[0], '/tmp/foo') | 485 self.assertEqual(port.baseline_search_path()[0], '/tmp/foo') |
OLD | NEW |