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

Unified Diff: LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-options.html

Issue 1126343003: Ignore unknown options to subresource integrity (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed option parsing + nits from mkwst Created 5 years, 7 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: LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-options.html
diff --git a/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-options.html b/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-options.html
new file mode 100644
index 0000000000000000000000000000000000000000..885e6f941aacc2c171d45eef022dfd5c91a2e681
--- /dev/null
+++ b/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-options.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<head>
+ <title>SRI with options</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<script>
+ var tests = [
+ "sha256-B0/62fJSJFrdjEFR9ba04m/D+LHQ+zG6PGcaR0Trpxg=?foo=bar",
+ "sha256-B0/62fJSJFrdjEFR9ba04m/D+LHQ+zG6PGcaR0Trpxg=?foo=bar?baz=foz",
+ "sha256-B0/62fJSJFrdjEFR9ba04m/D+LHQ+zG6PGcaR0Trpxg=?",
+ "sha256-B0/62fJSJFrdjEFR9ba04m/D+LHQ+zG6PGcaR0Trpxg=?foobar",
+ "sha256-B0/62fJSJFrdjEFR9ba04m/D+LHQ+zG6PGcaR0Trpxg=?foo=bar?",
+ "sha256-B0/62fJSJFrdjEFR9ba04m/D+LHQ+zG6PGcaR0Trpxg=?foo&bar?",
+ ];
+
+ var success;
+
+ function addTest() {
+ var next_test = tests.shift();
+ if (next_test)
+ async_test(makeTest(next_test));
+ }
+
+ function makeTest(integrity) {
+ return function() {
+ var script = document.createElement('script');
+ success = this.step_func(function() {
+ addTest();
+ this.done();
+ });
+ var scriptError = this.step_func(function() {
+ assert_unreached();
+ addTest();
+ this.done();
+ });
+ script.src = 'call-success.js';
+ script.onerror = scriptError;
+ script.integrity = integrity;
+ document.body.appendChild(script);
+ };
+ }
+
+ async_test(makeTest(tests.shift()));
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698