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

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

Issue 1561903002: Fix double resource request for script resources with integrity attr. (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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698