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

Changeset 276559 in webkit


Ignore:
Timestamp:
Apr 24, 2021, 5:39:43 PM (5 years ago)
Author:
rniwa@webkit.org
Message:

Add an option to not enable all experimental features in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=224958

Reviewed by Tim Horton.

Added --no-enable-all-experimental-features to run-webkit-tests and WebKitTestRunner.

It causes a crash in DumpRenderTree for now. We should rectify this in the future
when we align the behaviors of WebKitTestRunner and DumpRenderTree.

  • Scripts/webkitpy/layout_tests/run_webkit_tests.py:

(parse_args): Added --no-enable-all-experimental-features.

  • Scripts/webkitpy/port/driver.py:

(Driver.cmd_line): Pass along the option to WebKitTestRunner.

  • WebKitTestRunner/Options.cpp:

(WTR::handleOptionNoEnableAllExperimentalFeatures): Added.
(WTR::OptionsHandler::OptionsHandler): Added --no-enable-all-experimental-features.

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

(WTR::TestController::initialize):
(WTR::TestController::resetPreferencesToConsistentValues):

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

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r276550 r276559  
     12021-04-24  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Add an option to not enable all experimental features in WebKitTestRunner
     4        https://bugs.webkit.org/show_bug.cgi?id=224958
     5
     6        Reviewed by Tim Horton.
     7
     8        Added --no-enable-all-experimental-features to run-webkit-tests and WebKitTestRunner.
     9
     10        It causes a crash in DumpRenderTree for now. We should rectify this in the future
     11        when we align the behaviors of WebKitTestRunner and DumpRenderTree.
     12
     13        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
     14        (parse_args): Added --no-enable-all-experimental-features.
     15        * Scripts/webkitpy/port/driver.py:
     16        (Driver.cmd_line): Pass along the option to WebKitTestRunner.
     17        * WebKitTestRunner/Options.cpp:
     18        (WTR::handleOptionNoEnableAllExperimentalFeatures): Added.
     19        (WTR::OptionsHandler::OptionsHandler): Added --no-enable-all-experimental-features.
     20        * WebKitTestRunner/Options.h:
     21        * WebKitTestRunner/TestController.cpp:
     22        (WTR::TestController::initialize):
     23        (WTR::TestController::resetPreferencesToConsistentValues):
     24        * WebKitTestRunner/TestController.h:
     25
    1262021-04-24  Tyler Wilcock  <twilco.o@protonmail.com>
    227
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

    r274095 r276559  
    127127        optparse.make_option("--experimental-feature", type="string", action="append", default=[],
    128128            help="Enable (disable) an experimental feature (--experimental-feature FeatureName[=true|false])"),
     129        optparse.make_option("--no-enable-all-experimental-features", action="store_false", default=True, dest="enable_all_experimental_features",
     130            help="Enables all experimental features in WebKitTestRunner"),
    129131    ]))
    130132
  • trunk/Tools/Scripts/webkitpy/port/driver.py

    r271071 r276559  
    535535            cmd.append(feature)
    536536
     537        if not self._port.get_option('enable_all_experimental_features'):
     538            cmd.append('--no-enable-all-experimental-features')
     539
    537540        for feature in self._port.experimental_feature():
    538541            cmd.append('--experimental-feature')
  • trunk/Tools/Scripts/webkitpy/port/driver_unittest.py

    r254340 r276559  
    2828
    2929import unittest
     30import optparse
    3031
    3132from webkitpy.common.system.systemhost_mock import MockSystemHost
     
    206207
    207208    def test_no_timeout(self):
    208         port = TestWebKitPort()
     209        port = TestWebKitPort(options=optparse.Values({'enable_all_experimental_features': True}))
    209210        port._config.build_directory = lambda configuration: '/mock-build'
    210211        driver = Driver(port, 0, pixel_tests=True, no_timeout=True)
  • trunk/Tools/WebKitTestRunner/Options.cpp

    r275810 r276559  
    129129}
    130130
     131static bool handleOptionNoEnableAllExperimentalFeatures(Options& options, const char*, const char* feature)
     132{
     133    options.enableAllExperimentalFeatures = false;
     134    return true;
     135}
     136
    131137static bool handleOptionExperimentalFeature(Options& options, const char*, const char* feature)
    132138{
     
    163169    optionList.append(Option("--show-touches", "Show the touches during test runs (for debugging)", handleOptionShowTouches));
    164170    optionList.append(Option("--world-leaks", "Check for leaks of world objects (currently, documents)", handleOptionCheckForWorldLeaks));
     171    optionList.append(Option("--no-enable-all-experimental-features", "Do not enable all experimental features by default", handleOptionNoEnableAllExperimentalFeatures));
    165172    optionList.append(Option("--experimental-feature", "Enable experimental feature", handleOptionExperimentalFeature, true));
    166173    optionList.append(Option("--internal-feature", "Enable internal feature", handleOptionInternalFeature, true));
  • trunk/Tools/WebKitTestRunner/Options.h

    r275810 r276559  
    5050    bool checkForWorldLeaks { false };
    5151    bool allowAnyHTTPSCertificateForAllowedHosts { false };
     52    bool enableAllExperimentalFeatures { true };
    5253    std::vector<std::string> paths;
    5354    std::set<std::string> allowedHosts;
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r276326 r276559  
    534534    m_checkForWorldLeaks = options.checkForWorldLeaks;
    535535    m_allowAnyHTTPSCertificateForAllowedHosts = options.allowAnyHTTPSCertificateForAllowedHosts;
     536    m_enableAllExperimentalFeatures = options.enableAllExperimentalFeatures;
    536537    m_globalFeatures = std::move(options.features);
    537538
     
    882883void TestController::resetPreferencesToConsistentValues(const TestOptions& options)
    883884{
    884     batchUpdatePreferences(platformPreferences(), [options] (auto preferences) {
     885    batchUpdatePreferences(platformPreferences(), [options, enableAllExperimentalFeatures = m_enableAllExperimentalFeatures] (auto preferences) {
    885886        WKPreferencesResetTestRunnerOverrides(preferences);
    886887
    887         WKPreferencesEnableAllExperimentalFeatures(preferences);
     888        if (enableAllExperimentalFeatures)
     889            WKPreferencesEnableAllExperimentalFeatures(preferences);
    888890
    889891        WKPreferencesSetProcessSwapOnNavigationEnabled(preferences, options.shouldEnableProcessSwapOnNavigation());
  • trunk/Tools/WebKitTestRunner/TestController.h

    r276326 r276559  
    540540    bool m_shouldDumpPixelsForAllTests { false };
    541541    bool m_createdOtherPage { false };
     542    bool m_enableAllExperimentalFeatures { true };
    542543    std::vector<std::string> m_paths;
    543544    std::set<std::string> m_allowedHosts;
Note: See TracChangeset for help on using the changeset viewer.