Title: [210517] trunk/Tools
Revision
210517
Author
[email protected]
Date
2017-01-09 11:34:48 -0800 (Mon, 09 Jan 2017)

Log Message

Support webkit-test-runner key-value pairs in http tests in DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=166837

Patch by Antoine Quint <[email protected]> on 2017-01-09
Reviewed by Alex Christensen.

We now correctly handle the --absolutePath argument in DumpRenderTree and use
the provided value when trying to determine the path to the test file. Failing
that, we use the computed URL or the raw path provided to cover all cases.

This was tested in the context of https://bugs.webkit.org/show_bug.cgi?id=165668
by applying this patch and seeing the number test failures dramatically reduced
with WK1 due to the option to turn modern media controls off for older media controls
tests.

* DumpRenderTree/DumpRenderTree.h:
* DumpRenderTree/DumpRenderTreeCommon.cpp:
(parseInputLine):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (210516 => 210517)


--- trunk/Tools/ChangeLog	2017-01-09 19:09:23 UTC (rev 210516)
+++ trunk/Tools/ChangeLog	2017-01-09 19:34:48 UTC (rev 210517)
@@ -1,3 +1,28 @@
+2017-01-09  Antoine Quint  <[email protected]>
+
+        Support webkit-test-runner key-value pairs in http tests in DumpRenderTree
+        https://bugs.webkit.org/show_bug.cgi?id=166837
+
+        Reviewed by Alex Christensen.
+
+        We now correctly handle the --absolutePath argument in DumpRenderTree and use
+        the provided value when trying to determine the path to the test file. Failing
+        that, we use the computed URL or the raw path provided to cover all cases.
+        
+        This was tested in the context of https://bugs.webkit.org/show_bug.cgi?id=165668
+        by applying this patch and seeing the number test failures dramatically reduced
+        with WK1 due to the option to turn modern media controls off for older media controls
+        tests.
+
+        * DumpRenderTree/DumpRenderTree.h:
+        * DumpRenderTree/DumpRenderTreeCommon.cpp:
+        (parseInputLine):
+        * DumpRenderTree/TestOptions.h:
+        * DumpRenderTree/TestOptions.mm:
+        (TestOptions::TestOptions):
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (runTest):
+
 2017-01-09  Milan Crha  <[email protected]>
 
         prepare-ChangeLog: Correct help string for --style option

Modified: trunk/Tools/DumpRenderTree/DumpRenderTree.h (210516 => 210517)


--- trunk/Tools/DumpRenderTree/DumpRenderTree.h	2017-01-09 19:09:23 UTC (rev 210516)
+++ trunk/Tools/DumpRenderTree/DumpRenderTree.h	2017-01-09 19:34:48 UTC (rev 210517)
@@ -58,6 +58,7 @@
 
 struct TestCommand {
     std::string pathOrURL;
+    std::string absolutePath;
     bool shouldDumpPixels { false };
     std::string expectedPixelHash;
     int timeout { 30000 }; // in ms

Modified: trunk/Tools/DumpRenderTree/DumpRenderTreeCommon.cpp (210516 => 210517)


--- trunk/Tools/DumpRenderTree/DumpRenderTreeCommon.cpp	2017-01-09 19:09:23 UTC (rev 210516)
+++ trunk/Tools/DumpRenderTree/DumpRenderTreeCommon.cpp	2017-01-09 19:34:48 UTC (rev 210517)
@@ -105,7 +105,7 @@
         } else if (arg == "--dump-jsconsolelog-in-stderr")
             result.dumpJSConsoleLogInStdErr = true;
         else if (arg == std::string("--absolutePath"))
-            tokenizer.next();
+            result.absolutePath = tokenizer.next();
         else
             die(inputLine);
     }

Modified: trunk/Tools/DumpRenderTree/TestOptions.h (210516 => 210517)


--- trunk/Tools/DumpRenderTree/TestOptions.h	2017-01-09 19:09:23 UTC (rev 210516)
+++ trunk/Tools/DumpRenderTree/TestOptions.h	2017-01-09 19:34:48 UTC (rev 210517)
@@ -24,6 +24,7 @@
  */
 
 #pragma once
+#include "DumpRenderTree.h"
 
 @class NSURL;
 
@@ -32,5 +33,5 @@
     bool enableModernMediaControls { false };
     bool enablePointerLock { false };
 
-    TestOptions(NSURL *testURL);
+    TestOptions(NSURL*, const TestCommand&);
 };

Modified: trunk/Tools/DumpRenderTree/TestOptions.mm (210516 => 210517)


--- trunk/Tools/DumpRenderTree/TestOptions.mm	2017-01-09 19:09:23 UTC (rev 210516)
+++ trunk/Tools/DumpRenderTree/TestOptions.mm	2017-01-09 19:34:48 UTC (rev 210517)
@@ -41,13 +41,17 @@
     return false;
 }
 
-TestOptions::TestOptions(NSURL *testURL)
+TestOptions::TestOptions(NSURL *testURL, const TestCommand& command)
 {
-    if (![testURL isFileURL])
+    std::string path = command.absolutePath;
+    if (path.empty() && [testURL isFileURL])
+        path = [testURL fileSystemRepresentation];
+    else
+        path = command.pathOrURL;
+
+    if (path.empty())
         return;
 
-    std::string path = [testURL fileSystemRepresentation];
-
     std::string options;
     std::ifstream testFile(path.data());
     if (!testFile.good())

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (210516 => 210517)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2017-01-09 19:09:23 UTC (rev 210516)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2017-01-09 19:34:48 UTC (rev 210517)
@@ -1990,7 +1990,7 @@
     NSString *informationString = [@"CRASHING TEST: " stringByAppendingString:testPath];
     WKSetCrashReportApplicationSpecificInformation((CFStringRef)informationString);
 
-    TestOptions options(url);
+    TestOptions options(url, command);
     resetWebViewToConsistentStateBeforeTesting(options);
 
     const char* testURL([[url absoluteString] UTF8String]);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to