Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Testing] Support configuring any preference from test headers for We…
…bKitTestRunner https://bugs.webkit.org/show_bug.cgi?id=217645 Reviewed by Tim Horton. Support using any preference defined in any of the WebPreference*.yaml configuration files as a test header command rather than limiting it to a hard coded subset by generating the list of supported commands and their types from the yaml files themselves. This currently only works for WebKitTestRunner, but will be made to work with DumpRenderTree in subsequent changes. * WebKitTestRunner/CMakeLists.txt: * WebKitTestRunner/Configurations/Base.xcconfig: * WebKitTestRunner/DerivedSources-input.xcfilelist: * WebKitTestRunner/DerivedSources-output.xcfilelist: * WebKitTestRunner/DerivedSources.make: * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: * WebKitTestRunner/Scripts/PreferencesTemplates: Added. * WebKitTestRunner/Scripts/PreferencesTemplates/TestOptionsGeneratedKeys.h.erb: Added. Add generation of TestOptionsGeneratedKeys.h from the WebPreference*.yaml using the shared GeneratePreferences.rb script in WTF. * WebKitTestRunner/TestController.cpp: (WTR::TestController::resetPreferencesToConsistentValues): Move preference setting to the bottom of the file to allow any preference to be overriden. Also adds in support for double, uint32_t, and string preferences though none of those are currently being used. * WebKitTestRunner/TestOptions.cpp: (WTR::TestOptions::keyTypeMapping): Use generated macro GENERATED_WEB_PREFERENCE_KEY_TYPE_MAPPINGS rather than hardcoding all the preferences types. * WebKitTestRunner/TestOptions.h: (WTR::TestOptions::boolWebPreferenceFeatures const): (WTR::TestOptions::doubleWebPreferenceFeatures const): (WTR::TestOptions::uint32WebPreferenceFeatures const): (WTR::TestOptions::stringWebPreferenceFeatures const): Expose accessors for preferences values for use in setting the actual preference values. Rather than setting all preferences, we now only set preferences that have been explicitly requested, using the default value for any that have not. Canonical link: https://commits.webkit.org/230566@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
12 changed files
with
298 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
Tools/WebKitTestRunner/Scripts/PreferencesTemplates/TestOptionsGeneratedKeys.h.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* <%= @warning %> | ||
* | ||
* Copyright (C) 2020 Apple Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS | ||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#define GENERATED_WEB_PREFERENCE_KEY_TYPE_MAPPINGS \ | ||
<%- for @pref in @preferences do -%> | ||
{ "<%= @pref.name %>", TestHeaderKeyType::<%= @pref.typeUpper %>WebPreference }, \ | ||
<%- end -%> | ||
\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.