Changeset 73228 in webkit


Ignore:
Timestamp:
Dec 2, 2010 6:29:13 PM (13 years ago)
Author:
hayato@chromium.org
Message:

2010-12-02 Hayato Ito <hayato@chromium.org>

Reviewed by Eric Seidel.

Refactor test_types's compare_output() method so that it takes a
TestInput object.

compare_output() will need additional information included in a TestInput
object to support reftests. This change is a pre-requirement of that.

https://bugs.webkit.org/show_bug.cgi?id=50362

  • Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
  • Scripts/webkitpy/layout_tests/test_types/image_diff.py:
  • Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
  • Scripts/webkitpy/layout_tests/test_types/test_type_base_unittest.py:
  • Scripts/webkitpy/layout_tests/test_types/text_diff.py:
Location:
trunk/WebKitTools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r73226 r73228  
     12010-12-02  Hayato Ito  <hayato@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Refactor test_types's compare_output() method so that it takes a
     6        TestInput object.
     7
     8        compare_output() will need additional information included in a TestInput
     9        object to support reftests. This change is a pre-requirement of that.
     10
     11        https://bugs.webkit.org/show_bug.cgi?id=50362
     12
     13        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
     14        * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
     15        * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
     16        * Scripts/webkitpy/layout_tests/test_types/test_type_base_unittest.py:
     17        * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
     18
    1192010-12-02  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py

    r73222 r73228  
    387387                test_input.filename)
    388388        test_output = driver.run_test(test_input)
    389         return self._process_output(test_input.filename, test_output)
    390 
    391     def _process_output(self, test_filename, test_output):
     389        return self._process_output(test_input, test_output)
     390
     391    def _process_output(self, test_input, test_output):
    392392        """Receives the output from a DumpRenderTree process, subjects it to a
    393393        number of tests, and returns a list of failure types the test produced.
    394394
    395395        Args:
    396         test_filename: full path to the test in question.
     396        test_input: a TestInput object
    397397        test_output: a TestOutput object containing the output of the test
    398398
     
    400400        """
    401401        failures = []
     402        test_filename = test_input.filename
    402403
    403404        if test_output.crash:
     
    427428            start_diff_time = time.time()
    428429            new_failures = test_type.compare_output(self._port,
    429                                                     test_filename,
     430                                                    test_input,
    430431                                                    self._test_args,
    431432                                                    test_output,
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py

    r72314 r73228  
    9191        return port.diff_image(actual_image, expected_image, diff_filename)
    9292
    93     def compare_output(self, port, filename, test_args, actual_test_output,
     93    def compare_output(self, port, test_input, test_args, actual_test_output,
    9494                       expected_test_output):
    9595        """Implementation of CompareOutput that checks the output image and
     
    9797        """
    9898        failures = []
     99        filename = test_input.filename
    99100
    100101        # If we didn't produce a hash file, this test must be text-only.
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py

    r72249 r73228  
    141141        return os.path.splitext(output_filename)[0] + modifier
    142142
    143     def compare_output(self, port, filename, test_args, actual_test_output,
     143    def compare_output(self, port, test_input, test_args, actual_test_output,
    144144                        expected_test_output):
    145145        """Method that compares the output from the test with the
     
    150150        Args:
    151151          port: object implementing port-specific information and methods
    152           filename: absolute filename to test file
     152          test_input: a TestInput object
    153153          test_args: a TestArguments object holding optional additional
    154154              arguments
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base_unittest.py

    r65953 r73228  
    4040        test_type = test_type_base.TestTypeBase(None, None)
    4141        self.assertRaises(NotImplementedError, test_type.compare_output,
    42                           None, "foo.txt", '',
    43                           test_type_base.TestArguments(), 'Debug')
     42                          None, None, test_type_base.TestArguments(), None, None)
    4443
    4544
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py

    r72307 r73228  
    5656        return norm + "\n"
    5757
    58     def compare_output(self, port, filename, test_args, actual_test_output,
     58    def compare_output(self, port, test_input, test_args, actual_test_output,
    5959                        expected_test_output):
    6060        """Implementation of CompareOutput that checks the output text against
     
    6767            # we do not ever decode it inside run-webkit-tests.  For some tests
    6868            # DumpRenderTree may not output utf-8 text (e.g. webarchives).
    69             self._save_baseline_data(filename, actual_test_output.text,
     69            self._save_baseline_data(test_input.filename, actual_test_output.text,
    7070                                     ".txt", encoding=None,
    7171                                     generate_new_baseline=test_args.new_baseline)
     
    8080        if port.compare_text(actual_text, expected_text):
    8181            # Text doesn't match, write output files.
    82             self.write_output_files(filename, ".txt", actual_text,
     82            self.write_output_files(test_input.filename, ".txt", actual_text,
    8383                                    expected_text, encoding=None,
    8484                                    print_text_diffs=True)
Note: See TracChangeset for help on using the changeset viewer.