Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../inspector-test.js"></script> | 4 <script src="../inspector-test.js"></script> |
| 5 <script src="../network-test.js"></script> | 5 <script src="../network-test.js"></script> |
| 6 <script> | 6 <script> |
| 7 // Regression test for https://crbug.com/573269. | 7 // Regression test for https://crbug.com/573269. |
| 8 function loadIFrame() { | 8 function loadIFrame() { |
| 9 var iframe = document.createElement('iframe'); | 9 var iframe = document.createElement('iframe'); |
| 10 iframe.src = 'resources/call-success-with-integrity-frame.html'; | 10 iframe.src = 'resources/call-success-with-integrity-frame.html'; |
| 11 document.body.appendChild(iframe); | 11 document.body.appendChild(iframe); |
| 12 } | 12 } |
| 13 | 13 |
| 14 function test() { | 14 function test() { |
| 15 function findRequestsByURL(url) | |
| 16 { | |
| 17 var requests = InspectorTest.networkRequests(); | |
| 18 var results = []; | |
| 19 for (var i = 0; i < requests.length; ++i) { | |
| 20 if (url.test(requests[i].url)) | |
| 21 results.push(requests[i]); | |
| 22 } | |
| 23 | |
| 24 return results; | |
| 25 } | |
| 26 InspectorTest.addConsoleSniffer(step1); | 15 InspectorTest.addConsoleSniffer(step1); |
| 27 InspectorTest.evaluateInPage("loadIFrame()"); | 16 InspectorTest.evaluateInPage("loadIFrame()"); |
| 28 | 17 |
| 29 function step1() { | 18 function step1() { |
| 30 var requests = findRequestsByURL(/call-success.js/); | 19 var requests = InspectorTest.findRequestsByURLPattern(/call-success.js/) ; |
|
sof
2016/01/06 21:17:01
This is not the only test in this directory that c
jww
2016/01/06 23:37:30
Done.
| |
| 31 InspectorTest.assertTrue(requests.length === 1); | 20 InspectorTest.assertTrue(requests.length === 1); |
| 32 InspectorTest.completeTest(); | 21 InspectorTest.completeTest(); |
| 33 } | 22 } |
| 34 } | 23 } |
| 35 </script> | 24 </script> |
| 36 </head> | 25 </head> |
| 37 <body> | 26 <body> |
| 38 <script>runTest();</script> | 27 <script>runTest();</script> |
| 39 <p>Verify that only one request is made for basic script requests with integrity attribute.</p> | 28 <p>Verify that only one request is made for basic script requests with integrity attribute.</p> |
| 40 </body> | 29 </body> |
| 41 </html> | 30 </html> |
| OLD | NEW |