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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/CharacterData-data.html

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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>CharacterData.data</title>
4 <link rel=help href="https://dom.spec.whatwg.org/#dom-characterdata-data">
5 <script src="../../../../resources/testharness.js"></script>
6 <script src="../../../../resources/testharnessreport.js"></script>
7 <div id="log"></div>
8 <script>
9 function testNode(create, type) {
10 test(function() {
11 var node = create()
12 assert_equals(node.data, "test")
13 assert_equals(node.length, 4)
14 }, type + ".data initial value")
15
16 test(function() {
17 var node = create()
18 assert_equals(node.data, "test")
19
20 node.data = null;
21 assert_equals(node.data, "")
22 assert_equals(node.length, 0)
23 }, type + ".data = null")
24
25 test(function() {
26 var node = create()
27 assert_equals(node.data, "test")
28
29 node.data = undefined;
30 assert_equals(node.data, "undefined")
31 assert_equals(node.length, 9)
32 }, type + ".data = undefined")
33
34 test(function() {
35 var node = create()
36 assert_equals(node.data, "test")
37
38 node.data = 0;
39 assert_equals(node.data, "0")
40 assert_equals(node.length, 1)
41 }, type + ".data = 0")
42
43 test(function() {
44 var node = create()
45 assert_equals(node.data, "test")
46
47 node.data = "";
48 assert_equals(node.data, "")
49 assert_equals(node.length, 0)
50 }, type + ".data = ''")
51
52 test(function() {
53 var node = create()
54 assert_equals(node.data, "test")
55
56 node.data = "--";
57 assert_equals(node.data, "--")
58 assert_equals(node.length, 2)
59 }, type + ".data = '--'")
60
61 test(function() {
62 var node = create()
63 assert_equals(node.data, "test")
64
65 node.data = "資料";
66 assert_equals(node.data, "資料")
67 assert_equals(node.length, 2)
68 }, type + ".data = '資料'")
69
70 test(function() {
71 var node = create()
72 assert_equals(node.data, "test")
73
74 node.data = "🌠 test 🌠 TEST";
75 assert_equals(node.data, "🌠 test 🌠 TEST")
76 assert_equals(node.length, 15) // Counting UTF-16 code units
77 }, type + ".data = '🌠 test 🌠 TEST'")
78 }
79
80 testNode(function() { return document.createTextNode("test") }, "Text")
81 testNode(function() { return document.createComment("test") }, "Comment")
82 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698