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

Unified Diff: LayoutTests/security/cannot-read-self-from-file.html

Issue 1140203002: make file: an effectively unique origin (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix test 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/security/cannot-read-self-from-file.html
diff --git a/LayoutTests/security/cannot-read-self-from-file.html b/LayoutTests/security/cannot-read-self-from-file.html
new file mode 100644
index 0000000000000000000000000000000000000000..b328b1a744a2e1baa6dc21cdd187c361796a559b
--- /dev/null
+++ b/LayoutTests/security/cannot-read-self-from-file.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+testRunner.setAllowUniversalAccessFromFileURLs(false);
+testRunner.setAllowFileAccessFromFileURLs(false);
+
+var t = async_test('file: should be a unique-origin protocol for XHR purposes');
+window.addEventListener('message', t.step_func(function(evt) {
+ assert_equals(evt.data, 'NetworkError');
+ t.done();
+}));
+</script>
+</head>
+<body>
+<iframe src="resources/cannot-read-self-from-file.html"></iframe>
+Documents loaded from file: shouldn't be able to access themselves via XHR.
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698