| Index: LayoutTests/http/tests/inspector/console-fetch-logging.html
|
| diff --git a/LayoutTests/http/tests/inspector/console-fetch-logging.html b/LayoutTests/http/tests/inspector/console-fetch-logging.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5371f26ed8b76b49bb474afe3724934eec7d0bb0
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/inspector/console-fetch-logging.html
|
| @@ -0,0 +1,90 @@
|
| +<html>
|
| +<head>
|
| +<script src="inspector-test.js"></script>
|
| +<script src="console-test.js"></script>
|
| +<script src="network-test.js"></script>
|
| +<script>
|
| +function requestHelper(method, url, callback)
|
| +{
|
| + console.log("sending a " + method + " request to " + url);
|
| + // Delay invoking callback to let didFinishLoading() a chance to fire and log
|
| + // console message.
|
| + function delayCallback()
|
| + {
|
| + setTimeout(callback, 0);
|
| + }
|
| + makeFetch(url, {method: method}, delayCallback);
|
| +}
|
| +
|
| +function makeRequests(callback)
|
| +{
|
| + step1();
|
| +
|
| + function step1()
|
| + {
|
| + // Page that exists.
|
| + requestHelper("GET", "resources/xhr-exists.html", step2);
|
| + }
|
| +
|
| + function step2()
|
| + {
|
| + // Page that doesn't exist.
|
| + requestHelper("GET", "resources/xhr-does-not-exist.html", step3);
|
| + }
|
| +
|
| + function step3()
|
| + {
|
| + // POST to a page.
|
| + requestHelper("POST", "resources/post-target.cgi", step4);
|
| + }
|
| +
|
| + function step4()
|
| + {
|
| + // (Failed) cross-origin request
|
| + requestHelper("GET", "http://localhost:8000/inspector/resources/xhr-exists.html", callback);
|
| + }
|
| +}
|
| +
|
| +function test()
|
| +{
|
| + step1();
|
| +
|
| + function step1()
|
| + {
|
| + function callback()
|
| + {
|
| + InspectorTest.invokePageFunctionAsync("makeRequests", step2);
|
| + }
|
| + InspectorTest.NetworkAgent.setMonitoringXHREnabled(true, callback);
|
| + }
|
| +
|
| + function step2()
|
| + {
|
| + function callback()
|
| + {
|
| + InspectorTest.invokePageFunctionAsync("makeRequests", step3);
|
| + }
|
| + InspectorTest.NetworkAgent.setMonitoringXHREnabled(false, callback);
|
| + }
|
| +
|
| + function step3()
|
| + {
|
| + function finish()
|
| + {
|
| + InspectorTest.dumpConsoleMessages();
|
| + InspectorTest.completeTest();
|
| + }
|
| + InspectorTest.runAfterPendingDispatches(finish);
|
| + }
|
| +}
|
| +//# sourceURL=console-fetch-logging.html
|
| +</script>
|
| +</head>
|
| +
|
| +<body onload="runTest()">
|
| +<p>
|
| +Tests that fetch logging works when XMLHttpRequest Logging is Enabled and doesn't show logs when it is Disabled.
|
| +</p>
|
| +
|
| +</body>
|
| +</html>
|
|
|