Changeset 83327 in webkit


Ignore:
Timestamp:
Apr 8, 2011 12:48:47 PM (13 years ago)
Author:
dpranke@chromium.org
Message:

2011-04-08 Dirk Pranke <dpranke@chromium.org>

Reviewed by Ojan Vafai.

new-run-webkit-tests: clean up the way we handle missing files,
to be consistent. With this change, the Port.expected_X() and
Driver.run_test() routines should return None if there is no
output, not .

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

  • Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py:
  • Scripts/webkitpy/layout_tests/port/base.py:
  • Scripts/webkitpy/layout_tests/port/chromium.py:
  • Scripts/webkitpy/layout_tests/port/webkit.py:
Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r83310 r83327  
     12011-04-08  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        new-run-webkit-tests: clean up the way we handle missing files,
     6        to be consistent. With this change, the Port.expected_X() and
     7        Driver.run_test() routines should return None if there is no
     8        output, not ''.
     9
     10        https://bugs.webkit.org/show_bug.cgi?id=58101
     11
     12        * Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py:
     13        * Scripts/webkitpy/layout_tests/port/base.py:
     14        * Scripts/webkitpy/layout_tests/port/chromium.py:
     15        * Scripts/webkitpy/layout_tests/port/webkit.py:
     16
    1172011-04-08  Pere Martir  <pere.martir4@gmail.com>
    218
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py

    r81127 r83327  
    223223    def _compare_text(self, actual_text, expected_text):
    224224        failures = []
    225         if self._port.compare_text(self._get_normalized_output_text(actual_text),
    226                                    # Assuming expected_text is already normalized.
    227                                    expected_text):
    228             if expected_text == '':
    229                 failures.append(test_failures.FailureMissingResult())
    230             else:
    231                 failures.append(test_failures.FailureTextMismatch())
     225        if (expected_text and actual_text and
     226            # Assuming expected_text is already normalized.
     227            self._port.compare_text(self._get_normalized_output_text(actual_text), expected_text)):
     228            failures.append(test_failures.FailureTextMismatch())
     229        elif actual_text and not expected_text:
     230            failures.append(test_failures.FailureMissingResult())
    232231        return failures
    233232
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py

    r82972 r83327  
    353353
    354354    def expected_text(self, test):
    355         """Returns the text output we expect the test to produce.
     355        """Returns the text output we expect the test to produce, or None
     356        if we don't expect there to be any text output.
    356357        End-of-line characters are normalized to '\n'."""
    357358        # FIXME: DRT output is actually utf-8, but since we don't decode the
     
    360361        path = self.expected_filename(test, '.txt')
    361362        if not self.path_exists(path):
    362             return ''
     363            return None
    363364        text = self._filesystem.read_binary_file(path)
    364365        return text.replace("\r\n", "\n")
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py

    r83250 r83327  
    426426            return self._port._filesystem.read_binary_file(png_path)
    427427        else:
    428             return ''
     428            return None
    429429
    430430    def _output_image_with_retry(self):
     
    503503        run_time = time.time() - start_time
    504504        output_image = self._output_image_with_retry()
    505         assert output_image is not None
    506         return base.DriverOutput(''.join(output), output_image, actual_checksum,
     505        text = ''.join(output)
     506        if not text:
     507            text = None
     508
     509        return base.DriverOutput(text, output_image, actual_checksum,
    507510                                 crash, run_time, timeout, ''.join(error))
    508511
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py

    r82753 r83327  
    410410        actual_image_hash = None
    411411        output = str()  # Use a byte array for output, even though it should be UTF-8.
    412         image = str()
     412        text = None
     413        image = None
    413414
    414415        timeout = int(driver_input.timeout) / 1000.0
     
    429430            line = self._server_process.read_line(timeout)
    430431            timeout = deadline - time.time()
     432
     433        if output:
     434            text = output
    431435
    432436        # Now read a second block of text for the optional image data
     
    459463        # this reset in.
    460464        self._server_process.error = ""
    461         return base.DriverOutput(output, image, actual_image_hash,
     465        return base.DriverOutput(text, image, actual_image_hash,
    462466                                 self._server_process.crashed,
    463467                                 time.time() - start_time,
Note: See TracChangeset for help on using the changeset viewer.