[macOS] DragAndDropTests.ExposeMultipleURLsInDataTransfer fails on macOS versions...
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Sep 2018 21:15:53 +0000 (21:15 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Sep 2018 21:15:53 +0000 (21:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189315

Reviewed by Tim Horton.

Fix the test failure by explicitly enabling custom pasteboard data.

* TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm:
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235689 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm

index 9bb4819..46133fc 100644 (file)
@@ -1,3 +1,15 @@
+2018-09-05  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [macOS] DragAndDropTests.ExposeMultipleURLsInDataTransfer fails on macOS versions prior to Mojave
+        https://bugs.webkit.org/show_bug.cgi?id=189315
+
+        Reviewed by Tim Horton.
+
+        Fix the test failure by explicitly enabling custom pasteboard data.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm:
+        (TEST):
+
 2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>
 
         Added runtime feature flag for web API statistics
index 94b5f70..206709e 100644 (file)
@@ -27,6 +27,7 @@
 
 #import "DragAndDropSimulator.h"
 #import "PlatformUtilities.h"
+#import <WebKit/WKPreferencesPrivate.h>
 
 #if WK_API_ENABLED && ENABLE(DRAG_SUPPORT)
 
@@ -47,6 +48,7 @@ TEST(DragAndDropTests, ExposeMultipleURLsInDataTransfer)
 {
     auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebViewFrame:CGRectMake(0, 0, 320, 500)]);
     auto webView = [simulator webView];
+    WKPreferencesSetCustomPasteboardDataEnabled((WKPreferencesRef)[webView configuration].preferences, true);
     [webView synchronouslyLoadTestPageNamed:@"DataTransfer"];
 
     NSString *stringData = @"Hello world";