Index: third_party/WebKit/LayoutTests/http/tests/security/mixedContent/strict-mode-image-no-policy.https.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/mixedContent/strict-mode-image-no-policy.https.html b/third_party/WebKit/LayoutTests/http/tests/security/mixedContent/strict-mode-image-no-policy.https.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1610ef2855db2ad740f5b70716894089960d3b2a |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/security/mixedContent/strict-mode-image-no-policy.https.html |
@@ -0,0 +1,22 @@ |
+<!doctype html> |
+<script src="/resources/testharness.js"></script> |
+<script src="/resources/testharnessreport.js"></script> |
+<body> |
+<script> |
+ async_test(t => { |
+ var i = document.createElement('img'); |
+ i.onerror = t.assert_unreached; |
+ i.onload = t.step_func_done(_ => { |
+ assert_equals(128, i.naturalWidth); |
+ assert_equals(128, i.naturalHeight); |
+ }); |
+ i.src = "http://127.0.0.1:8080/security/resources/compass.jpg?t=1"; |
+ }, "Mixed images are allowed in the presence of 'block-all-mixed-content' in report-only mode."); |
+ |
+ async_test(t => { |
+ var i = document.createElement('img'); |
+ i.onload = t.step_func_done(); |
+ document.addEventListener('securitypolicyviolation', t.assert_unreached); |
+ i.src = "http://127.0.0.1:8080/security/resources/compass.jpg?t=2"; |
+ }, "Mixed images do not generate CSP violation reports when no policy is present."); |
+</script> |