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(WebInspector.NetworkDispatcher.prototype, "response
Received", responseReceived); | 14 InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "response
Received", responseReceived); |
15 InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "loadingF
ailed", loadingFailed); | 15 InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "loadingF
ailed", loadingFailed); |
16 InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "loadingF
inished", loadingFinished); | 16 InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "loadingF
inished", 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 = WebInspector.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 = WebInspector.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 = WebInspector.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.completeTest(); | 40 InspectorTest.completeTest(); |
41 } | 41 } |
42 } | 42 } |
43 </script> | 43 </script> |
44 </head> | 44 </head> |
45 <body onload="runTest()"> | 45 <body onload="runTest()"> |
46 <p>Tests that responseReceived is called on NetworkDispatcher for resource reque
sts denied due to X-Frame-Options header.</p> | 46 <p>Tests that responseReceived is called on NetworkDispatcher for resource reque
sts denied due to X-Frame-Options header.</p> |
47 </body> | 47 </body> |
48 </html> | 48 </html> |
OLD | NEW |