OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script> | 7 <script> |
8 | 8 |
9 description("This tests the constructor for the CustomEvent DOM class."); | 9 description("This tests the constructor for the CustomEvent DOM class."); |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 // Detail is a string | 24 // Detail is a string |
25 shouldBe("new CustomEvent('eventType', { detail: \'string\' }).detail", "'string
'"); | 25 shouldBe("new CustomEvent('eventType', { detail: \'string\' }).detail", "'string
'"); |
26 | 26 |
27 // Detail is an object | 27 // Detail is an object |
28 var detailObject = { }; | 28 var detailObject = { }; |
29 shouldBe("new CustomEvent('eventType', { detail: detailObject }).detail", "detai
lObject"); | 29 shouldBe("new CustomEvent('eventType', { detail: detailObject }).detail", "detai
lObject"); |
30 | 30 |
31 // Detail is a DOM object | 31 // Detail is a DOM object |
32 shouldBe("new CustomEvent('eventType', { detail: document }).detail", "document"
); | 32 shouldBe("new CustomEvent('eventType', { detail: document }).detail", "document"
); |
33 | 33 |
34 // Detail is undefined. | 34 // Detail is undefined. Since the default value of detail is null, it should |
35 shouldBe("new CustomEvent('eventType', { detail: undefined }).detail", "undefine
d"); | 35 // result in "null". |
| 36 shouldBe("new CustomEvent('eventType', { detail: undefined }).detail", "null"); |
36 | 37 |
37 // Detail is null. | 38 // Detail is null. |
38 shouldBe("new CustomEvent('eventType', { detail: null }).detail", "null"); | 39 shouldBe("new CustomEvent('eventType', { detail: null }).detail", "null"); |
39 | 40 |
40 // Detail is a getter. | 41 // Detail is a getter. |
41 shouldBe("new CustomEvent('eventType', { get detail() { return true; } }).detail
", "true"); | 42 shouldBe("new CustomEvent('eventType', { get detail() { return true; } }).detail
", "true"); |
42 | 43 |
43 // Detail throws an exeception. | 44 // Detail throws an exeception. |
44 shouldThrow("new CustomEvent('eventType', { get detail() { throw 'Custom Error';
} })"); | 45 shouldThrow("new CustomEvent('eventType', { get detail() { throw 'Custom Error';
} })"); |
45 </script> | 46 </script> |
46 </body> | 47 </body> |
47 </html> | 48 </html> |
OLD | NEW |