| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 function loadIFrameWithDownload() | 5 function loadIFrameWithDownload() |
| 6 { | 6 { |
| 7 var iframe = document.createElement("iframe"); | 7 var iframe = document.createElement("iframe"); |
| 8 iframe.setAttribute("src", "http://127.0.0.1:8000/security/XFrameOptions/res
ources/x-frame-options-deny.cgi"); | 8 iframe.setAttribute("src", "http://127.0.0.1:8000/security/XFrameOptions/res
ources/x-frame-options-deny.cgi"); |
| 9 document.body.appendChild(iframe); | 9 document.body.appendChild(iframe); |
| 10 } | 10 } |
| 11 | 11 |
| 12 function test() | 12 function test() |
| 13 { | 13 { |
| 14 InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "responseReceived"
, responseReceived); | 14 InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "responseReceived"
, responseReceived); |
| 15 InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "loadingFailed", l
oadingFailed); | 15 InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "loadingFailed", l
oadingFailed); |
| 16 InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "loadingFinished",
loadingFinished); | 16 InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "loadingFinished",
loadingFinished); |
| 17 InspectorTest.evaluateInPage("loadIFrameWithDownload()"); | 17 InspectorTest.evaluateInPage("loadIFrameWithDownload()"); |
| 18 | 18 |
| 19 function responseReceived(requestId, time, resourceType, response) | 19 function responseReceived(requestId, time, resourceType, response) |
| 20 { | 20 { |
| 21 var request = InspectorTest.networkLog.requestForId(requestId); | 21 var request = InspectorTest.networkLog.requestForId(requestId); |
| 22 if (/x-frame-options-deny\.cgi/.exec(request.url)) { | 22 if (/x-frame-options-deny\.cgi/.exec(request.url())) { |
| 23 InspectorTest.addResult("Received response for x-frame-options-deny.
cgi"); | 23 InspectorTest.addResult("Received response for x-frame-options-deny.
cgi"); |
| 24 InspectorTest.addResult("SUCCESS"); | 24 InspectorTest.addResult("SUCCESS"); |
| 25 InspectorTest.completeTest(); | 25 InspectorTest.completeTest(); |
| 26 } | 26 } |
| 27 } | 27 } |
| 28 | 28 |
| 29 function loadingFinished(requestId, finishTime) | 29 function loadingFinished(requestId, finishTime) |
| 30 { | 30 { |
| 31 var request = InspectorTest.networkLog.requestForId(requestId); | 31 var request = InspectorTest.networkLog.requestForId(requestId); |
| 32 if (/x-frame-options-deny\.cgi/.exec(request.url)) | 32 if (/x-frame-options-deny\.cgi/.exec(request.url())) |
| 33 InspectorTest.completeTest(); | 33 InspectorTest.completeTest(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 function loadingFailed(requestId, time, localizedDescription, canceled) | 36 function loadingFailed(requestId, time, localizedDescription, canceled) |
| 37 { | 37 { |
| 38 var request = InspectorTest.networkLog.requestForId(requestId); | 38 var request = InspectorTest.networkLog.requestForId(requestId); |
| 39 if (/x-frame-options-deny\.cgi/.exec(request.url)) { | 39 if (/x-frame-options-deny\.cgi/.exec(request.url())) { |
| 40 InspectorTest.addResult("TODO(mkwst): This started failing when we m
oved XFO to the browser."); | 40 InspectorTest.addResult("TODO(mkwst): This started failing when we m
oved XFO to the browser."); |
| 41 InspectorTest.completeTest(); | 41 InspectorTest.completeTest(); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 </script> | 45 </script> |
| 46 </head> | 46 </head> |
| 47 <body onload="runTest()"> | 47 <body onload="runTest()"> |
| 48 <p>Tests that responseReceived is called on NetworkDispatcher for resource reque
sts denied due to X-Frame-Options header.</p> | 48 <p>Tests that responseReceived is called on NetworkDispatcher for resource reque
sts denied due to X-Frame-Options header.</p> |
| 49 </body> | 49 </body> |
| 50 </html> | 50 </html> |
| OLD | NEW |