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 description('Unittests for private scripts.'); | 8 description('Unittests for private scripts.'); |
9 if (!internals || !internals.privateScriptTest()) | 9 if (!internals || !internals.privateScriptTest()) |
10 debug('This test needs window.internals.privateScriptTest().'); | 10 debug('This test needs window.internals.privateScriptTest().'); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 shouldBe('privateScriptTest.nodeAttribute', 'node8'); | 63 shouldBe('privateScriptTest.nodeAttribute', 'node8'); |
64 | 64 |
65 shouldThrow('privateScriptTest.nodeAttributeThrowsIndexSizeError'); | 65 shouldThrow('privateScriptTest.nodeAttributeThrowsIndexSizeError'); |
66 shouldThrow('privateScriptTest.nodeAttributeThrowsIndexSizeError = null'); | 66 shouldThrow('privateScriptTest.nodeAttributeThrowsIndexSizeError = null'); |
67 shouldThrow('privateScriptTest.voidMethodThrowsDOMSyntaxError()'); | 67 shouldThrow('privateScriptTest.voidMethodThrowsDOMSyntaxError()'); |
68 shouldThrow('privateScriptTest.voidMethodThrowsError()'); | 68 shouldThrow('privateScriptTest.voidMethodThrowsError()'); |
69 shouldThrow('privateScriptTest.voidMethodThrowsTypeError()'); | 69 shouldThrow('privateScriptTest.voidMethodThrowsTypeError()'); |
70 shouldThrow('privateScriptTest.voidMethodThrowsRangeError()'); | 70 shouldThrow('privateScriptTest.voidMethodThrowsRangeError()'); |
71 shouldThrow('privateScriptTest.voidMethodThrowsSyntaxError()'); | 71 shouldThrow('privateScriptTest.voidMethodThrowsSyntaxError()'); |
72 shouldThrow('privateScriptTest.voidMethodThrowsReferenceError()'); | 72 shouldThrow('privateScriptTest.voidMethodThrowsReferenceError()'); |
| 73 shouldThrow('privateScriptTest.voidMethodThrowsStackOverflowError()'); |
73 | 74 |
74 shouldBe('privateScriptTest.addIntegerImplementedInCPP(111, 222)', '333'); | 75 shouldBe('privateScriptTest.addIntegerImplementedInCPP(111, 222)', '333'); |
75 shouldBeEqualToString('privateScriptTest.stringAttributeImplementedInCPP', 'unde
fined'); | 76 shouldBeEqualToString('privateScriptTest.stringAttributeImplementedInCPP', 'unde
fined'); |
76 privateScriptTest.stringAttributeImplementedInCPP = "foo"; | 77 privateScriptTest.stringAttributeImplementedInCPP = "foo"; |
77 shouldBeEqualToString('privateScriptTest.stringAttributeImplementedInCPP', 'foo'
); | 78 shouldBeEqualToString('privateScriptTest.stringAttributeImplementedInCPP', 'foo'
); |
78 | 79 |
79 // These tests are important. [OnlyExposedToPrivateScript] APIs should not be vi
sible to user's script. | 80 // These tests are important. [OnlyExposedToPrivateScript] APIs should not be vi
sible to user's script. |
80 shouldBeUndefined('privateScriptTest.addIntegerImplementedInCPPForPrivateScriptO
nly'); | 81 shouldBeUndefined('privateScriptTest.addIntegerImplementedInCPPForPrivateScriptO
nly'); |
81 shouldBeUndefined('privateScriptTest.stringAttributeImplementedInCPPForPrivateSc
riptOnly'); | 82 shouldBeUndefined('privateScriptTest.stringAttributeImplementedInCPPForPrivateSc
riptOnly'); |
82 | 83 |
83 shouldBe('privateScriptTest.addIntegerInPartial(111, 222)', '333'); | 84 shouldBe('privateScriptTest.addIntegerInPartial(111, 222)', '333'); |
84 shouldBe('privateScriptTest.addInteger2InPartial(111, 222)', '333'); | 85 shouldBe('privateScriptTest.addInteger2InPartial(111, 222)', '333'); |
85 privateScriptTest.stringAttributeInPartial = "foo"; | 86 privateScriptTest.stringAttributeInPartial = "foo"; |
86 shouldBeEqualToString('privateScriptTest.stringAttributeInPartial', 'foo'); | 87 shouldBeEqualToString('privateScriptTest.stringAttributeInPartial', 'foo'); |
87 | 88 |
88 document.onload = function (event) { | 89 document.onload = function (event) { |
89 shouldBeTrue('event.bubbles'); | 90 shouldBeTrue('event.bubbles'); |
90 shouldBeTrue('event.cancelable'); | 91 shouldBeTrue('event.cancelable'); |
91 // Object properties set in private scripts should not be visible in user's
script. | 92 // Object properties set in private scripts should not be visible in user's
script. |
92 shouldBeUndefined('event.valueInPrivateScript'); | 93 shouldBeUndefined('event.valueInPrivateScript'); |
93 } | 94 } |
94 privateScriptTest.dispatchDocumentOnload(document); | 95 privateScriptTest.dispatchDocumentOnload(document); |
95 | 96 |
96 </script> | 97 </script> |
97 </body> | 98 </body> |
98 </html> | 99 </html> |
OLD | NEW |