<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[176677] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/176677">176677</a></dd>
<dt>Author</dt> <dd>ap@apple.com</dd>
<dt>Date</dt> <dd>2014-12-02 11:30:58 -0800 (Tue, 02 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Mac, iOS] Crash log application information contains latest main frame URL instead of test URL
https://bugs.webkit.org/show_bug.cgi?id=139174

Reviewed by Simon Fraser.

* DumpRenderTree/TestRunner.cpp:
* DumpRenderTree/TestRunner.h:
Renamed testPathOrURL to testURL, because this variable always contains a URL.

* DumpRenderTree/mac/DumpRenderTree.mm:
(sizeWebViewForCurrentTest): Updated for testPathOrURL renaming.
(testPathFromURL): Moved from FrameLoadDelegate.mm.
(runTest): Set crash reporter information here, as we know the exact test URL.

* DumpRenderTree/mac/FrameLoadDelegate.mm:
(-[FrameLoadDelegate webView:didStartProvisionalLoadForFrame:]): Don't set crash
reporter information here.

* DumpRenderTree/mac/ResourceLoadDelegate.mm:
* DumpRenderTree/mac/TestRunnerMac.mm:
Updated for testPathOrURL renaming.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didStartProvisionalLoadForFrame): WebProcess doesn't know
test URL until load starts, so save it into TestRunner now. A new TestRunner object
is created for each test.

* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::testURL):
(WTR::TestRunner::setTestURL):
Make TestRunner know the test name. For now, it's good enough to have it once load
starts, but if we ever need it earlier, we can send it with BeginTest message.

* WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm:
(WTR::InjectedBundlePage::platformDidStartProvisionalLoadForFrame):
Use test URL, not currently loading URL for CrashReporter.

* WebKitTestRunner/cocoa/CrashReporterInfo.mm:
(WTR::setCrashReportApplicationSpecificInformationToURL): Added a space after colon
(WebKit1 already had it right).

