Index: third_party/WebKit/LayoutTests/http/tests/subresource_filter/resource-disallowed-after-redirect.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/subresource_filter/resource-disallowed-after-redirect.html b/third_party/WebKit/LayoutTests/http/tests/subresource_filter/resource-disallowed-after-redirect.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bb0d1bde456c25051368f9f53474d0c3ab9940a0 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/subresource_filter/resource-disallowed-after-redirect.html |
@@ -0,0 +1,25 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+</head> |
+<body> |
+<script type="text/javascript"> |
+if (window.testRunner) { |
+ // Inject a subresource filter to disallow the script. |
Mike West
2016/06/03 13:48:51
Ditto.
engedy
2016/06/06 13:36:00
Done.
|
+ testRunner.setDisallowedSubresourcePathSuffixes(["included-script.js"]); |
+} |
+ |
+async_test(t => { |
+ var s = document.createElement("script"); |
+ s.onload = t.unreached_func("The script should not load."); |
+ s.onerror = t.step_func_done(_ => { |
+ assert_false(!!document.scriptExecuted, "The script should not run."); |
+ }); |
+ s.src = "http://localhost:8000/resources/redirect.php?url=../subresource_filter/resources/included-script.js.png&code=302"; |
Mike West
2016/06/03 13:48:51
Nit: Drop the `..`. `/` is enough, since the `subr
engedy
2016/06/06 13:36:00
Done.
|
+ document.body.appendChild(s); |
+}, "Resource disallowed after redirect."); |
+</script> |
+</body> |
+</html> |