Title: [195474] trunk/Tools
Revision
195474
Author
[email protected]
Date
2016-01-22 14:17:04 -0800 (Fri, 22 Jan 2016)

Log Message

Add support for testing data detection.
https://bugs.webkit.org/show_bug.cgi?id=153360

Reviewed by Tim Horton.

Adding a new testing option (useDataDetection) to turn on
data detection when running the a test.

* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (195473 => 195474)


--- trunk/Tools/ChangeLog	2016-01-22 22:12:59 UTC (rev 195473)
+++ trunk/Tools/ChangeLog	2016-01-22 22:17:04 UTC (rev 195474)
@@ -1,3 +1,19 @@
+2016-01-22  Enrica Casucci  <[email protected]>
+
+        Add support for testing data detection.
+        https://bugs.webkit.org/show_bug.cgi?id=153360
+
+        Reviewed by Tim Horton.
+
+        Adding a new testing option (useDataDetection) to turn on
+        data detection when running the a test.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::updateTestOptionsFromTestHeader):
+        * WebKitTestRunner/TestOptions.h:
+        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+        (WTR::TestController::platformCreateWebView):
+
 2016-01-21  Simon Fraser  <[email protected]>
 
         Fix the lldb WebCoreLayoutUnitProvider to not dynamically look up the LayoutUnit denominator

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (195473 => 195474)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2016-01-22 22:12:59 UTC (rev 195473)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2016-01-22 22:17:04 UTC (rev 195474)
@@ -917,6 +917,8 @@
             testOptions.useThreadedScrolling = parseBooleanTestHeaderValue(value);
         if (key == "useFlexibleViewport")
             testOptions.useFlexibleViewport = parseBooleanTestHeaderValue(value);
+        if (key == "useDataDetection")
+            testOptions.useDataDetection = parseBooleanTestHeaderValue(value);
         pairStart = pairEnd + 1;
     }
 }

Modified: trunk/Tools/WebKitTestRunner/TestOptions.h (195473 => 195474)


--- trunk/Tools/WebKitTestRunner/TestOptions.h	2016-01-22 22:12:59 UTC (rev 195473)
+++ trunk/Tools/WebKitTestRunner/TestOptions.h	2016-01-22 22:17:04 UTC (rev 195474)
@@ -39,6 +39,7 @@
     bool useFixedLayout { false };
     bool isSVGTest { false };
     bool isHiDPITest { false };
+    bool useDataDetection { false };
 
     Vector<String> overrideLanguages;
     

Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (195473 => 195474)


--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2016-01-22 22:12:59 UTC (rev 195473)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2016-01-22 22:17:04 UTC (rev 195474)
@@ -79,7 +79,11 @@
 
 void TestController::platformCreateWebView(WKPageConfigurationRef, const TestOptions& options)
 {
-    m_mainWebView = std::make_unique<PlatformWebView>(globalWebViewConfiguration, options);
+    RetainPtr<WKWebViewConfiguration> copiedConfiguration = adoptNS([globalWebViewConfiguration copy]);
+    if (options.useDataDetection)
+        [copiedConfiguration setDataDetectorTypes:WKDataDetectorTypeAll];
+
+    m_mainWebView = std::make_unique<PlatformWebView>(copiedConfiguration.get(), options);
 }
 
 PlatformWebView* TestController::platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const TestOptions& options)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to