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> |