Changeset 232733 in webkit
- Timestamp:
- Jun 11, 2018 3:15:05 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r232730 r232733 1 2018-06-11 Mark Lam <mark.lam@apple.com> 2 3 Add support for webkit-test-runner jscOptions in DumpRenderTree and WebKitTestRunner. 4 https://bugs.webkit.org/show_bug.cgi?id=186451 5 <rdar://problem/40875792> 6 7 Reviewed by Tim Horton. 8 9 * js/intl-numberformat-format-to-parts.html: 10 * js/intl-pluralrules.html: 11 * js/script-tests/intl-numberformat-format-to-parts.js: 12 1 13 2018-06-11 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/LayoutTests/js/intl-numberformat-format-to-parts.html
r231867 r232733 1 <!doctype html> 1 <!doctype html><!-- webkit-test-runner [ jscOptions=--useIntlNumberFormatToParts=true ] --> 2 2 <html> 3 3 <head> -
trunk/LayoutTests/js/intl-pluralrules.html
r231047 r232733 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ jscOptions=--useIntlPluralRules=true ] --> 2 2 <html> 3 3 <head> -
trunk/LayoutTests/js/script-tests/intl-numberformat-format-to-parts.js
r231892 r232733 1 1 //@ skip if $hostOS == "windows" or $hostOS == "darwin" or $hostOS == "linux" 2 //@ requireOptions("--useIntlNumberFormatToParts=true") 3 2 4 description("This test checks the behavior of Intl.NumberFormat.prototype.formatToParts as described in the ECMAScript Internationalization API Specification."); 3 5 -
trunk/Source/JavaScriptCore/ChangeLog
r232719 r232733 1 2018-06-11 Mark Lam <mark.lam@apple.com> 2 3 Add support for webkit-test-runner jscOptions in DumpRenderTree and WebKitTestRunner. 4 https://bugs.webkit.org/show_bug.cgi?id=186451 5 <rdar://problem/40875792> 6 7 Reviewed by Tim Horton. 8 9 Enhance setOptions() to be able to take a comma separated options string in 10 addition to white space separated options strings. 11 12 * runtime/Options.cpp: 13 (JSC::isSeparator): 14 (JSC::Options::setOptions): 15 1 16 2018-06-11 Michael Saboff <msaboff@apple.com> 2 17 -
trunk/Source/JavaScriptCore/runtime/Options.cpp
r232719 r232733 600 600 } 601 601 602 static bool isSeparator(char c) 603 { 604 return isASCIISpace(c) || (c == ','); 605 } 606 602 607 bool Options::setOptions(const char* optionsStr) 603 608 { … … 610 615 611 616 while (p < end) { 612 // Skip white space.613 while (p < end && is ASCIISpace(*p))617 // Skip separators (white space or commas). 618 while (p < end && isSeparator(*p)) 614 619 p++; 615 620 if (p == end) … … 638 643 } 639 644 640 // Find next white space.641 while (p < end && !is ASCIISpace(*p))645 // Find next separator (white space or commas). 646 while (p < end && !isSeparator(*p)) 642 647 p++; 643 648 if (!p) -
trunk/Tools/ChangeLog
r232732 r232733 1 2018-06-11 Mark Lam <mark.lam@apple.com> 2 3 Add support for webkit-test-runner jscOptions in DumpRenderTree and WebKitTestRunner. 4 https://bugs.webkit.org/show_bug.cgi?id=186451 5 <rdar://problem/40875792> 6 7 Reviewed by Tim Horton. 8 9 This jscOptions option can be used by a layout test to specify some JSC runtime 10 options needed by the test e.g. by adding something like this to the top of the 11 html file after the DOCTYPE tag: 12 <!-- webkit-test-runner [ jscOptions=--useIntlPluralRules=true ] --> 13 14 If more than one option is needed, the options can be specified as a comma 15 separated string e.g. 16 <!-- webkit-test-runner [ jscOptions=--useIntlPluralRules=true,--useZombieMode=true ] --> 17 18 This only works with JSC options that can be changed at runtime. Not all JSC 19 options can be changed this way as some options are only checked and set once at 20 VM / process initialization time: changing this type of options may have no 21 effect. It's the test writer's responsibility to determine which options are 22 appropriate for with this webkit-test-runner jscOptions option. 23 24 This implementation is a workaround until we can change the run-webkit-tests 25 scripts to parse the option and apply it to a new launch of DRT or WKTR: 26 https://bugs.webkit.org/show_bug.cgi?id=186452 27 28 * DumpRenderTree/TestOptions.cpp: 29 (TestOptions::TestOptions): 30 (TestOptions::webViewIsCompatibleWithOptions const): 31 * DumpRenderTree/TestOptions.h: 32 * DumpRenderTree/mac/DumpRenderTree.mm: 33 (setJSCOptions): 34 (resetWebViewToConsistentStateBeforeTesting): 35 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 36 (WTR::InjectedBundle::didReceiveMessageToPage): 37 * WebKitTestRunner/TestController.cpp: 38 (WTR::TestController::resetStateToConsistentValues): 39 (WTR::updateTestOptionsFromTestHeader): 40 * WebKitTestRunner/TestOptions.h: 41 (WTR::TestOptions::hasSameInitializationOptions const): 42 1 43 2018-06-11 Brady Eidson <beidson@apple.com> 2 44 -
trunk/Tools/DumpRenderTree/TestOptions.cpp
r232559 r232733 1 1 /* 2 * Copyright (C) 2016 Apple Inc. All rights reserved.2 * Copyright (C) 2016-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 104 104 else if (key == "enableColorFilter") 105 105 enableColorFilter = parseBooleanTestHeaderValue(value); 106 else if (key == "jscOptions") 107 jscOptions = value; 106 108 pairStart = pairEnd + 1; 107 109 } … … 110 112 bool TestOptions::webViewIsCompatibleWithOptions(const TestOptions& other) const 111 113 { 112 return other.layerBackedWebView == layerBackedWebView; 114 return other.layerBackedWebView == layerBackedWebView 115 && other.jscOptions == jscOptions; 113 116 } -
trunk/Tools/DumpRenderTree/TestOptions.h
r232559 r232733 1 1 /* 2 * Copyright (C) 2016 Apple Inc. All rights reserved.2 * Copyright (C) 2016-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 44 44 bool allowCrossOriginSubresourcesToAskForCredentials { false }; 45 45 bool enableColorFilter { false }; 46 std::string jscOptions; 46 47 47 48 TestOptions(const std::string& pathOrURL, const std::string& absolutePath); -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r232559 r232733 58 58 #import "WorkQueueItem.h" 59 59 #import <CoreFoundation/CoreFoundation.h> 60 #import <JavaScriptCore/Options.h> 60 61 #import <JavaScriptCore/TestRunnerUtils.h> 61 62 #import <WebCore/LogInitialization.h> … … 97 98 #import <wtf/RetainPtr.h> 98 99 #import <wtf/Threading.h> 100 #import <wtf/text/StringBuilder.h> 99 101 #import <wtf/text/WTFString.h> 100 102 … … 1770 1772 #endif 1771 1773 1774 static void setJSCOptions(const TestOptions& options) 1775 { 1776 static WTF::StringBuilder savedOptions; 1777 1778 if (!savedOptions.isEmpty()) { 1779 JSC::Options::setOptions(savedOptions.toString().ascii().data()); 1780 savedOptions.clear(); 1781 } 1782 1783 if (options.jscOptions.length()) { 1784 JSC::Options::dumpAllOptionsInALine(savedOptions); 1785 JSC::Options::setOptions(options.jscOptions.c_str()); 1786 } 1787 } 1788 1772 1789 static void resetWebViewToConsistentStateBeforeTesting(const TestOptions& options) 1773 1790 { … … 1849 1866 #endif 1850 1867 1868 setJSCOptions(options); 1869 1851 1870 [mainFrame _clearOpener]; 1852 1871 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r231222 r232733 1 1 /* 2 * Copyright (C) 2010-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2010-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 #include "StringFunctions.h" 32 32 #include "WebCoreTestSupport.h" 33 #include <JavaScriptCore/Options.h> 33 34 #include <WebKit/WKBundle.h> 34 35 #include <WebKit/WKBundlePage.h> … … 222 223 ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID()); 223 224 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 225 WKRetainPtr<WKStringRef> jscOptionsKey(AdoptWK, WKStringCreateWithUTF8CString("JSCOptions")); 226 WKRetainPtr<WKStringRef> jscOptionsString = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, jscOptionsKey.get())); 227 if (jscOptionsString) { 228 String options = toWTFString(jscOptionsString); 229 JSC::Options::setOptions(options.utf8().data()); 230 } 224 231 225 232 WKRetainPtr<WKStringRef> shouldGCKey(AdoptWK, WKStringCreateWithUTF8CString("ShouldGC")); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r232732 r232733 1 1 /* 2 * Copyright (C) 2010 , 2014-2017Apple Inc. All rights reserved.2 * Copyright (C) 2010-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 806 806 WKDictionarySetItem(resetMessageBody.get(), allowedHostsKey.get(), allowedHostsValue.get()); 807 807 808 if (options.jscOptions.length()) { 809 WKRetainPtr<WKStringRef> jscOptionsKey = adoptWK(WKStringCreateWithUTF8CString("JSCOptions")); 810 WKRetainPtr<WKStringRef> jscOptionsValue = adoptWK(WKStringCreateWithUTF8CString(options.jscOptions.c_str())); 811 WKDictionarySetItem(resetMessageBody.get(), jscOptionsKey.get(), jscOptionsValue.get()); 812 } 813 808 814 WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), resetMessageBody.get()); 809 815 … … 1080 1086 if (key == "language") 1081 1087 String(value.c_str()).split(",", false, testOptions.overrideLanguages); 1082 if (key == "useThreadedScrolling")1088 else if (key == "useThreadedScrolling") 1083 1089 testOptions.useThreadedScrolling = parseBooleanTestHeaderValue(value); 1084 if (key == "useAcceleratedDrawing")1090 else if (key == "useAcceleratedDrawing") 1085 1091 testOptions.useAcceleratedDrawing = parseBooleanTestHeaderValue(value); 1086 if (key == "useFlexibleViewport")1092 else if (key == "useFlexibleViewport") 1087 1093 testOptions.useFlexibleViewport = parseBooleanTestHeaderValue(value); 1088 if (key == "useDataDetection")1094 else if (key == "useDataDetection") 1089 1095 testOptions.useDataDetection = parseBooleanTestHeaderValue(value); 1090 if (key == "useMockScrollbars")1096 else if (key == "useMockScrollbars") 1091 1097 testOptions.useMockScrollbars = parseBooleanTestHeaderValue(value); 1092 if (key == "needsSiteSpecificQuirks")1098 else if (key == "needsSiteSpecificQuirks") 1093 1099 testOptions.needsSiteSpecificQuirks = parseBooleanTestHeaderValue(value); 1094 if (key == "ignoresViewportScaleLimits")1100 else if (key == "ignoresViewportScaleLimits") 1095 1101 testOptions.ignoresViewportScaleLimits = parseBooleanTestHeaderValue(value); 1096 if (key == "useCharacterSelectionGranularity")1102 else if (key == "useCharacterSelectionGranularity") 1097 1103 testOptions.useCharacterSelectionGranularity = parseBooleanTestHeaderValue(value); 1098 if (key == "enableAttachmentElement")1104 else if (key == "enableAttachmentElement") 1099 1105 testOptions.enableAttachmentElement = parseBooleanTestHeaderValue(value); 1100 if (key == "enableIntersectionObserver")1106 else if (key == "enableIntersectionObserver") 1101 1107 testOptions.enableIntersectionObserver = parseBooleanTestHeaderValue(value); 1102 if (key == "enableMenuItemElement")1108 else if (key == "enableMenuItemElement") 1103 1109 testOptions.enableMenuItemElement = parseBooleanTestHeaderValue(value); 1104 if (key == "enableModernMediaControls")1110 else if (key == "enableModernMediaControls") 1105 1111 testOptions.enableModernMediaControls = parseBooleanTestHeaderValue(value); 1106 if (key == "enablePointerLock")1112 else if (key == "enablePointerLock") 1107 1113 testOptions.enablePointerLock = parseBooleanTestHeaderValue(value); 1108 if (key == "enableWebAuthentication")1114 else if (key == "enableWebAuthentication") 1109 1115 testOptions.enableWebAuthentication = parseBooleanTestHeaderValue(value); 1110 if (key == "enableIsSecureContextAttribute")1116 else if (key == "enableIsSecureContextAttribute") 1111 1117 testOptions.enableIsSecureContextAttribute = parseBooleanTestHeaderValue(value); 1112 if (key == "enableInspectorAdditions")1118 else if (key == "enableInspectorAdditions") 1113 1119 testOptions.enableInspectorAdditions = parseBooleanTestHeaderValue(value); 1114 if (key == "dumpJSConsoleLogInStdErr")1120 else if (key == "dumpJSConsoleLogInStdErr") 1115 1121 testOptions.dumpJSConsoleLogInStdErr = parseBooleanTestHeaderValue(value); 1116 if (key == "applicationManifest")1122 else if (key == "applicationManifest") 1117 1123 testOptions.applicationManifest = parseStringTestHeaderValueAsRelativePath(value, pathOrURL); 1118 if (key == "allowCrossOriginSubresourcesToAskForCredentials")1124 else if (key == "allowCrossOriginSubresourcesToAskForCredentials") 1119 1125 testOptions.allowCrossOriginSubresourcesToAskForCredentials = parseBooleanTestHeaderValue(value); 1120 if (key == "enableWebAnimationsCSSIntegration")1126 else if (key == "enableWebAnimationsCSSIntegration") 1121 1127 testOptions.enableWebAnimationsCSSIntegration = parseBooleanTestHeaderValue(value); 1122 if (key == "enableProcessSwapOnNavigation")1128 else if (key == "enableProcessSwapOnNavigation") 1123 1129 testOptions.enableProcessSwapOnNavigation = parseBooleanTestHeaderValue(value); 1124 if (key == "enableProcessSwapOnWindowOpen")1130 else if (key == "enableProcessSwapOnWindowOpen") 1125 1131 testOptions.enableProcessSwapOnWindowOpen = parseBooleanTestHeaderValue(value); 1126 if (key == "enableColorFilter")1132 else if (key == "enableColorFilter") 1127 1133 testOptions.enableColorFilter = parseBooleanTestHeaderValue(value); 1134 else if (key == "jscOptions") 1135 testOptions.jscOptions = value; 1128 1136 pairStart = pairEnd + 1; 1129 1137 } -
trunk/Tools/WebKitTestRunner/TestOptions.h
r232729 r232733 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 64 64 Vector<String> overrideLanguages; 65 65 std::string applicationManifest; 66 66 std::string jscOptions; 67 67 68 TestOptions(const std::string& pathOrURL); 68 69 … … 93 94 || enableProcessSwapOnNavigation != options.enableProcessSwapOnNavigation 94 95 || enableProcessSwapOnWindowOpen != options.enableProcessSwapOnWindowOpen 95 || enableColorFilter != options.enableColorFilter) 96 || enableColorFilter != options.enableColorFilter 97 || jscOptions != options.jscOptions) 96 98 return false; 97 99
Note: See TracChangeset
for help on using the changeset viewer.