Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: LayoutTests/fast/dom/private_script_unittest.html

Issue 553983007: Blink-in-JS: Allow a stackoverflow error thrown by private scripts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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()');
vivekg 2014/09/09 02:06:47 This might be throwing method not found error and
haraken 2014/09/09 02:10:03 Sorry, I was in a rush... Fixed the test case. PTA
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>
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/PrivateScriptRunner.cpp » ('j') | Source/core/testing/PrivateScriptTest.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698