3 <script src=
"inspector-test.js"></script>
4 <script src=
"console-test.js"></script>
5 <script src=
"network-test.js"></script>
7 function requestHelper(method
, url
, callback
)
9 console
.log("sending a " + method
+ " request to " + url
);
10 // Delay invoking callback to let didFinishLoading() a chance to fire and log
12 function delayCallback()
14 setTimeout(callback
, 0);
16 makeFetch(url
, {method
: method
}, delayCallback
);
19 function makeRequests(callback
)
26 requestHelper("GET", "resources/xhr-exists.html", step2
);
31 // Page that doesn't exist.
32 requestHelper("GET", "resources/xhr-does-not-exist.html", step3
);
38 requestHelper("POST", "resources/post-target.cgi", step4
);
43 // (Failed) cross-origin request
44 requestHelper("GET", "http://localhost:8000/inspector/resources/xhr-exists.html", callback
);
56 InspectorTest
.invokePageFunctionAsync("makeRequests", step2
);
58 InspectorTest
.NetworkAgent
.setMonitoringXHREnabled(true, callback
);
65 InspectorTest
.invokePageFunctionAsync("makeRequests", step3
);
67 InspectorTest
.NetworkAgent
.setMonitoringXHREnabled(false, callback
);
74 InspectorTest
.dumpConsoleMessages();
75 InspectorTest
.completeTest();
77 InspectorTest
.runAfterPendingDispatches(finish
);
80 //# sourceURL=console-fetch-logging.html
84 <body onload=
"runTest()">
86 Tests that fetch logging works when XMLHttpRequest Logging is Enabled and doesn't show logs when it is Disabled.