Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/inspector/network/subresource-integrity-number-of-requests.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/subresource-integrity-number-of-requests.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/subresource-integrity-number-of-requests.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4e2ecbfa972070f27f21aec7c95f76a613cd44ff |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/subresource-integrity-number-of-requests.html |
| @@ -0,0 +1,41 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script src="../inspector-test.js"></script> |
| +<script src="../network-test.js"></script> |
|
Yoav Weiss
2016/01/06 07:48:43
Interesting! Didn't know about network-test. When
jww
2016/01/06 18:37:52
This test has the (slight) advantage of being an a
|
| +<script> |
| +// Regression test for https://crbug.com/573269. |
| +function loadIFrame() { |
| + var iframe = document.createElement('iframe'); |
| + iframe.src = 'resources/call-success-with-integrity-frame.html'; |
| + document.body.appendChild(iframe); |
| +} |
| + |
| +function test() { |
| + function findRequestsByURL(url) |
|
sof
2016/01/06 07:38:13
not for here, but a candidate addition to network-
jww
2016/01/06 18:37:53
Makes sense to me. I'll move it to network-test.js
|
| + { |
| + var requests = InspectorTest.networkRequests(); |
| + var results = []; |
| + for (var i = 0; i < requests.length; ++i) { |
| + if (url.test(requests[i].url)) |
| + results.push(requests[i]); |
| + } |
| + |
| + return results; |
| + } |
| + InspectorTest.addConsoleSniffer(step1); |
| + InspectorTest.evaluateInPage("loadIFrame()"); |
| + |
| + function step1() { |
| + var requests = findRequestsByURL(/call-success.js/); |
| + InspectorTest.assertTrue(requests.length === 1); |
| + InspectorTest.completeTest(); |
| + } |
| +} |
| +</script> |
| +</head> |
| +<body> |
| +<script>runTest();</script> |
| +<p>Verify that only one request is made for basic script requests with integrity attribute.</p> |
| +</body> |
| +</html> |