Title: [154727] trunk
Revision
154727
Author
[email protected]
Date
2013-08-28 02:29:30 -0700 (Wed, 28 Aug 2013)

Log Message

[Soup] WebTiming information not shown in the inspector
https://bugs.webkit.org/show_bug.cgi?id=118395

Reviewed by Martin Robinson.

Source/WebCore:

WebTiming information was not correctly provided to WebCore
because the gotHeadersCallback was incorrectly resetting the
original ResourceResponse (which had the ResourceLoadTiming
object) instead of simply updating their contents using the
SoupMessage.

No new test required as this feature is already covered by the
existing webtiming tests. In any case this change includes a fix
for the http/tests/misc/webtiming-ssl.php test which was not
failing even if it should because it was not correct.

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::gotHeadersCallback):
(WebCore::restartedCallback): restartedCallback should be
available only if WEB_TIMING is defined.
(WebCore::createSoupMessageForHandleAndRequest): Ditto.

LayoutTests:

Fixed the webiming-ssl.php test that was incorrectly considering a
FAIL as the expected result. It was probably just a legacy
decision which came from the times where DRT was responsible of
reporting WebTiming information.

Also added a new test that fails due to wkb.ug/103927. It was not
detected before because there were no timing information in the
response.

* http/tests/misc/resources/webtiming-ssl.html:
* http/tests/misc/webtiming-ssl-expected.txt:
* platform/gtk/TestExpectations: added
http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_attribute_order.html.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (154726 => 154727)


--- trunk/LayoutTests/ChangeLog	2013-08-28 08:32:42 UTC (rev 154726)
+++ trunk/LayoutTests/ChangeLog	2013-08-28 09:29:30 UTC (rev 154727)
@@ -1,3 +1,24 @@
+2013-08-28  Sergio Villar Senin  <[email protected]>
+
+        [Soup] WebTiming information not shown in the inspector
+        https://bugs.webkit.org/show_bug.cgi?id=118395
+
+        Reviewed by Martin Robinson.
+
+        Fixed the webiming-ssl.php test that was incorrectly considering a
+        FAIL as the expected result. It was probably just a legacy
+        decision which came from the times where DRT was responsible of
+        reporting WebTiming information.
+
+        Also added a new test that fails due to wkb.ug/103927. It was not
+        detected before because there were no timing information in the
+        response.
+
+        * http/tests/misc/resources/webtiming-ssl.html:
+        * http/tests/misc/webtiming-ssl-expected.txt:
+        * platform/gtk/TestExpectations: added
+        http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_attribute_order.html.
+
 2013-08-28  Gabor Rapcsanyi  <[email protected]>
 
         Unreviewed ARM Qt gardening.

Modified: trunk/LayoutTests/http/tests/misc/resources/webtiming-ssl.html (154726 => 154727)


--- trunk/LayoutTests/http/tests/misc/resources/webtiming-ssl.html	2013-08-28 08:32:42 UTC (rev 154726)
+++ trunk/LayoutTests/http/tests/misc/resources/webtiming-ssl.html	2013-08-28 09:29:30 UTC (rev 154727)
@@ -9,7 +9,7 @@
 <p id="description"></p>
 <div id="console"></div>
 <script>
-description("This test checks that Web Timing reports secureConnectionStart correctly and has reasonable values for connectStart and connectEnd. Note that DumpRenderTree doesn't set secureConnectionStart.");
+description("This test checks that Web Timing reports secureConnectionStart correctly and has reasonable values for connectStart and connectEnd.");
 
 window.performance = window.performance || {};
 var navigation = performance.navigation || {};

Modified: trunk/LayoutTests/http/tests/misc/webtiming-ssl-expected.txt (154726 => 154727)


--- trunk/LayoutTests/http/tests/misc/webtiming-ssl-expected.txt	2013-08-28 08:32:42 UTC (rev 154726)
+++ trunk/LayoutTests/http/tests/misc/webtiming-ssl-expected.txt	2013-08-28 09:29:30 UTC (rev 154727)
@@ -1,10 +1,10 @@
-This test checks that Web Timing reports secureConnectionStart correctly and has reasonable values for connectStart and connectEnd. Note that DumpRenderTree doesn't set secureConnectionStart.
+This test checks that Web Timing reports secureConnectionStart correctly and has reasonable values for connectStart and connectEnd.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
 PASS timing.connectStart is >= timing.navigationStart
-FAIL timing.secureConnectionStart should be >= timing.connectStart. Was 0 (of type number).
+PASS timing.secureConnectionStart is >= timing.connectStart
 PASS timing.connectEnd is >= timing.secureConnectionStart
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (154726 => 154727)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2013-08-28 08:32:42 UTC (rev 154726)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2013-08-28 09:29:30 UTC (rev 154727)
@@ -1274,6 +1274,7 @@
 
 webkit.org/b/103927 http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_resource_request.html [ Failure ]
 webkit.org/b/103927 http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_timing_allow_cross_origin_resource_request.html [ Failure ]
