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

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Document-createComment-createTextNode.js

Issue 1529523002: Import dom/ from web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak W3CImportExpectations Created 5 years 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
Index: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Document-createComment-createTextNode.js
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Document-createComment-createTextNode.js b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Document-createComment-createTextNode.js
new file mode 100644
index 0000000000000000000000000000000000000000..62a38d380da6021d57e363ec14fdd410685c07cd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Document-createComment-createTextNode.js
@@ -0,0 +1,22 @@
+function test_create(method, iface, nodeType, nodeName) {
+ ["\u000b", "a -- b", "a-", "-b", null, undefined].forEach(function(value) {
+ test(function() {
+ var c = document[method](value);
+ var expected = String(value);
+ assert_true(c instanceof iface);
+ assert_true(c instanceof CharacterData);
+ assert_true(c instanceof Node);
+ assert_equals(c.ownerDocument, document);
+ assert_equals(c.data, expected, "data");
+ assert_equals(c.nodeValue, expected, "nodeValue");
+ assert_equals(c.textContent, expected, "textContent");
+ assert_equals(c.length, expected.length);
+ assert_equals(c.nodeType, nodeType);
+ assert_equals(c.nodeName, nodeName);
+ assert_equals(c.hasChildNodes(), false);
+ assert_equals(c.childNodes.length, 0);
+ assert_equals(c.firstChild, null);
+ assert_equals(c.lastChild, null);
+ }, method + "(" + format_value(value) + ")");
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698