blob: b011379d0aaccb59b3da1987a32d993b9e27a6e3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script src="../js/resources/js-test-pre.js"></script>
<script>
description("This tests that storage methods throw exceptions with reasonable messages inside 'data:' URLs.");
var errorsSeen = 0;
window.jsTestIsAsync = true;
window.addEventListener('message', function (e) {
errorsSeen++;
window.exceptionMessage = e.data;
if (errorsSeen == 1) {
shouldBeEqualToString('exceptionMessage', "Access to 'localStorage' is denied for this document. Storage is disabled inside 'data:' URLs.");
} else {
shouldBeEqualToString('exceptionMessage', "Access to 'sessionStorage' is denied for this document. Storage is disabled inside 'data:' URLs.");
finishJSTest();
}
});
</script>
<iframe src="data:text/html,<script>try { window.localStorage; } catch(e) { window.top.postMessage(e.message, '*'); }; try { window.sessionStorage; } catch(e) { window.top.postMessage(e.message, '*'); }</script>"></iframe>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>
|