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

Unified Diff: LayoutTests/fast/cookies/cookies-disabled-in-data-url.html

Issue 23163004: Improve 'document.cookie' access check exception messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/fast/cookies/cookies-disabled-in-data-url-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/cookies/cookies-disabled-in-data-url.html
diff --git a/LayoutTests/fast/cookies/cookies-disabled-in-data-url.html b/LayoutTests/fast/cookies/cookies-disabled-in-data-url.html
new file mode 100644
index 0000000000000000000000000000000000000000..2ee02af6fba827b86650caffe0f728b6fc0e1d89
--- /dev/null
+++ b/LayoutTests/fast/cookies/cookies-disabled-in-data-url.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+ <script src="../js/resources/js-test-pre.js"></script>
+ <script>
+ description("This tests that cookie access throws exceptions with reasonable messages inside 'data:' URLs.");
+
+ window.jsTestIsAsync = true;
+
+ var exceptionMessage;
+ window.addEventListener('message', function (e) {
+ exceptionMessage = e.data;
+ shouldBeEqualToString('exceptionMessage', "Access to 'cookie' is denied for this document. Cookies are disabled inside 'data:' URLs.");
+ finishJSTest();
+ });
+
+ </script>
+ <iframe src="data:text/html,<script>try { document.cookie; } catch(e) { window.top.postMessage(e.message, '*'); };</script>"></iframe>
+ <script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/cookies/cookies-disabled-in-data-url-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698