Title: [256054] trunk
Revision
256054
Author
dba...@webkit.org
Date
2020-02-07 13:16:57 -0800 (Fri, 07 Feb 2020)

Log Message

Legacy WebKit: Have linkedOnOrAfter() respect the NSDefault WebKitLinkedOnOrAfterEverything and opt DumpRenderTree in
https://bugs.webkit.org/show_bug.cgi?id=207366

Reviewed by Brent Fulgham.

Source/WebKitLegacy/mac:

If the user default WebKitLinkedOnOrAfterEverything is enabled then have linkedOnOrAfter()
always return true.

* Misc/WebKitVersionChecks.mm:
(linkedOnOrAfter): Read the user default WebKitLinkedOnOrAfterEverything once and cache it.
If the default is enabled then early return true. Outside of tooling this default is unlikely
to be set.

Tools:

Enable default WebKitLinkedOnOrAfterEverything in DumpRenderTree just as we do in WebKitTestRunner.
This lets me put test results for Mac and iOS Legacy WebKit in the same cross-platform directory
as the actual test instead of under a platform-specific directory even when the tests' behavior
depends on the link-time version of WebKit.

Note that testing of pre-linked behavior can still be accomplished by test writers by exposing settings
and toggling them in a test.

* DumpRenderTree/mac/DumpRenderTree.mm:
(setDefaultsToConsistentValuesForTesting):

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (256053 => 256054)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-02-07 21:16:21 UTC (rev 256053)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-02-07 21:16:57 UTC (rev 256054)
@@ -1,3 +1,18 @@
+2020-02-07  Daniel Bates  <daba...@apple.com>
+
+        Legacy WebKit: Have linkedOnOrAfter() respect the NSDefault WebKitLinkedOnOrAfterEverything and opt DumpRenderTree in
+        https://bugs.webkit.org/show_bug.cgi?id=207366
+
+        Reviewed by Brent Fulgham.
+
+        If the user default WebKitLinkedOnOrAfterEverything is enabled then have linkedOnOrAfter()
+        always return true.
+
+        * Misc/WebKitVersionChecks.mm:
+        (linkedOnOrAfter): Read the user default WebKitLinkedOnOrAfterEverything once and cache it.
+        If the default is enabled then early return true. Outside of tooling this default is unlikely
+        to be set.
+
 2020-02-07  Sam Weinig  <wei...@apple.com>
 
         Move trivial definitions from FeatureDefines.xcconfig to PlatformEnableCocoa.h

Modified: trunk/Source/WebKitLegacy/mac/Misc/WebKitVersionChecks.mm (256053 => 256054)


--- trunk/Source/WebKitLegacy/mac/Misc/WebKitVersionChecks.mm	2020-02-07 21:16:21 UTC (rev 256053)
+++ trunk/Source/WebKitLegacy/mac/Misc/WebKitVersionChecks.mm	2020-02-07 21:16:57 UTC (rev 256054)
@@ -29,6 +29,7 @@
 #import "WebKitVersionChecks.h"
 
 #import <mach-o/dyld.h>
+#import <mutex>
 
 static int WebKitLinkTimeVersion(void);
 static int overriddenWebKitLinkTimeVersion;
@@ -70,5 +71,13 @@
 
 bool linkedOnOrAfter(SDKVersion sdkVersion)
 {
+    static bool linkedOnOrAfterEverything;
+    static std::once_flag once;
+    std::call_once(once, [] {
+        if ([[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitLinkedOnOrAfterEverything"])
+            linkedOnOrAfterEverything = true;
+    });
+    if (UNLIKELY(linkedOnOrAfterEverything))
+        return true;
     return dyld_get_program_sdk_version() >= static_cast<uint32_t>(sdkVersion);
 }

Modified: trunk/Tools/ChangeLog (256053 => 256054)


--- trunk/Tools/ChangeLog	2020-02-07 21:16:21 UTC (rev 256053)
+++ trunk/Tools/ChangeLog	2020-02-07 21:16:57 UTC (rev 256054)
@@ -1,3 +1,21 @@
+2020-02-07  Daniel Bates  <daba...@apple.com>
+
+        Legacy WebKit: Have linkedOnOrAfter() respect the NSDefault WebKitLinkedOnOrAfterEverything and opt DumpRenderTree in
+        https://bugs.webkit.org/show_bug.cgi?id=207366
+
+        Reviewed by Brent Fulgham.
+
+        Enable default WebKitLinkedOnOrAfterEverything in DumpRenderTree just as we do in WebKitTestRunner.
+        This lets me put test results for Mac and iOS Legacy WebKit in the same cross-platform directory
+        as the actual test instead of under a platform-specific directory even when the tests' behavior
+        depends on the link-time version of WebKit.
+
+        Note that testing of pre-linked behavior can still be accomplished by test writers by exposing settings
+        and toggling them in a test.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (setDefaultsToConsistentValuesForTesting):
+
 2020-02-03  Sam Weinig  <wei...@apple.com>
 
         Move trivial definitions from FeatureDefines.xcconfig to PlatformEnableCocoa.h

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (256053 => 256054)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2020-02-07 21:16:21 UTC (rev 256053)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2020-02-07 21:16:57 UTC (rev 256054)
@@ -1071,6 +1071,7 @@
         WebKitFullScreenEnabledPreferenceKey: @YES,
         WebKitAllowsInlineMediaPlaybackPreferenceKey: @YES,
         WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey: @NO,
+        @"WebKitLinkedOnOrAfterEverything": @YES,
         @"UseWebKitWebInspector": @YES,
 #if !PLATFORM(IOS_FAMILY)
         @"NSPreferredSpellServerLanguage": @"en_US",
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to