blob: 8cc8915b50b63b5ac690b0dc6bd457467d0f4d09 [file] [log] [blame]
<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)
{
// Make synchronous requests for simplicity.
console.log("sending a %s request to %s", method, url);
makeSimpleXHR(method, url, false);
}
function makeRequests()
{
// 1. Page that exists.
requestHelper("GET", "resources/xhr-exists.html");
// 2. Page that doesn't exist.
requestHelper("GET", "resources/xhr-does-not-exist.html");
// 3. POST to a page.
requestHelper("POST", "resources/post-target.cgi");
// 4. Cross-origin request
requestHelper("GET", "http://localhost:8000/inspector/resources/xhr-exists.html");
}
function test()
{
step1();
function step1()
{
function callback()
{
InspectorTest.evaluateInPage("makeRequests()", step2);
}
ConsoleAgent.setMonitoringXHREnabled(true, callback);
}
function step2()
{
function callback()
{
InspectorTest.evaluateInPage("makeRequests()", 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.
</p>
</body>
</html>