| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 355 |
| 356 filesystem.write_text_file(filesystem.join(LAYOUT_TEST_DIR, 'virtual', 'virt
ual_passes', 'passes', 'args-expected.txt'), 'args-txt --virtual-arg') | 356 filesystem.write_text_file(filesystem.join(LAYOUT_TEST_DIR, 'virtual', 'virt
ual_passes', 'passes', 'args-expected.txt'), 'args-txt --virtual-arg') |
| 357 # Clear the list of written files so that we can watch what happens during t
esting. | 357 # Clear the list of written files so that we can watch what happens during t
esting. |
| 358 filesystem.clear_written_files() | 358 filesystem.clear_written_files() |
| 359 | 359 |
| 360 | 360 |
| 361 class TestPort(Port): | 361 class TestPort(Port): |
| 362 port_name = 'test' | 362 port_name = 'test' |
| 363 default_port_name = 'test-mac-leopard' | 363 default_port_name = 'test-mac-leopard' |
| 364 | 364 |
| 365 """Test implementation of the Port interface.""" | 365 # TODO(wkorman): The below constant is legacy code and is only referenced by
a unit test. Find the modern way to do |
| 366 # the same thing that test is doing and delete this. |
| 367 # |
| 368 # A list of platform names sufficient to cover all the baselines. |
| 369 # The list should be sorted so that a later platform will reuse |
| 370 # an earlier platform's baselines if they are the same (e.g., |
| 371 # 'mac10.10' should precede 'mac10.9'). |
| 366 ALL_BASELINE_VARIANTS = ( | 372 ALL_BASELINE_VARIANTS = ( |
| 367 'test-linux-trusty', 'test-linux-precise', 'test-linux-x86', | 373 'test-linux-trusty', 'test-linux-precise', 'test-linux-x86', |
| 368 'test-mac-snowleopard', 'test-mac-leopard', | 374 'test-mac-snowleopard', 'test-mac-leopard', |
| 369 'test-win-win7', 'test-win-xp', | 375 'test-win-win10', 'test-win-win7' |
| 370 ) | 376 ) |
| 371 | 377 |
| 372 FALLBACK_PATHS = { | 378 FALLBACK_PATHS = { |
| 373 'xp': ['test-win-win7', 'test-win-xp'], | 379 'win7': ['test-win-win7', 'test-win-win10'], |
| 374 'win7': ['test-win-win7'], | 380 'win10': ['test-win-win10'], |
| 375 'leopard': ['test-mac-leopard', 'test-mac-snowleopard'], | 381 'leopard': ['test-mac-leopard', 'test-mac-snowleopard'], |
| 376 'snowleopard': ['test-mac-snowleopard'], | 382 'snowleopard': ['test-mac-snowleopard'], |
| 377 'trusty': ['test-linux-trusty', 'test-win-win7'], | 383 'trusty': ['test-linux-trusty', 'test-win-win7'], |
| 378 'precise': ['test-linux-precise', 'test-linux-trusty', 'test-win-win
7'], | 384 'precise': ['test-linux-precise', 'test-linux-trusty', 'test-win-win
7'], |
| 379 'linux32': ['test-linux-x86', 'test-linux-precise', 'test-linux-trus
ty', 'test-win-win7'], | 385 'linux32': ['test-linux-x86', 'test-linux-precise', 'test-linux-trus
ty', 'test-win-win7'], |
| 380 } | 386 } |
| 381 | 387 |
| 382 @classmethod | 388 @classmethod |
| 383 def determine_full_port_name(cls, host, options, port_name): | 389 def determine_full_port_name(cls, host, options, port_name): |
| 384 if port_name == 'test': | 390 if port_name == 'test': |
| (...skipping 17 matching lines...) Expand all Loading... |
| 402 self._generic_expectations_path = '/mock-checkout/LayoutTests/TestExpect
ations' | 408 self._generic_expectations_path = '/mock-checkout/LayoutTests/TestExpect
ations' |
| 403 self._results_directory = None | 409 self._results_directory = None |
| 404 | 410 |
| 405 self._operating_system = 'mac' | 411 self._operating_system = 'mac' |
| 406 if self._name.startswith('test-win'): | 412 if self._name.startswith('test-win'): |
| 407 self._operating_system = 'win' | 413 self._operating_system = 'win' |
| 408 elif self._name.startswith('test-linux'): | 414 elif self._name.startswith('test-linux'): |
| 409 self._operating_system = 'linux' | 415 self._operating_system = 'linux' |
| 410 | 416 |
| 411 version_map = { | 417 version_map = { |
| 412 'test-win-xp': 'xp', | |
| 413 'test-win-win7': 'win7', | 418 'test-win-win7': 'win7', |
| 419 'test-win-win10': 'win10', |
| 414 'test-mac-leopard': 'leopard', | 420 'test-mac-leopard': 'leopard', |
| 415 'test-mac-snowleopard': 'snowleopard', | 421 'test-mac-snowleopard': 'snowleopard', |
| 416 'test-linux-x86': 'linux32', | 422 'test-linux-x86': 'linux32', |
| 417 'test-linux-precise': 'precise', | 423 'test-linux-precise': 'precise', |
| 418 'test-linux-trusty': 'trusty', | 424 'test-linux-trusty': 'trusty', |
| 419 } | 425 } |
| 420 self._version = version_map[self._name] | 426 self._version = version_map[self._name] |
| 421 | 427 |
| 422 if self._operating_system == 'linux' and self._version != 'linux32': | 428 if self._operating_system == 'linux' and self._version != 'linux32': |
| 423 self._architecture = 'x86_64' | 429 self._architecture = 'x86_64' |
| 424 | 430 |
| 425 def buildbot_archives_baselines(self): | 431 def buildbot_archives_baselines(self): |
| 426 return self._name != 'test-win-xp' | 432 return self._name != 'test-win-win7' |
| 427 | 433 |
| 428 def default_pixel_tests(self): | 434 def default_pixel_tests(self): |
| 429 return True | 435 return True |
| 430 | 436 |
| 431 def _path_to_driver(self): | 437 def _path_to_driver(self): |
| 432 # This routine shouldn't normally be called, but it is called by | 438 # This routine shouldn't normally be called, but it is called by |
| 433 # the mock_drt Driver. We return something, but make sure it's useless. | 439 # the mock_drt Driver. We return something, but make sure it's useless. |
| 434 return 'MOCK _path_to_driver' | 440 return 'MOCK _path_to_driver' |
| 435 | 441 |
| 436 def default_child_processes(self): | 442 def default_child_processes(self): |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 def path_to_apache(self): | 514 def path_to_apache(self): |
| 509 return "/usr/sbin/httpd" | 515 return "/usr/sbin/httpd" |
| 510 | 516 |
| 511 def path_to_apache_config_file(self): | 517 def path_to_apache_config_file(self): |
| 512 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'h
ttpd.conf') | 518 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'h
ttpd.conf') |
| 513 | 519 |
| 514 def path_to_generic_test_expectations_file(self): | 520 def path_to_generic_test_expectations_file(self): |
| 515 return self._generic_expectations_path | 521 return self._generic_expectations_path |
| 516 | 522 |
| 517 def _port_specific_expectations_files(self): | 523 def _port_specific_expectations_files(self): |
| 518 return [self._filesystem.join(self._webkit_baseline_path(d), 'TestExpect
ations') for d in ['test', 'test-win-xp']] | 524 return [self._filesystem.join(self._webkit_baseline_path(d), 'TestExpect
ations') for d in ['test', 'test-win-win7']] |
| 519 | 525 |
| 520 def all_test_configurations(self): | 526 def all_test_configurations(self): |
| 521 """Returns a sequence of the TestConfigurations the port supports.""" | 527 """Returns a sequence of the TestConfigurations the port supports.""" |
| 522 # By default, we assume we want to test every graphics type in | 528 # By default, we assume we want to test every graphics type in |
| 523 # every configuration on every system. | 529 # every configuration on every system. |
| 524 test_configurations = [] | 530 test_configurations = [] |
| 525 for version, architecture in self._all_systems(): | 531 for version, architecture in self._all_systems(): |
| 526 for build_type in self._all_build_types(): | 532 for build_type in self._all_build_types(): |
| 527 test_configurations.append(TestConfiguration( | 533 test_configurations.append(TestConfiguration( |
| 528 version=version, | 534 version=version, |
| 529 architecture=architecture, | 535 architecture=architecture, |
| 530 build_type=build_type)) | 536 build_type=build_type)) |
| 531 return test_configurations | 537 return test_configurations |
| 532 | 538 |
| 533 def _all_systems(self): | 539 def _all_systems(self): |
| 534 return (('leopard', 'x86'), | 540 return (('leopard', 'x86'), |
| 535 ('snowleopard', 'x86'), | 541 ('snowleopard', 'x86'), |
| 536 ('xp', 'x86'), | |
| 537 ('win7', 'x86'), | 542 ('win7', 'x86'), |
| 543 ('win10', 'x86'), |
| 538 ('linux32', 'x86'), | 544 ('linux32', 'x86'), |
| 539 ('precise', 'x86_64'), | 545 ('precise', 'x86_64'), |
| 540 ('trusty', 'x86_64')) | 546 ('trusty', 'x86_64')) |
| 541 | 547 |
| 542 def _all_build_types(self): | 548 def _all_build_types(self): |
| 543 return ('debug', 'release') | 549 return ('debug', 'release') |
| 544 | 550 |
| 545 def configuration_specifier_macros(self): | 551 def configuration_specifier_macros(self): |
| 546 """To avoid surprises when introducing new macros, these are intentional
ly fixed in time.""" | 552 """To avoid surprises when introducing new macros, these are intentional
ly fixed in time.""" |
| 547 return { | 553 return { |
| 548 'mac': ['leopard', 'snowleopard'], | 554 'mac': ['leopard', 'snowleopard'], |
| 549 'win': ['xp', 'win7'], | 555 'win': ['win7', 'win10'], |
| 550 'linux': ['linux32', 'precise', 'trusty'] | 556 'linux': ['linux32', 'precise', 'trusty'] |
| 551 } | 557 } |
| 552 | 558 |
| 553 def all_baseline_variants(self): | |
| 554 return self.ALL_BASELINE_VARIANTS | |
| 555 | |
| 556 def virtual_test_suites(self): | 559 def virtual_test_suites(self): |
| 557 return [ | 560 return [ |
| 558 VirtualTestSuite(prefix='virtual_passes', base='passes', args=['--vi
rtual-arg']), | 561 VirtualTestSuite(prefix='virtual_passes', base='passes', args=['--vi
rtual-arg']), |
| 559 VirtualTestSuite(prefix='skipped', base='failures/expected', args=['
--virtual-arg2']), | 562 VirtualTestSuite(prefix='skipped', base='failures/expected', args=['
--virtual-arg2']), |
| 560 VirtualTestSuite(prefix='references_use_default_args', base='passes/
reftest.html', | 563 VirtualTestSuite(prefix='references_use_default_args', base='passes/
reftest.html', |
| 561 args=['--virtual-arg'], references_use_default_args
=True), | 564 args=['--virtual-arg'], references_use_default_args
=True), |
| 562 ] | 565 ] |
| 563 | 566 |
| 564 | 567 |
| 565 class TestDriver(Driver): | 568 class TestDriver(Driver): |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 else: | 655 else: |
| 653 image = test.actual_image | 656 image = test.actual_image |
| 654 return DriverOutput(actual_text, image, test.actual_checksum, audio, | 657 return DriverOutput(actual_text, image, test.actual_checksum, audio, |
| 655 crash=(crash or web_process_crash), crashed_process_name=crashed_pro
cess_name, | 658 crash=(crash or web_process_crash), crashed_process_name=crashed_pro
cess_name, |
| 656 crashed_pid=crashed_pid, crash_log=crash_log, | 659 crashed_pid=crashed_pid, crash_log=crash_log, |
| 657 test_time=time.time() - start_time, timeout=test.timeout, error=test
.error, pid=self.pid, | 660 test_time=time.time() - start_time, timeout=test.timeout, error=test
.error, pid=self.pid, |
| 658 leak=test.leak) | 661 leak=test.leak) |
| 659 | 662 |
| 660 def stop(self): | 663 def stop(self): |
| 661 self.started = False | 664 self.started = False |
| OLD | NEW |