summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/cookies/cookies-disabled-in-data-url.html
blob: 2ee02af6fba827b86650caffe0f728b6fc0e1d89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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>