* DumpRenderTree/win/DumpRenderTree.cpp:
(sizeWebViewForCurrentTest):
(runTest):
* DumpRenderTree/win/ResourceLoadDelegate.cpp:
(ResourceLoadDelegate::willSendRequest):
Changed Windows DumpRenderTree to also use URL in TestRunner.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeTestRunnercpp">trunk/Tools/DumpRenderTree/TestRunner.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeTestRunnerh">trunk/Tools/DumpRenderTree/TestRunner.h</a></li>
<li><a href="#trunkToolsDumpRenderTreemacDumpRenderTreemm">trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacFrameLoadDelegatemm">trunk/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacResourceLoadDelegatemm">trunk/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacTestRunnerMacmm">trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreewinDumpRenderTreecpp">trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinResourceLoadDelegatecpp">trunk/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlePagecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlecocoaInjectedBundlePageCocoamm">trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnercocoaCrashReporterInfomm">trunk/Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/ChangeLog        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2014-12-02  Alexey Proskuryakov  &lt;ap@apple.com&gt;
+
+        [Mac, iOS] Crash log application information contains latest main frame URL instead of test URL
+        https://bugs.webkit.org/show_bug.cgi?id=139174
+
+        Reviewed by Simon Fraser.
+
+        * DumpRenderTree/TestRunner.cpp:
+        * DumpRenderTree/TestRunner.h:
+        Renamed testPathOrURL to testURL, because this variable always contains a URL.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (sizeWebViewForCurrentTest): Updated for testPathOrURL renaming.
+        (testPathFromURL): Moved from FrameLoadDelegate.mm.
+        (runTest): Set crash reporter information here, as we know the exact test URL.
+
+        * DumpRenderTree/mac/FrameLoadDelegate.mm:
+        (-[FrameLoadDelegate webView:didStartProvisionalLoadForFrame:]): Don't set crash
+        reporter information here.
+
+        * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+        * DumpRenderTree/mac/TestRunnerMac.mm:
+        Updated for testPathOrURL renaming.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame): WebProcess doesn't know
+        test URL until load starts, so save it into TestRunner now. A new TestRunner object
+        is created for each test.
+
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+        (WTR::TestRunner::testURL):
+        (WTR::TestRunner::setTestURL):
+        Make TestRunner know the test name. For now, it's good enough to have it once load
+        starts, but if we ever need it earlier, we can send it with BeginTest message.
+
+        * WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm:
+        (WTR::InjectedBundlePage::platformDidStartProvisionalLoadForFrame):
+        Use test URL, not currently loading URL for CrashReporter.
+
+        * WebKitTestRunner/cocoa/CrashReporterInfo.mm:
+        (WTR::setCrashReportApplicationSpecificInformationToURL): Added a space after colon
+        (WebKit1 already had it right).
+
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (sizeWebViewForCurrentTest):
+        (runTest):
+        * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+        (ResourceLoadDelegate::willSendRequest):
+        Changed Windows DumpRenderTree to also use URL in TestRunner.
+
</ins><span class="cx"> 2014-12-02  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] run-webkit-tests records most DumpRenderTree.app crashes as time-outs
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/TestRunner.cpp (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/TestRunner.cpp        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/DumpRenderTree/TestRunner.cpp        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> const unsigned TestRunner::w3cSVGViewWidth = 480;
</span><span class="cx"> const unsigned TestRunner::w3cSVGViewHeight = 360;
</span><span class="cx"> 
</span><del>-TestRunner::TestRunner(const std::string&amp; testPathOrURL, const std::string&amp; expectedPixelHash)
</del><ins>+TestRunner::TestRunner(const std::string&amp; testURL, const std::string&amp; expectedPixelHash)
</ins><span class="cx">     : m_disallowIncreaseForApplicationCacheQuota(false)
</span><span class="cx">     , m_dumpApplicationCacheDelegateCallbacks(false)
</span><span class="cx">     , m_dumpAsAudio(false)
</span><span class="lines">@@ -112,15 +112,15 @@
</span><span class="cx">     , m_hasPendingWebNotificationClick(false)
</span><span class="cx">     , m_databaseDefaultQuota(-1)
</span><span class="cx">     , m_databaseMaxQuota(-1)
</span><del>-    , m_testPathOrURL(testPathOrURL)
</del><ins>+    , m_testURL(testURL)
</ins><span class="cx">     , m_expectedPixelHash(expectedPixelHash)
</span><span class="cx">     , m_titleTextDirection(&quot;ltr&quot;)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;TestRunner&gt; TestRunner::create(const std::string&amp; testPathOrURL, const std::string&amp; expectedPixelHash)
</del><ins>+PassRefPtr&lt;TestRunner&gt; TestRunner::create(const std::string&amp; testURL, const std::string&amp; expectedPixelHash)
</ins><span class="cx"> {
</span><del>-    return adoptRef(new TestRunner(testPathOrURL, expectedPixelHash));
</del><ins>+    return adoptRef(new TestRunner(testURL, expectedPixelHash));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Static Functions
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeTestRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/TestRunner.h (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/TestRunner.h        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/DumpRenderTree/TestRunner.h        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> 
</span><span class="cx"> class TestRunner : public RefCounted&lt;TestRunner&gt; {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;TestRunner&gt; create(const std::string&amp; testPathOrURL, const std::string&amp; expectedPixelHash);
</del><ins>+    static PassRefPtr&lt;TestRunner&gt; create(const std::string&amp; testURL, const std::string&amp; expectedPixelHash);
</ins><span class="cx"> 
</span><span class="cx">     static const unsigned viewWidth;
</span><span class="cx">     static const unsigned viewHeight;
</span><span class="lines">@@ -285,7 +285,7 @@
</span><span class="cx">     bool useDeferredFrameLoading() const { return m_useDeferredFrameLoading; }
</span><span class="cx">     void setUseDeferredFrameLoading(bool flag) { m_useDeferredFrameLoading = flag; }
</span><span class="cx"> 
</span><del>-    const std::string&amp; testPathOrURL() const { return m_testPathOrURL; }
</del><ins>+    const std::string&amp; testURL() const { return m_testURL; }
</ins><span class="cx">     const std::string&amp; expectedPixelHash() const { return m_expectedPixelHash; }
</span><span class="cx"> 
</span><span class="cx">     const std::vector&lt;char&gt;&amp; audioResult() const { return m_audioResult; }
</span><span class="lines">@@ -357,7 +357,7 @@
</span><span class="cx">     bool hasPendingWebNotificationClick() const { return m_hasPendingWebNotificationClick; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    TestRunner(const std::string&amp; testPathOrURL, const std::string&amp; expectedPixelHash);
</del><ins>+    TestRunner(const std::string&amp; testURL, const std::string&amp; expectedPixelHash);
</ins><span class="cx"> 
</span><span class="cx">     void setGeolocationPermissionCommon(bool allow);
</span><span class="cx"> 
</span><span class="lines">@@ -418,7 +418,7 @@
</span><span class="cx"> 
</span><span class="cx">     std::string m_authenticationUsername;
</span><span class="cx">     std::string m_authenticationPassword; 
</span><del>-    std::string m_testPathOrURL;
</del><ins>+    std::string m_testURL;
</ins><span class="cx">     std::string m_expectedPixelHash; // empty string if no hash
</span><span class="cx">     std::string m_titleTextDirection;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacDumpRenderTreemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> #import &quot;FrameLoadDelegate.h&quot;
</span><span class="cx"> #import &quot;HistoryDelegate.h&quot;
</span><span class="cx"> #import &quot;JavaScriptThreading.h&quot;
</span><del>-#import &quot;TestRunner.h&quot;
</del><span class="cx"> #import &quot;MockGeolocationProvider.h&quot;
</span><span class="cx"> #import &quot;MockWebNotificationProvider.h&quot;
</span><span class="cx"> #import &quot;NavigationController.h&quot;
</span><span class="lines">@@ -51,6 +50,7 @@
</span><span class="cx"> #import &quot;PolicyDelegate.h&quot;
</span><span class="cx"> #import &quot;ResourceLoadDelegate.h&quot;
</span><span class="cx"> #import &quot;StorageTrackerDelegate.h&quot;
</span><ins>+#import &quot;TestRunner.h&quot;
</ins><span class="cx"> #import &quot;UIDelegate.h&quot;
</span><span class="cx"> #import &quot;WebArchiveDumpSupport.h&quot;
</span><span class="cx"> #import &quot;WebCoreTestSupport.h&quot;
</span><span class="lines">@@ -68,8 +68,8 @@
</span><span class="cx"> #import &lt;WebKit/WebCoreStatistics.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebDataSourcePrivate.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebDatabaseManagerPrivate.h&gt;
</span><ins>+#import &lt;WebKit/WebDeviceOrientationProviderMock.h&gt;
</ins><span class="cx"> #import &lt;WebKit/WebDocumentPrivate.h&gt;
</span><del>-#import &lt;WebKit/WebDeviceOrientationProviderMock.h&gt;
</del><span class="cx"> #import &lt;WebKit/WebEditingDelegate.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebFrameView.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebHistory.h&gt;
</span><span class="lines">@@ -77,19 +77,20 @@
</span><span class="cx"> #import &lt;WebKit/WebInspector.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebKitNSStringExtras.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebPluginDatabase.h&gt;
</span><ins>+#import &lt;WebKit/WebPreferenceKeysPrivate.h&gt;
</ins><span class="cx"> #import &lt;WebKit/WebPreferences.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebPreferencesPrivate.h&gt;
</span><del>-#import &lt;WebKit/WebPreferenceKeysPrivate.h&gt;
</del><span class="cx"> #import &lt;WebKit/WebResourceLoadDelegate.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebStorageManagerPrivate.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebViewPrivate.h&gt;
</span><ins>+#import &lt;WebKitSystemInterface.h&gt;
</ins><span class="cx"> #import &lt;getopt.h&gt;
</span><span class="cx"> #import &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #import &lt;wtf/FastMalloc.h&gt;
</span><ins>+#import &lt;wtf/ObjcRuntimeExtras.h&gt;
+#import &lt;wtf/OwnPtr.h&gt;
</ins><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #import &lt;wtf/Threading.h&gt;
</span><del>-#import &lt;wtf/ObjcRuntimeExtras.h&gt;
-#import &lt;wtf/OwnPtr.h&gt;
</del><span class="cx"> #import &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="lines">@@ -98,6 +99,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+#import &quot;DumpRenderTreeBrowserView.h&quot;
</ins><span class="cx"> #import &lt;CoreGraphics/CGFontDB.h&gt;
</span><span class="cx"> #import &lt;QuartzCore/QuartzCore.h&gt;
</span><span class="cx"> #import &lt;UIKit/UIApplication_Private.h&gt;
</span><span class="lines">@@ -109,7 +111,6 @@
</span><span class="cx"> #import &lt;WebKit/WebCoreThreadRun.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebDOMOperations.h&gt;
</span><span class="cx"> #import &lt;fcntl.h&gt;
</span><del>-#import &quot;DumpRenderTreeBrowserView.h&quot;
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> extern &quot;C&quot; {
</span><span class="lines">@@ -154,7 +155,7 @@
</span><span class="cx"> @end
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-static void runTest(const string&amp; testPathOrURL);
</del><ins>+static void runTest(const string&amp; testURL);
</ins><span class="cx"> static void dumpTestResults();
</span><span class="cx"> 
</span><span class="cx"> // Deciding when it's OK to dump out the state is a bit tricky.  All these must be true:
</span><span class="lines">@@ -1511,7 +1512,7 @@
</span><span class="cx">     [uiDelegate resetWindowOrigin];
</span><span class="cx"> 
</span><span class="cx">     // W3C SVG tests expect to be 480x360
</span><del>-    bool isSVGW3CTest = (gTestRunner-&gt;testPathOrURL().find(&quot;svg/W3C-SVG-1.1&quot;) != string::npos);
</del><ins>+    bool isSVGW3CTest = (gTestRunner-&gt;testURL().find(&quot;svg/W3C-SVG-1.1&quot;) != string::npos);
</ins><span class="cx">     if (isSVGW3CTest)
</span><span class="cx">         [[mainFrame webView] setFrameSize:NSMakeSize(TestRunner::w3cSVGViewWidth, TestRunner::w3cSVGViewHeight)];
</span><span class="cx">     else
</span><span class="lines">@@ -1801,6 +1802,27 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+static NSString *testPathFromURL(NSURL* url)
+{
+    if ([url isFileURL]) {
+        NSString *filePath = [url path];
+        NSRange layoutTestsRange = [filePath rangeOfString:@&quot;/LayoutTests/&quot;];
+        if (layoutTestsRange.location == NSNotFound)
+            return nil;
+
+        return [filePath substringFromIndex:NSMaxRange(layoutTestsRange)];
+    }
+    
+    // HTTP test URLs look like: http://127.0.0.1:8000/inspector/resource-tree/resource-request-content-after-loading-and-clearing-cache.html
+    if (![[url scheme] isEqualToString:@&quot;http&quot;] &amp;&amp; ![[url scheme] isEqualToString:@&quot;https&quot;])
+        return nil;
+
+    if ([[url host] isEqualToString:@&quot;127.0.0.1&quot;] &amp;&amp; ([[url port] intValue] == 8000 || [[url port] intValue] == 8443))
+        return [url path];
+
+    return nil;
+}
+
</ins><span class="cx"> static void runTest(const string&amp; inputLine)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!inputLine.empty());
</span><span class="lines">@@ -1825,6 +1847,12 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    NSString *testPath = testPathFromURL(url);
+    if (!testPath)
+        testPath = [url absoluteString];
+    NSString *informationString = [@&quot;CRASHING TEST: &quot; stringByAppendingString:testPath];
+    WKSetCrashReportApplicationSpecificInformation((CFStringRef)informationString);
+
</ins><span class="cx">     const char* testURL([[url absoluteString] UTF8String]);
</span><span class="cx">     
</span><span class="cx">     resetWebViewToConsistentStateBeforeTesting();
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacFrameLoadDelegatemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -44,7 +44,6 @@
</span><span class="cx"> #import &quot;WorkQueueItem.h&quot;
</span><span class="cx"> #import &lt;Foundation/NSNotification.h&gt;
</span><span class="cx"> #import &lt;JavaScriptCore/JavaScriptCore.h&gt;
</span><del>-#import &lt;WebKitSystemInterface.h&gt;
</del><span class="cx"> #import &lt;WebKit/WebFramePrivate.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebHTMLViewPrivate.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebKit.h&gt;
</span><span class="lines">@@ -170,37 +169,10 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static NSString *testPathFromURL(NSURL* url)
-{
-    if ([url isFileURL]) {
-        NSString *filePath = [url path];
-        NSRange layoutTestsRange = [filePath rangeOfString:@&quot;/LayoutTests/&quot;];
-        if (layoutTestsRange.location == NSNotFound)
-            return nil;
-            
-        return [filePath substringFromIndex:NSMaxRange(layoutTestsRange)];
-    }
-    
-    // HTTP test URLs look like: http://127.0.0.1:8000/inspector/resource-tree/resource-request-content-after-loading-and-clearing-cache.html
-    if (![[url scheme] isEqualToString:@&quot;http&quot;] &amp;&amp; ![[url scheme] isEqualToString:@&quot;https&quot;])
-        return nil;
-
-    if ([[url host] isEqualToString:@&quot;127.0.0.1&quot;] &amp;&amp; ([[url port] intValue] == 8000 || [[url port] intValue] == 8443))
-        return [url path];
-
-    return nil;
-}
-
</del><span class="cx"> - (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame
</span><span class="cx"> {
</span><span class="cx">     ASSERT([frame provisionalDataSource]);
</span><span class="cx"> 
</span><del>-    if (!done &amp;&amp; [[sender mainFrame] isEqual:frame]) {
-        NSURL *provisionalLoadURL = [[[frame provisionalDataSource] initialRequest] URL];
-        if (NSString *testPath = testPathFromURL(provisionalLoadURL))
-            WKSetCrashReportApplicationSpecificInformation((CFStringRef)[@&quot;CRASHING TEST: &quot; stringByAppendingString:testPath]);
-    }
-
</del><span class="cx">     if (!done &amp;&amp; gTestRunner-&gt;dumpFrameLoadCallbacks()) {
</span><span class="cx">         NSString *string = [NSString stringWithFormat:@&quot;%@ - didStartProvisionalLoadForFrame&quot;, [frame _drt_descriptionSuitableForTestResult]];
</span><span class="cx">         printf (&quot;%s\n&quot;, [string UTF8String]);
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacResourceLoadDelegatemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -160,11 +160,11 @@
</span><span class="cx">     NSURL *url = [request URL];
</span><span class="cx">     NSString *host = [url host];
</span><span class="cx">     if (host &amp;&amp; (NSOrderedSame == [[url scheme] caseInsensitiveCompare:@&quot;http&quot;] || NSOrderedSame == [[url scheme] caseInsensitiveCompare:@&quot;https&quot;])) {
</span><del>-        NSString *testPathOrURL = [NSString stringWithUTF8String:gTestRunner-&gt;testPathOrURL().c_str()];
-        NSString *lowercaseTestPathOrURL = [testPathOrURL lowercaseString];
</del><ins>+        NSString *testURL = [NSString stringWithUTF8String:gTestRunner-&gt;testURL().c_str()];
+        NSString *lowercaseTestURL = [testURL lowercaseString];
</ins><span class="cx">         NSString *testHost = 0;
</span><del>-        if ([lowercaseTestPathOrURL hasPrefix:@&quot;http:&quot;] || [lowercaseTestPathOrURL hasPrefix:@&quot;https:&quot;])
-            testHost = [[NSURL URLWithString:testPathOrURL] host];
</del><ins>+        if ([lowercaseTestURL hasPrefix:@&quot;http:&quot;] || [lowercaseTestURL hasPrefix:@&quot;https:&quot;])
+            testHost = [[NSURL URLWithString:testURL] host];
</ins><span class="cx">         if (!isLocalhost(host) &amp;&amp; !hostIsUsedBySomeTestsToGenerateError(host) &amp;&amp; (!testHost || isLocalhost(testHost))) {
</span><span class="cx">             printf(&quot;Blocked access to external URL %s\n&quot;, [[url absoluteString] cStringUsingEncoding:NSUTF8StringEncoding]);
</span><span class="cx">             return nil;
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacTestRunnerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -326,7 +326,7 @@
</span><span class="cx">     return indexOfSearchKeyStart + searchKey.length() - 1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline std::string resourceRootAbsolutePath(const std::string&amp; testPathOrURL, const std::string&amp; expectedRootName)
</del><ins>+static inline std::string resourceRootAbsolutePath(const std::string&amp; testURL, const std::string&amp; expectedRootName)
</ins><span class="cx"> {
</span><span class="cx">     char* localResourceRootEnv = getenv(&quot;LOCAL_RESOURCE_ROOT&quot;);
</span><span class="cx">     if (localResourceRootEnv)
</span><span class="lines">@@ -334,7 +334,7 @@
</span><span class="cx"> 
</span><span class="cx">     // This fallback approach works for non-http tests and is useful
</span><span class="cx">     // in the case when we're running DRT directly from the command line.
</span><del>-    return testPathOrURL.substr(0, indexOfSeparatorAfterDirectoryName(expectedRootName, testPathOrURL));
</del><ins>+    return testURL.substr(0, indexOfSeparatorAfterDirectoryName(expectedRootName, testURL));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef localResourceJSString)
</span><span class="lines">@@ -349,7 +349,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (localResourceString.find(&quot;LayoutTests&quot;) != std::string::npos) {
</span><span class="cx">         expectedRootName = &quot;LayoutTests&quot;;
</span><del>-        absolutePathToResourceRoot = resourceRootAbsolutePath(m_testPathOrURL, expectedRootName);
</del><ins>+        absolutePathToResourceRoot = resourceRootAbsolutePath(m_testURL, expectedRootName);
</ins><span class="cx">     } else if (localResourceString.find(&quot;tmp&quot;) != std::string::npos) {
</span><span class="cx">         expectedRootName = &quot;tmp&quot;;
</span><span class="cx">         absolutePathToResourceRoot = getenv(&quot;DUMPRENDERTREE_TEMP&quot;);
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinDumpRenderTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -887,7 +887,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void sizeWebViewForCurrentTest()
</span><span class="cx"> {
</span><del>-    bool isSVGW3CTest = (gTestRunner-&gt;testPathOrURL().find(&quot;svg\\W3C-SVG-1.1&quot;) != string::npos);
</del><ins>+    bool isSVGW3CTest = (gTestRunner-&gt;testURL().find(&quot;svg\\W3C-SVG-1.1&quot;) != string::npos);
</ins><span class="cx">     unsigned width;
</span><span class="cx">     unsigned height;
</span><span class="cx">     if (isSVGW3CTest) {
</span><span class="lines">@@ -993,6 +993,8 @@
</span><span class="cx"> 
</span><span class="cx">     str = CFURLGetString(url);
</span><span class="cx"> 
</span><ins>+    CFRelease(url);
+
</ins><span class="cx">     CFIndex length = CFStringGetLength(str);
</span><span class="cx">     UniChar* buffer = new UniChar[length + 1];
</span><span class="cx"> 
</span><span class="lines">@@ -1003,12 +1005,16 @@
</span><span class="cx">     ASSERT(urlBStr.length() == length);
</span><span class="cx">     delete[] buffer;
</span><span class="cx"> 
</span><del>-    CFRelease(url);
</del><ins>+    CFIndex maximumURLLengthAsUTF8 = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
+    char* testURL = new char[];
+    CFStringGetCString(str, testURL, maximumURLLengthAsUTF8, kCFStringEncodingUTF8);
</ins><span class="cx"> 
</span><del>-    ::gTestRunner = TestRunner::create(pathOrURL, command.expectedPixelHash);
</del><ins>+    ::gTestRunner = TestRunner::create(testURL, command.expectedPixelHash);
</ins><span class="cx">     topLoadingFrame = 0;
</span><span class="cx">     done = false;
</span><span class="cx"> 
</span><ins>+    delete[] testURL;
+
</ins><span class="cx">     addFontFallbackIfPresent(fallbackPath);
</span><span class="cx"> 
</span><span class="cx">     sizeWebViewForCurrentTest();
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinResourceLoadDelegatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -274,13 +274,13 @@
</span><span class="cx"> 
</span><span class="cx">         if (host &amp;&amp; ((kCFCompareEqualTo == CFStringCompare(scheme.get(), CFSTR(&quot;http&quot;), kCFCompareCaseInsensitive))
</span><span class="cx">             || (kCFCompareEqualTo == CFStringCompare(scheme.get(), CFSTR(&quot;https&quot;), kCFCompareCaseInsensitive)))) {
</span><del>-            RetainPtr&lt;CFStringRef&gt; testPathOrURL = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, gTestRunner-&gt;testPathOrURL().c_str(), kCFStringEncodingWindowsLatin1));
-            RetainPtr&lt;CFMutableStringRef&gt; lowercaseTestPathOrURL = adoptCF(CFStringCreateMutableCopy(kCFAllocatorDefault, CFStringGetLength(testPathOrURL.get()), testPathOrURL.get()));
</del><ins>+            RetainPtr&lt;CFStringRef&gt; testURL = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, gTestRunner-&gt;testURL().c_str(), kCFStringEncodingWindowsLatin1));
+            RetainPtr&lt;CFMutableStringRef&gt; lowercaseTestURL = adoptCF(CFStringCreateMutableCopy(kCFAllocatorDefault, CFStringGetLength(testURL.get()), testURL.get()));
</ins><span class="cx">             RetainPtr&lt;CFLocaleRef&gt; locale = CFLocaleCopyCurrent();
</span><del>-            CFStringLowercase(lowercaseTestPathOrURL.get(), locale.get());
</del><ins>+            CFStringLowercase(lowercaseTestURL.get(), locale.get());
</ins><span class="cx">             RetainPtr&lt;CFStringRef&gt; testHost;
</span><del>-            if (CFStringHasPrefix(lowercaseTestPathOrURL.get(), CFSTR(&quot;http:&quot;)) || CFStringHasPrefix(lowercaseTestPathOrURL.get(), CFSTR(&quot;https:&quot;))) {
-                RetainPtr&lt;CFURLRef&gt; testPathURL = adoptCF(CFURLCreateWithString(kCFAllocatorDefault, lowercaseTestPathOrURL.get(), nullptr));
</del><ins>+            if (CFStringHasPrefix(lowercaseTestURL.get(), CFSTR(&quot;http:&quot;)) || CFStringHasPrefix(lowercaseTestURL.get(), CFSTR(&quot;https:&quot;))) {
+                RetainPtr&lt;CFURLRef&gt; testPathURL = adoptCF(CFURLCreateWithString(kCFAllocatorDefault, lowercaseTestURL.get(), nullptr));
</ins><span class="cx">                 testHost = adoptCF(CFURLCopyHostName(testPathURL.get()));
</span><span class="cx">             }
</span><span class="cx">             if (!isLocalhost(host.get()) &amp;&amp; !hostIsUsedBySomeTestsToGenerateError(host.get()) &amp;&amp; (!testHost || isLocalhost(testHost.get()))) {
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -655,6 +655,11 @@
</span><span class="cx">     if (!InjectedBundle::shared().isTestRunning())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    if (!InjectedBundle::shared().testRunner()-&gt;testURL()) {
+        WKRetainPtr&lt;WKURLRef&gt; testURL = adoptWK(WKBundleFrameCopyProvisionalURL(frame));
+        InjectedBundle::shared().testRunner()-&gt;setTestURL(testURL.get());
+    }
+
</ins><span class="cx">     platformDidStartProvisionalLoadForFrame(frame);
</span><span class="cx"> 
</span><span class="cx">     if (InjectedBundle::shared().testRunner()-&gt;shouldDumpFrameLoadCallbacks())
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -56,6 +56,8 @@
</span><span class="cx">     void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception);
</span><span class="cx"> 
</span><span class="cx">     // The basics.
</span><ins>+    WKURLRef testURL() const { return m_testURL.get(); }
+    void setTestURL(WKURLRef url) { m_testURL = url; }
</ins><span class="cx">     void dumpAsText(bool dumpPixels);
</span><span class="cx">     void waitForPolicyDelegate();
</span><span class="cx">     void dumpChildFramesAsText() { m_whatToDump = AllFramesText; }
</span><span class="lines">@@ -284,6 +286,8 @@
</span><span class="cx">     void platformInitialize();
</span><span class="cx">     void initializeWaitToDumpWatchdogTimerIfNeeded();
</span><span class="cx"> 
</span><ins>+    WKRetainPtr&lt;WKURLRef&gt; m_testURL; // Set by InjectedBundlePage once provisional load starts.
+
</ins><span class="cx">     WhatToDump m_whatToDump;
</span><span class="cx">     bool m_shouldDumpAllFrameScrollPositions;
</span><span class="cx">     bool m_shouldDumpBackForwardListsForAllWindows;
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlecocoaInjectedBundlePageCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #import &quot;InjectedBundlePage.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #import &quot;CrashReporterInfo.h&quot;
</span><ins>+#import &quot;InjectedBundle.h&quot;
</ins><span class="cx"> #import &lt;WebKit/WKBundleFrame.h&gt;
</span><span class="cx"> #import &lt;WebKit/WKBundlePagePrivate.h&gt;
</span><span class="cx"> #import &lt;WebKit/WKURLCF.h&gt;
</span><span class="lines">@@ -41,8 +42,7 @@
</span><span class="cx">     if (!WKBundleFrameIsMainFrame(frame))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    WKRetainPtr&lt;WKURLRef&gt; mainFrameURL = adoptWK(WKBundleFrameCopyProvisionalURL(frame));
-    setCrashReportApplicationSpecificInformationToURL(mainFrameURL.get());
</del><ins>+    setCrashReportApplicationSpecificInformationToURL(InjectedBundle::shared().testRunner()-&gt;testURL());
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     WKBundlePageSetUseTestingViewportConfiguration(page(), true);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnercocoaCrashReporterInfomm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm (176676 => 176677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm        2014-12-02 19:27:23 UTC (rev 176676)
+++ trunk/Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm        2014-12-02 19:30:58 UTC (rev 176677)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx"> {
</span><span class="cx">     String testPath = testPathFromURL(url);
</span><span class="cx">     if (!testPath.isNull()) {
</span><del>-        String message(&quot;CRASHING TEST:&quot;);
</del><ins>+        String message(&quot;CRASHING TEST: &quot;);
</ins><span class="cx">         message = message + testPath;
</span><span class="cx">         WKSetCrashReportApplicationSpecificInformation(message.createCFString().get());
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>