Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / dictionary-string-conversion-exception.html
blob98fad0a4236f35f7ed4f5936225833ce88b6dc28
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Checks that an exception is thrown when a dictionary value cannot be converted to a String");
9 shouldBeEqualToString("new MessageEvent('message', {origin: 'test'}).origin", "test");
10 shouldBeEqualToString("new MessageEvent('message', {origin: 2}).origin", "2");
11 var nonConvertibleToString = {toString: function() { throw "Exception in toString()"; }};
12 shouldThrow("new MessageEvent('message', {origin: nonConvertibleToString})", "'Exception in toString()'");
13 </script>
14 </body>
15 </html>