Improve HTTP test names in WebKitTestRunner's crash report information
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 May 2016 02:40:50 +0000 (02:40 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 May 2016 02:40:50 +0000 (02:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=157389

Reviewed by Alex Christensen.

* WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm:
(WTR::InjectedBundlePage::platformDidStartProvisionalLoadForFrame): Added a FIXME.

* WebKitTestRunner/cocoa/CrashReporterInfo.mm:
(WTR::testDescription): Don't bail out if the port is neither 8000 nor 8443; we
use other port numbers too. For http tests, return the complete URL string, not
just the path.

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

Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm
Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm

index a7df1bc..c1dae08 100644 (file)
@@ -1,3 +1,18 @@
+2016-05-05  Alexey Proskuryakov  <ap@apple.com>
+
+        Improve HTTP test names in WebKitTestRunner's crash report information
+        https://bugs.webkit.org/show_bug.cgi?id=157389
+
+        Reviewed by Alex Christensen.
+
+        * WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm:
+        (WTR::InjectedBundlePage::platformDidStartProvisionalLoadForFrame): Added a FIXME.
+
+        * WebKitTestRunner/cocoa/CrashReporterInfo.mm:
+        (WTR::testDescription): Don't bail out if the port is neither 8000 nor 8443; we
+        use other port numbers too. For http tests, return the complete URL string, not
+        just the path.
+
 2016-05-04  Alex Christensen  <achristensen@webkit.org>
 
         Blocked redirected main resource requests need descriptive errors
index 4ee46fb..d064461 100644 (file)
@@ -42,6 +42,8 @@ void InjectedBundlePage::platformDidStartProvisionalLoadForFrame(WKBundleFrameRe
     if (!WKBundleFrameIsMainFrame(frame))
         return;
 
+    // FIXME: We should not be changing test URL every time the test navigates. The current URL could be
+    // aditional information, but it shouldn't replace the initial test URL.
     setCrashReportApplicationSpecificInformationToURL(InjectedBundle::singleton().testRunner()->testURL());
 }
 
index 358ccd2..48fe6ee 100644 (file)
@@ -33,7 +33,7 @@
 
 namespace WTR {
 
-static String testPathFromURL(WKURLRef url)
+static String testDescription(WKURLRef url)
 {
     RetainPtr<CFURLRef> cfURL = adoptCF(WKURLCopyCFURL(kCFAllocatorDefault, url));
     if (!cfURL)
@@ -59,18 +59,18 @@ static String testPathFromURL(WKURLRef url)
 
     RetainPtr<CFStringRef> hostCFString = adoptCF(CFURLCopyHostName(cfURL.get()));
     String hostString(hostCFString.get());
-    if (hostString == "127.0.0.1"  && (CFURLGetPortNumber(cfURL.get()) == 8000 || CFURLGetPortNumber(cfURL.get()) == 8443))
-        return pathString;
+    if (hostString != "127.0.0.1")
+        return String();
 
-    return String();
+    return CFURLGetString(cfURL.get());
 }
 
 void setCrashReportApplicationSpecificInformationToURL(WKURLRef url)
 {
-    String testPath = testPathFromURL(url);
-    if (!testPath.isNull()) {
+    String description = testDescription(url);
+    if (!description.isNull()) {
         String message("CRASHING TEST: ");
-        message = message + testPath;
+        message = message + description;
         WKSetCrashReportApplicationSpecificInformation(message.createCFString().get());
     }
 }