Diff
Modified: trunk/LayoutTests/ChangeLog (108505 => 108506)
--- trunk/LayoutTests/ChangeLog 2012-02-22 16:29:33 UTC (rev 108505)
+++ trunk/LayoutTests/ChangeLog 2012-02-22 16:47:09 UTC (rev 108506)
@@ -1,3 +1,13 @@
+2012-02-22 Vsevolod Vlasov <[email protected]>
+
+ Web Inspector: [REGRESSION] Console xhr logging is broken for async xhrs since r107672.
+ https://bugs.webkit.org/show_bug.cgi?id=79229
+
+ Reviewed by Pavel Feldman.
+
+ * http/tests/inspector/console-xhr-logging-async-expected.txt: Added.
+ * http/tests/inspector/console-xhr-logging-async.html: Added.
+
2012-02-22 Mihnea Ovidenie <[email protected]>
[Qt] REGRESSION(r108108): It made 3 fast/repaint tests fail
Added: trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async-expected.txt (0 => 108506)
--- trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async-expected.txt 2012-02-22 16:47:09 UTC (rev 108506)
@@ -0,0 +1,8 @@
+CONSOLE MESSAGE: line 14: Done.
+CONSOLE MESSAGE: line 14: Done.
+Tests that XMLHttpRequest Logging works when Enabled and doesn't show logs when Disabled for asynchronous XHRs.
+
+Bug 79229
+network-test.js:39XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html".
+console-xhr-logging-async.html:14Done.
+
Property changes on: trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async-expected.txt
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async.html (0 => 108506)
--- trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async.html (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async.html 2012-02-22 16:47:09 UTC (rev 108506)
@@ -0,0 +1,61 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script src=""
+<script>
+function makeRequest()
+{
+ doXHR("GET", "resources/xhr-exists.html", true, allXHRsLoaded);
+}
+
+function allXHRsLoaded()
+{
+ console.log("Done.");
+}
+
+function test()
+{
+ step1();
+
+ function step1()
+ {
+ function callback()
+ {
+ InspectorTest.evaluateInPage("makeRequest()");
+ }
+
+ InspectorTest.addConsoleSniffer(step2);
+ ConsoleAgent.setMonitoringXHREnabled(true, callback);
+ }
+
+ function step2()
+ {
+ function callback()
+ {
+ InspectorTest.evaluateInPage("makeRequest()");
+ }
+
+ InspectorTest.addConsoleSniffer(step3);
+ ConsoleAgent.setMonitoringXHREnabled(false, callback);
+ }
+
+ function step3()
+ {
+ function finish()
+ {
+ InspectorTest.dumpConsoleMessages();
+ InspectorTest.completeTest();
+ }
+ InspectorTest.runAfterPendingDispatches(finish);
+ }
+}
+
+</script>
+</head>
+
+<body _onload_="runTest()">
+<p>Tests that XMLHttpRequest Logging works when Enabled and doesn't show logs when Disabled for asynchronous XHRs.</p>
+<a href="" 79229</a>
+</body>
+</html>
Property changes on: trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async.html
___________________________________________________________________
Added: svn:eol-style
Modified: trunk/Source/WebCore/ChangeLog (108505 => 108506)
--- trunk/Source/WebCore/ChangeLog 2012-02-22 16:29:33 UTC (rev 108505)
+++ trunk/Source/WebCore/ChangeLog 2012-02-22 16:47:09 UTC (rev 108506)
@@ -1,3 +1,17 @@
+2012-02-22 Vsevolod Vlasov <[email protected]>
+
+ Web Inspector: [REGRESSION] Console xhr logging is broken for async xhrs since r107672.
+ https://bugs.webkit.org/show_bug.cgi?id=79229
+
+ Reviewed by Pavel Feldman.
+
+ Test: http/tests/inspector/console-xhr-logging-async.html
+
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::InspectorResourceAgent::setInitialScriptContent):
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::didFinishLoading):
+
2012-02-22 Andrey Kosyakov <[email protected]>
Web Inspector: fix memory counters and start-at-zero modes of timeline panels to co-exist nicely
Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (108505 => 108506)
--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp 2012-02-22 16:29:33 UTC (rev 108505)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp 2012-02-22 16:47:09 UTC (rev 108506)
@@ -318,7 +318,10 @@
void InspectorResourceAgent::setInitialScriptContent(unsigned long identifier, const String& sourceString)
{
- m_resourcesData->setResourceContent(IdentifiersFactory::requestId(identifier), sourceString);
+ // For Asynchronous XHRs, the inspector can grab the data directly off of the CachedResource. For sync XHRs, we need to
+ // provide the data here, since no CachedResource was involved.
+ if (m_loadingXHRSynchronously)
+ m_resourcesData->setResourceContent(IdentifiersFactory::requestId(identifier), sourceString);
}
void InspectorResourceAgent::didReceiveScriptResponse(unsigned long identifier)
Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (108505 => 108506)
--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp 2012-02-22 16:29:33 UTC (rev 108505)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp 2012-02-22 16:47:09 UTC (rev 108506)
@@ -1037,10 +1037,7 @@
// FIXME: Set m_responseBlob to something here in the ResponseTypeBlob case.
#endif
- // For Asynchronous XHRs, the inspector can grab the data directly off of the CachedResource. For sync XHRs, we need to
- // provide the data here, since no CachedResource was involved.
- if (!m_async)
- InspectorInstrumentation::resourceRetrievedByXMLHttpRequest(scriptExecutionContext(), identifier, m_responseBuilder.toStringPreserveCapacity(), m_url, m_lastSendURL, m_lastSendLineNumber);
+ InspectorInstrumentation::resourceRetrievedByXMLHttpRequest(scriptExecutionContext(), identifier, m_responseBuilder.toStringPreserveCapacity(), m_url, m_lastSendURL, m_lastSendLineNumber);
bool hadLoader = m_loader;
m_loader = 0;