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

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

Issue 360703003: Implement Blink-in-JS for DOM methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/dom/private_script_unittest-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description('Unittests for private scripts.');
9 if (internals)
10 debug('This test needs window.internals.');
11
12 internals.doNothing();
13 shouldBe('internals.return123()', '123');
14 shouldBe('internals.echoInteger(111)', '111');
15 shouldBeEqualToString('internals.echoString("foo")', 'foo')
16 shouldBe('internals.addInteger(111, 222)', '333');
17 shouldBeEqualToString('internals.addString("foo", "bar")', 'foobar')
18
19 shouldBe('internals.getIntegerFromPrototype()', '0');
20 internals.setIntegerToPrototype(123);
21 shouldBe('internals.getIntegerFromPrototype()', '123');
22
23 shouldBe('internals.getIntegerFromDocument(document)', '0');
24 internals.setIntegerToDocument(document, 123);
25 shouldBe('internals.getIntegerFromDocument(document)', '123');
26
27 var node1 = internals.createElement(document);
28 var node2 = internals.createElement(document);
29 var node3 = internals.createElement(document);
30 var node4 = internals.createElement(document);
31 internals.appendChild(node1, node2);
32 internals.appendChild(node1, node3);
33 internals.appendChild(node1, node4);
34 shouldBe('internals.firstChild(node1)', 'node2');
35 shouldBe('internals.nextSibling(node2)', 'node3');
36 shouldBe('internals.nextSibling(node3)', 'node4');
37 shouldBe('internals.nextSibling(node4)', 'null');
38
39 var node5 = internals.createElement(document);
40 shouldBeEqualToString('internals.innerHTML(node5)', '')
41 internals.setInnerHTML(node5, '<div>foo</div>');
42 shouldBeEqualToString('internals.innerHTML(node5)', '<div>foo</div>')
43 var node6 = internals.firstChild(node5);
44 shouldBeEqualToString('internals.innerHTML(node6)', 'foo');
45
46 var node7 = internals.createElement(document);
47 shouldBeEqualToString('internals.innerHTML(node7)', '')
48 internals.addClickListener(node7);
49 internals.clickNode(document, node7);
50 shouldBeEqualToString('internals.innerHTML(node7)', 'clicked')
51
52 </script>
53 </body>
54 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/dom/private_script_unittest-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698