+webkit.org/b/103927 http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_attribute_order.html [ Failure ]
 webkit.org/b/103927 http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_frame_initiator_type.html [ Failure ]
 webkit.org/b/103927 http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_initiator_types.html [ Failure ]
 webkit.org/b/103927 http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_redirects.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (154726 => 154727)


--- trunk/Source/WebCore/ChangeLog	2013-08-28 08:32:42 UTC (rev 154726)
+++ trunk/Source/WebCore/ChangeLog	2013-08-28 09:29:30 UTC (rev 154727)
@@ -1,3 +1,27 @@
+2013-08-28  Sergio Villar Senin  <[email protected]>
+
+        [Soup] WebTiming information not shown in the inspector
+        https://bugs.webkit.org/show_bug.cgi?id=118395
+
+        Reviewed by Martin Robinson.
+
+        WebTiming information was not correctly provided to WebCore
+        because the gotHeadersCallback was incorrectly resetting the
+        original ResourceResponse (which had the ResourceLoadTiming
+        object) instead of simply updating their contents using the
+        SoupMessage.
+
+        No new test required as this feature is already covered by the
+        existing webtiming tests. In any case this change includes a fix
+        for the http/tests/misc/webtiming-ssl.php test which was not
+        failing even if it should because it was not correct.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::gotHeadersCallback):
+        (WebCore::restartedCallback): restartedCallback should be
+        available only if WEB_TIMING is defined.
+        (WebCore::createSoupMessageForHandleAndRequest): Ditto.
+
 2013-08-26  Antonio Gomes  <[email protected]>
 
         Scrolling allowed when overflow:hidden (seen on Acid2)

Modified: trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (154726 => 154727)


--- trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp	2013-08-28 08:32:42 UTC (rev 154726)
+++ trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp	2013-08-28 09:29:30 UTC (rev 154727)
@@ -352,9 +352,7 @@
 
     // The original response will be needed later to feed to willSendRequest in
     // doRedirect() in case we are redirected. For this reason, we store it here.
-    ResourceResponse response;
-    response.updateFromSoupMessage(message);
-    d->m_response = response;
+    d->m_response.updateFromSoupMessage(message);
 }
 
 static void applyAuthenticationToRequest(ResourceHandle* handle, ResourceRequest& request, bool redirect)
@@ -393,6 +391,7 @@
     request.setURL(urlWithCredentials);
 }
 
+#if ENABLE(WEB_TIMING)
 // Called each time the message is going to be sent again except the first time.
 // This happens when libsoup handles HTTP authentication.
 static void restartedCallback(SoupMessage*, gpointer data)
@@ -401,13 +400,12 @@
     if (!handle || handle->cancelledOrClientless())
         return;
 
-#if ENABLE(WEB_TIMING)
     ResourceHandleInternal* d = handle->getInternal();
     ResourceResponse& redirectResponse = d->m_response;
     redirectResponse.setResourceLoadTiming(ResourceLoadTiming::create());
     redirectResponse.resourceLoadTiming()->requestTime = monotonicallyIncreasingTime();
-#endif
 }
+#endif
 
 static bool shouldRedirect(ResourceHandle* handle)
 {
@@ -970,7 +968,6 @@
         soup_message_headers_set_content_length(soupMessage->request_headers, 0);
 
     g_signal_connect(d->m_soupMessage.get(), "got-headers", G_CALLBACK(gotHeadersCallback), handle);
-    g_signal_connect(d->m_soupMessage.get(), "restarted", G_CALLBACK(restartedCallback), handle);
     g_signal_connect(d->m_soupMessage.get(), "wrote-body-data", G_CALLBACK(wroteBodyDataCallback), handle);
 
     soup_message_set_flags(d->m_soupMessage.get(), static_cast<SoupMessageFlags>(soup_message_get_flags(d->m_soupMessage.get()) | SOUP_MESSAGE_NO_REDIRECT));
@@ -978,6 +975,7 @@
 #if ENABLE(WEB_TIMING)
     d->m_response.setResourceLoadTiming(ResourceLoadTiming::create());
     g_signal_connect(d->m_soupMessage.get(), "network-event", G_CALLBACK(networkEventCallback), handle);
+    g_signal_connect(d->m_soupMessage.get(), "restarted", G_CALLBACK(restartedCallback), handle);
     g_signal_connect(d->m_soupMessage.get(), "wrote-body", G_CALLBACK(wroteBodyCallback), handle);
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to