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

Unified Diff: LayoutTests/http/tests/htmlimports/redirect-cross-origin-cross.html

Issue 149643003: Improve handling of CORS redirects for some resource loads. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use canRequest() when checking redirect origin; remove redundant null checks. Created 6 years, 10 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/htmlimports/redirect-cross-origin-cross.html
diff --git a/LayoutTests/http/tests/htmlimports/redirect-cross-origin-cross.html b/LayoutTests/http/tests/htmlimports/redirect-cross-origin-cross.html
new file mode 100644
index 0000000000000000000000000000000000000000..1c7ce9f887fbcfef963cad5dfa32cf43e9627641
--- /dev/null
+++ b/LayoutTests/http/tests/htmlimports/redirect-cross-origin-cross.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<link rel="help" "https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#imported-document" />
+
+<link id="cors-xs" rel="import" href="http://localhost:8000/security/resources/cors-redir.php?url=http://localhost:8000/htmlimports/resources/hello.html">
+</head>
+
+<script>
+function assert_loaded(id)
+{
+ var target = document.getElementById(id);
+ assert_true(target.import instanceof Document)
+ assert_true(0 <= target.import.querySelector("h1").innerHTML.indexOf("Hello"));
+}
+
+function assert_not_loaded(id)
+{
+ var target = document.getElementById(id);
+ assert_equals(target.import, null);
+}
+
+test(function() { assert_not_loaded("cors-xs"); }, "Blocking access to a cross origin import including CORS domain redirect");
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698