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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/dom/private_script_unittest-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/private_script_unittest.html
diff --git a/LayoutTests/fast/dom/private_script_unittest.html b/LayoutTests/fast/dom/private_script_unittest.html
new file mode 100644
index 0000000000000000000000000000000000000000..2d5aba1f8fd4aa5d478179879e3f3b6e63b38f9f
--- /dev/null
+++ b/LayoutTests/fast/dom/private_script_unittest.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<script>
+description('Unittests for private scripts.');
+if (internals)
+ debug('This test needs window.internals.');
+
+internals.doNothing();
+shouldBe('internals.return123()', '123');
+shouldBe('internals.echoInteger(111)', '111');
+shouldBeEqualToString('internals.echoString("foo")', 'foo')
+shouldBe('internals.addInteger(111, 222)', '333');
+shouldBeEqualToString('internals.addString("foo", "bar")', 'foobar')
+
+shouldBe('internals.getIntegerFromPrototype()', '0');
+internals.setIntegerToPrototype(123);
+shouldBe('internals.getIntegerFromPrototype()', '123');
+
+shouldBe('internals.getIntegerFromDocument(document)', '0');
+internals.setIntegerToDocument(document, 123);
+shouldBe('internals.getIntegerFromDocument(document)', '123');
+
+var node1 = internals.createElement(document);
+var node2 = internals.createElement(document);
+var node3 = internals.createElement(document);
+var node4 = internals.createElement(document);
+internals.appendChild(node1, node2);
+internals.appendChild(node1, node3);
+internals.appendChild(node1, node4);
+shouldBe('internals.firstChild(node1)', 'node2');
+shouldBe('internals.nextSibling(node2)', 'node3');
+shouldBe('internals.nextSibling(node3)', 'node4');
+shouldBe('internals.nextSibling(node4)', 'null');
+
+var node5 = internals.createElement(document);
+shouldBeEqualToString('internals.innerHTML(node5)', '')
+internals.setInnerHTML(node5, '<div>foo</div>');
+shouldBeEqualToString('internals.innerHTML(node5)', '<div>foo</div>')
+var node6 = internals.firstChild(node5);
+shouldBeEqualToString('internals.innerHTML(node6)', 'foo');
+
+var node7 = internals.createElement(document);
+shouldBeEqualToString('internals.innerHTML(node7)', '')
+internals.addClickListener(node7);
+internals.clickNode(document, node7);
+shouldBeEqualToString('internals.innerHTML(node7)', 'clicked')
+
+</script>
+</body>
+</html>
« 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