Changeset 252948 in webkit


Ignore:
Timestamp:
Nov 29, 2019 10:54:17 AM (4 years ago)
Author:
Antti Koivisto
Message:

Add mechanism for enabling internal and experimental features from run-webkit-test command line
https://bugs.webkit.org/show_bug.cgi?id=204702

Reviewed by Antoine Quint.

Add --internal-feature and --experimental-feature flags to TestRunner and run-webkit-tests.
This is useful for running existing tests with different feature enabled without modifying
anything else. For example:

run-webkit-tests --internal-feature LayoutFormattingContextRenderTreeIntegrationEnabled

  • Scripts/webkitpy/layout_tests/run_webkit_tests.py:

(parse_args):

  • Scripts/webkitpy/port/base.py:

(Port.internal_feature):
(Port):
(Port.experimental_feature):

  • Scripts/webkitpy/port/driver.py:

(Driver.cmd_line):

  • WebKitTestRunner/Options.cpp:

(WTR::handleOptionExperimentalFeature):
(WTR::handleOptionInternalFeature):
(WTR::OptionsHandler::OptionsHandler):

  • WebKitTestRunner/Options.h:
  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::initialize):
(WTR::TestController::testOptionsForTest const):

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

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r252946 r252948  
     12019-11-29  Antti Koivisto  <antti@apple.com>
     2
     3        Add mechanism for enabling internal and experimental features from run-webkit-test command line
     4        https://bugs.webkit.org/show_bug.cgi?id=204702
     5
     6        Reviewed by Antoine Quint.
     7
     8        Add --internal-feature and --experimental-feature flags to TestRunner and run-webkit-tests.
     9        This is useful for running existing tests with different feature enabled without modifying
     10        anything else. For example:
     11
     12        run-webkit-tests --internal-feature LayoutFormattingContextRenderTreeIntegrationEnabled
     13
     14        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
     15        (parse_args):
     16        * Scripts/webkitpy/port/base.py:
     17        (Port.internal_feature):
     18        (Port):
     19        (Port.experimental_feature):
     20        * Scripts/webkitpy/port/driver.py:
     21        (Driver.cmd_line):
     22        * WebKitTestRunner/Options.cpp:
     23        (WTR::handleOptionExperimentalFeature):
     24        (WTR::handleOptionInternalFeature):
     25        (WTR::OptionsHandler::OptionsHandler):
     26        * WebKitTestRunner/Options.h:
     27        * WebKitTestRunner/TestController.cpp:
     28        (WTR::TestController::initialize):
     29        (WTR::TestController::testOptionsForTest const):
     30        * WebKitTestRunner/TestController.h:
     31
    1322019-11-29  Aakash Jain  <aakash_jain@apple.com>
    233
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

    r252711 r252948  
    119119        optparse.make_option("--remote-layer-tree", action="store_true", default=False,
    120120            help="Use the remote layer tree drawing model (OS X WebKit2 only)"),
     121        optparse.make_option("--internal-feature", type="string", action="append",
     122            default=[], help="Enable internal feature"),
     123        optparse.make_option("--experimental-feature", type="string", action="append",
     124            default=[], help="Enable experimental feature"),
    121125    ]))
    122126
  • trunk/Tools/Scripts/webkitpy/port/base.py

    r252714 r252948  
    11941194        return self.get_option("allowed_host", [])
    11951195
     1196    def internal_feature(self):
     1197        return self.get_option("internal_feature", [])
     1198
     1199    def experimental_feature(self):
     1200        return self.get_option("experimental_feature", [])
     1201
    11961202    def default_configuration(self):
    11971203        return self._config.default_configuration()
  • trunk/Tools/Scripts/webkitpy/port/driver.py

    r249965 r252948  
    524524            cmd.append(allowed_host)
    525525
     526        for feature in self._port.internal_feature():
     527            cmd.append('--internal-feature')
     528            cmd.append(feature)
     529
     530        for feature in self._port.experimental_feature():
     531            cmd.append('--experimental-feature')
     532            cmd.append(feature)
     533
    526534        cmd.extend(self._port.get_option('additional_drt_flag', []))
    527535        cmd.extend(self._port.additional_drt_flag())
  • trunk/Tools/WebKitTestRunner/Options.cpp

    r245733 r252948  
    106106}
    107107
     108static bool handleOptionExperimentalFeature(Options& options, const char*, const char* feature)
     109{
     110    options.experimentalFeatures.insert(feature);
     111    return true;
     112}
     113
     114static bool handleOptionInternalFeature(Options& options, const char*, const char* feature)
     115{
     116    options.internalFeatures.insert(feature);
     117    return true;
     118}
     119
    108120static bool handleOptionUnmatched(Options& options, const char* option, const char*)
    109121{
     
    130142    optionList.append(Option("--show-touches", "Show the touches during test runs (for debugging)", handleOptionShowTouches));
    131143    optionList.append(Option("--world-leaks", "Check for leaks of world objects (currently, documents)", handleOptionCheckForWorldLeaks));
     144    optionList.append(Option("--experimental-feature", "Enable experimental feature", handleOptionExperimentalFeature, true));
     145    optionList.append(Option("--internal-feature", "Enable internal feature", handleOptionInternalFeature, true));
    132146
    133147    optionList.append(Option(0, 0, handleOptionUnmatched));
  • trunk/Tools/WebKitTestRunner/Options.h

    r245733 r252948  
    5252    std::vector<std::string> paths;
    5353    std::set<std::string> allowedHosts;
     54    std::set<std::string> internalFeatures;
     55    std::set<std::string> experimentalFeatures;
    5456};
    5557
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r252840 r252948  
    473473    m_checkForWorldLeaks = options.checkForWorldLeaks;
    474474    m_allowAnyHTTPSCertificateForAllowedHosts = options.allowAnyHTTPSCertificateForAllowedHosts;
     475    m_internalFeatures = options.internalFeatures;
     476    m_experimentalFeatures = options.experimentalFeatures;
    475477
    476478    m_usingServerMode = (m_paths.size() == 1 && m_paths[0] == "-");
     
    14541456    options.shouldShowWebView = m_shouldShowWebView;
    14551457
     1458    for (auto& feature : m_internalFeatures)
     1459        options.internalDebugFeatures.add(feature.c_str(), true);
     1460    for (auto& feature : m_experimentalFeatures)
     1461        options.experimentalFeatures.add(feature.c_str(), true);
     1462
    14561463    updatePlatformSpecificTestOptionsForTest(options, command.pathOrURL);
    14571464    updateTestOptionsFromTestHeader(options, command.pathOrURL, command.absolutePath);
  • trunk/Tools/WebKitTestRunner/TestController.h

    r252840 r252948  
    501501    std::vector<std::string> m_paths;
    502502    std::set<std::string> m_allowedHosts;
     503    std::set<std::string> m_internalFeatures;
     504    std::set<std::string> m_experimentalFeatures;
     505
    503506    WKRetainPtr<WKStringRef> m_injectedBundlePath;
    504507    WKRetainPtr<WKStringRef> m_testPluginDirectory;
     
    573576
    574577    bool m_allowAnyHTTPSCertificateForAllowedHosts { false };
    575    
     578
    576579    bool m_shouldDecideNavigationPolicyAfterDelay { false };
    577580    bool m_shouldDecideResponsePolicyAfterDelay { false };
Note: See TracChangeset for help on using the changeset viewer.