Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / storage / storage-disallowed-in-data-url.html
blob71e2bd6b5dbf5d2338184383841cde15a7364429
1 <!DOCTYPE html>
2 <html>
3 <head>
4 </head>
5 <body>
6 <script src="../../resources/js-test.js"></script>
7 <script>
8 description("This tests that storage methods throw exceptions with reasonable messages inside 'data:' URLs.");
10 var errorsSeen = 0;
12 window.jsTestIsAsync = true;
14 window.addEventListener('message', function (e) {
15 errorsSeen++;
16 window.exceptionMessage = e.data;
17 if (errorsSeen == 1) {
18 shouldBeEqualToString('exceptionMessage', "Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs.");
19 } else {
20 shouldBeEqualToString('exceptionMessage', "Failed to read the 'sessionStorage' property from 'Window': Storage is disabled inside 'data:' URLs.");
21 finishJSTest();
23 });
25 </script>
26 <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>
27 </body>
28 </html>