⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285168 in webkit


Ignore:
Timestamp:
Nov 2, 2021, 10:50:02 AM (5 years ago)
Author:
timothy_horton@apple.com
Message:

dumpAsText() tests don't get the ref-test treatment when using --self-compare-with-header
​https://bugs.webkit.org/show_bug.cgi?id=232611

Reviewed by Jonathan Bedard.

One oversight in r285132: a test can disable pixel dumping by calling
dumpAsText(). This causes --self-compare-with-header to fall over because
it expects every test to have pixel results (and that is the whole point).

Add an un-overrideable --force-dump-pixels TestCommand argument,
and adopt it for self-comparison tests.

  • Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:

(SingleTestRunner._run_self_comparison_test):

  • Scripts/webkitpy/port/driver.py:

(DriverInput.init):
(DriverInput.repr):
(Driver._command_from_driver_input):

  • TestRunnerShared/TestCommand.cpp:

(WTR::parseInputLine):

  • TestRunnerShared/TestCommand.h:
  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::runTest):

  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::dumpResults):
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

  • WebKitTestRunner/TestInvocation.h:
Location:
trunk/Tools
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r285163 r285168  
     12021-11-02  Tim Horton  <timothy_horton@apple.com>
     2
     3        dumpAsText() tests don't get the ref-test treatment when using --self-compare-with-header
     4        https://bugs.webkit.org/show_bug.cgi?id=232611
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        One oversight in r285132: a test can disable pixel dumping by calling
     9        dumpAsText(). This causes --self-compare-with-header to fall over because
     10        it expects every test to have pixel results (and that is the whole point).
     11
     12        Add an un-overrideable `--force-dump-pixels` TestCommand argument,
     13        and adopt it for self-comparison tests.
     14
     15        * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
     16        (SingleTestRunner._run_self_comparison_test):
     17        * Scripts/webkitpy/port/driver.py:
     18        (DriverInput.__init__):
     19        (DriverInput.__repr__):
     20        (Driver._command_from_driver_input):
     21        * TestRunnerShared/TestCommand.cpp:
     22        (WTR::parseInputLine):
     23        * TestRunnerShared/TestCommand.h:
     24        * WebKitTestRunner/TestController.cpp:
     25        (WTR::TestController::runTest):
     26        * WebKitTestRunner/TestInvocation.cpp:
     27        (WTR::TestInvocation::dumpResults):
     28        (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
     29        * WebKitTestRunner/TestInvocation.h:
     30
    1312021-11-02  Kate Cheney  <katherine_cheney@apple.com>
    232
  • trunk/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py

    r285132 r285168  
    343343        driver_input = self._driver_input()
    344344        driver_input.should_run_pixel_test = True
     345        driver_input.force_dump_pixels = True
    345346
    346347        reference_output = self._driver.run_test(driver_input, self._stop_when_done)
  • trunk/Tools/Scripts/webkitpy/port/driver.py

    r285132 r285168  
    4747
    4848class DriverInput(object):
    49     def __init__(self, test_name, timeout, image_hash, should_run_pixel_test, should_dump_jsconsolelog_in_stderr=None, args=None, self_comparison_header=None):
     49    def __init__(self, test_name, timeout, image_hash, should_run_pixel_test, should_dump_jsconsolelog_in_stderr=None, args=None, self_comparison_header=None, force_dump_pixels=False):
    5050        self.test_name = test_name
    5151        self.timeout = timeout  # in ms
    … …  
    5555        self.args = args or []
    5656        self.self_comparison_header = self_comparison_header
     57        self.force_dump_pixels = force_dump_pixels
    5758
    5859    def __repr__(self):
    59         return "DriverInput(test_name='{}', timeout={}, image_hash={}, should_run_pixel_test={}, should_dump_jsconsolelog_in_stderr={}, self_comparison_header={}'".format(self.test_name, self.timeout, self.image_hash, self.should_run_pixel_test, self.should_dump_jsconsolelog_in_stderr, self.self_comparison_header)
     60        return "DriverInput(test_name='{}', timeout={}, image_hash={}, should_run_pixel_test={}, should_dump_jsconsolelog_in_stderr={}, self_comparison_header={}, force_dump_pixels={}'".format(self.test_name, self.timeout, self.image_hash, self.should_run_pixel_test, self.should_dump_jsconsolelog_in_stderr, self.self_comparison_header, self.force_dump_pixels)
    6061
    6162
    … …  
    637638        if driver_input.self_comparison_header:
    638639            command += "'--self-compare-with-header'%s" % driver_input.self_comparison_header
     640        if driver_input.force_dump_pixels:
     641            command += "'--force-dump-pixels"
    639642
    640643        # --pixel-test must be the last argument, because the hash is optional,
  • trunk/Tools/TestRunnerShared/TestCommand.cpp

    r285132 r285168  
    108108        else if (arg == std::string("--absolutePath"))
    109109            result.absolutePath = tokenizer.next();
     110        else if (arg == "--force-dump-pixels")
     111            result.forceDumpPixels = true;
    110112        else
    111113            die(inputLine);
  • trunk/Tools/TestRunnerShared/TestCommand.h

    r285132 r285168  
    3939    WTF::Seconds timeout;
    4040    bool shouldDumpPixels { false };
     41    bool forceDumpPixels { false };
    4142    bool dumpJSConsoleLogInStdErr { false };
    4243};
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r285132 r285168  
    14811481        m_currentInvocation->setIsPixelTest(command.expectedPixelHash);
    14821482
     1483    if (command.forceDumpPixels)
     1484        m_currentInvocation->setForceDumpPixels(true);
     1485
    14831486    if (command.timeout > 0_s)
    14841487        m_currentInvocation->setCustomTimeout(command.timeout);
  • trunk/Tools/WebKitTestRunner/TestInvocation.cpp

    r284610 r285168  
    830830
    831831    if (WKStringIsEqualToUTF8CString(messageName, "SetDumpPixels")) {
    832         m_dumpPixels = booleanValue(messageBody);
     832        m_dumpPixels = booleanValue(messageBody) || m_forceDumpPixels;
    833833        return nullptr;
    834834    }
  • trunk/Tools/WebKitTestRunner/TestInvocation.h

    r282103 r285168  
    5252
    5353    void setIsPixelTest(const std::string& expectedPixelHash);
     54    void setForceDumpPixels(bool forceDumpPixels) { m_forceDumpPixels = forceDumpPixels; }
    5455
    5556    void setCustomTimeout(Seconds duration) { m_timeout = duration; }
    … …  
    165166    bool m_dumpFrameLoadCallbacks { false };
    166167    bool m_dumpPixels { false };
     168    bool m_forceDumpPixels { false };
    167169    bool m_pixelResultIsPending { false };
    168170    bool m_shouldDumpResourceLoadStatistics { false };
Note: See TracChangeset for help on using the changeset viewer.