| <!DOCTYPE html> |
| <html> |
| <head> |
| </head> |
| <body> |
| <script src="../../resources/js-test.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', "Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs."); |
| } else { |
| shouldBeEqualToString('exceptionMessage', "Failed to read the 'sessionStorage' property from 'Window': 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> |
| </body> |
| </html> |