Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Unified Diff: LayoutTests/http/tests/inspector/network/network-eventsource.html

Issue 1259393002: DevTools: add support for logging fetch requests when XHR logging is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixed the test Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/inspector/network/network-eventsource.html
diff --git a/LayoutTests/http/tests/inspector/network/network-xhr-async-response-type-blob.html b/LayoutTests/http/tests/inspector/network/network-eventsource.html
similarity index 67%
copy from LayoutTests/http/tests/inspector/network/network-xhr-async-response-type-blob.html
copy to LayoutTests/http/tests/inspector/network/network-eventsource.html
index c0c4faa8e107481734e2ca788a9f7fc9adb47af8..bb06b34fcc58f003ee9d736eff005b26e656527a 100644
--- a/LayoutTests/http/tests/inspector/network/network-xhr-async-response-type-blob.html
+++ b/LayoutTests/http/tests/inspector/network/network-eventsource.html
@@ -3,17 +3,34 @@
<script src="../inspector-test.js"></script>
<script src="../network-test.js"></script>
<script>
+
+function receiveEvent(callback)
+{
+ var es = new EventSource("resources/event-stream.asis");
+ es.onmessage = onMessage;
+ es.onerror = onError;
+ function onMessage(data)
+ {
+ output("got event: " + event.data);
+ }
+
+ function onError()
+ {
+ es.close();
+ callback();
+ }
+}
+
function test()
{
InspectorTest.recordNetwork();
- InspectorTest.makeXHR("GET", "resources/resource.php", true, undefined, undefined, [], false, undefined, 'blob', step2);
+ InspectorTest.invokePageFunctionAsync("receiveEvent", step2);
function step2()
{
var request1 = InspectorTest.networkRequests().pop();
InspectorTest.addResult(request1.url);
InspectorTest.addResult("resource.type: " + request1.resourceType());
- InspectorTest.addResult("resource.size: " + request1.resourceSize);
InspectorTest.addResult("resource.content before requesting content: " + request1.content);
InspectorTest.assertTrue(!request1.failed, "Resource loading failed.");
request1.requestContent(step3);
@@ -30,8 +47,6 @@ function test()
</script>
</head>
<body onload="runTest()">
- <p>
- Tests XHR network resource type and size for asynchronous requests when "blob" is specified as the response type.
-</p>
+<p>Tests EventSource resource type and content.</p>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698