| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="inspector-test.js"></script> |
| 4 <script src="console-test.js"></script> |
| 5 <script src="network-test.js"></script> |
| 6 <script> |
| 7 function requestHelper(method, url, callback) |
| 8 { |
| 9 console.log("sending a " + method + " request to " + url); |
| 10 // Delay invoking callback to let didFinishLoading() a chance to fire and lo
g |
| 11 // console message. |
| 12 function delayCallback() |
| 13 { |
| 14 setTimeout(callback, 0); |
| 15 } |
| 16 makeFetch(url, {method: method}, delayCallback); |
| 17 } |
| 18 |
| 19 function makeRequests(callback) |
| 20 { |
| 21 step1(); |
| 22 |
| 23 function step1() |
| 24 { |
| 25 // Page that exists. |
| 26 requestHelper("GET", "resources/xhr-exists.html", step2); |
| 27 } |
| 28 |
| 29 function step2() |
| 30 { |
| 31 // Page that doesn't exist. |
| 32 requestHelper("GET", "resources/xhr-does-not-exist.html", step3); |
| 33 } |
| 34 |
| 35 function step3() |
| 36 { |
| 37 // POST to a page. |
| 38 requestHelper("POST", "resources/post-target.cgi", step4); |
| 39 } |
| 40 |
| 41 function step4() |
| 42 { |
| 43 // (Failed) cross-origin request |
| 44 requestHelper("GET", "http://localhost:8000/inspector/resources/xhr-exis
ts.html", callback); |
| 45 } |
| 46 } |
| 47 |
| 48 function test() |
| 49 { |
| 50 step1(); |
| 51 |
| 52 function step1() |
| 53 { |
| 54 function callback() |
| 55 { |
| 56 InspectorTest.invokePageFunctionAsync("makeRequests", step2); |
| 57 } |
| 58 InspectorTest.NetworkAgent.setMonitoringXHREnabled(true, callback); |
| 59 } |
| 60 |
| 61 function step2() |
| 62 { |
| 63 function callback() |
| 64 { |
| 65 InspectorTest.invokePageFunctionAsync("makeRequests", step3); |
| 66 } |
| 67 InspectorTest.NetworkAgent.setMonitoringXHREnabled(false, callback); |
| 68 } |
| 69 |
| 70 function step3() |
| 71 { |
| 72 function finish() |
| 73 { |
| 74 InspectorTest.dumpConsoleMessages(); |
| 75 InspectorTest.completeTest(); |
| 76 } |
| 77 InspectorTest.runAfterPendingDispatches(finish); |
| 78 } |
| 79 } |
| 80 //# sourceURL=console-fetch-logging.html |
| 81 </script> |
| 82 </head> |
| 83 |
| 84 <body onload="runTest()"> |
| 85 <p> |
| 86 Tests that fetch logging works when XMLHttpRequest Logging is Enabled and doesn'
t show logs when it is Disabled. |
| 87 </p> |
| 88 |
| 89 </body> |
| 90 </html> |
| OLD | NEW |