OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 </head> | 4 </head> |
5 <body> | 5 <body> |
6 <script src="../../resources/js-test.js"></script> | 6 <script src="../../resources/js-test.js"></script> |
7 <script> | 7 <script> |
8 description("This tests that cookie access throws exceptions with reason
able messages inside 'data:' URLs."); | 8 description("This tests that cookie access throws exceptions with reason
able messages inside 'data:' URLs."); |
9 | 9 |
10 window.jsTestIsAsync = true; | 10 window.jsTestIsAsync = true; |
11 | 11 |
12 var exceptionMessage; | 12 var exceptionMessage; |
13 window.addEventListener('message', function (e) { | 13 window.addEventListener('message', function (e) { |
14 exceptionMessage = e.data; | 14 exceptionMessage = e.data; |
15 shouldBeEqualToString('exceptionMessage', "Access to 'cookie' is den
ied for this document. Cookies are disabled inside 'data:' URLs."); | 15 shouldBeEqualToString('exceptionMessage', "Failed to read the 'cooki
e' property from 'Document': Cookies are disabled inside 'data:' URLs."); |
16 finishJSTest(); | 16 finishJSTest(); |
17 }); | 17 }); |
18 | 18 |
19 </script> | 19 </script> |
20 <iframe src="data:text/html,<script>try { document.cookie; } catch(e) { wind
ow.top.postMessage(e.message, '*'); };</script>"></iframe> | 20 <iframe src="data:text/html,<script>try { document.cookie; } catch(e) { wind
ow.top.postMessage(e.message, '*'); };</script>"></iframe> |
21 </body> | 21 </body> |
22 </html> | 22 </html> |
OLD | NEW |