6 <script src=
"../../resources/js-test.js"></script>
8 description("This tests that storage methods throw exceptions with reasonable messages inside 'data:' URLs.");
12 window
.jsTestIsAsync
= true;
14 window
.addEventListener('message', function (e
) {
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.");
20 shouldBeEqualToString('exceptionMessage', "Failed to read the 'sessionStorage' property from 'Window': Storage is disabled inside 'data:' URLs.");
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
>