| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 shouldBeEqualToString('privateScriptTest.stringAttribute', 'foo'); | 59 shouldBeEqualToString('privateScriptTest.stringAttribute', 'foo'); |
| 60 shouldBe('privateScriptTest.nodeAttribute', 'null'); | 60 shouldBe('privateScriptTest.nodeAttribute', 'null'); |
| 61 var node8 = privateScriptTest.createElement(document); | 61 var node8 = privateScriptTest.createElement(document); |
| 62 privateScriptTest.nodeAttribute = node8; | 62 privateScriptTest.nodeAttribute = node8; |
| 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.voidMethodThrowsSyntaxError()'); | 67 shouldThrow('privateScriptTest.voidMethodThrowsSyntaxError()'); |
| 68 | 68 |
| 69 shouldBe('privateScriptTest.addIntegerImplementedInCPP(111, 222)', '333'); |
| 70 shouldBeEqualToString('privateScriptTest.stringAttributeImplementedInCPP', 'unde
fined'); |
| 71 privateScriptTest.stringAttributeImplementedInCPP = "foo"; |
| 72 shouldBeEqualToString('privateScriptTest.stringAttributeImplementedInCPP', 'foo'
); |
| 73 |
| 74 // These tests are important. [OnlyExposedToPrivateScript] APIs should not be vi
sible to user's JavaScript. |
| 75 shouldBeUndefined('privateScriptTest.addIntegerImplementedInCPPForPrivateScriptO
nly'); |
| 76 shouldBeUndefined('privateScriptTest.stringAttributeImplementedInCPPForPrivateSc
riptOnly'); |
| 77 |
| 69 </script> | 78 </script> |
| 70 </body> | 79 </body> |
| 71 </html> | 80 </html> |
| OLD | NEW |