Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/network/subresource-integrity-number-of-requests.html

Issue 1569623002: Fix-up some code relating to SRI double-requesting scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698