OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2014 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 <link rel="import" href="/tracing/ui/base/container_that_decorates_its_children.
html"> | 7 <link rel="import" href="/tracing/ui/base/container_that_decorates_its_children.
html"> |
8 <script> | 8 <script> |
9 'use strict'; | 9 'use strict'; |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 }, | 31 }, |
32 | 32 |
33 undecorateChild_: function(child) { | 33 undecorateChild_: function(child) { |
34 assert.isTrue(child.decorated); | 34 assert.isTrue(child.decorated); |
35 child.decorated = false; | 35 child.decorated = false; |
36 } | 36 } |
37 }; | 37 }; |
38 | 38 |
39 test('add', function() { | 39 test('add', function() { |
40 var container = new SimpleContainer(); | 40 var container = new SimpleContainer(); |
41 container.appendChild(createChild()); | 41 Polymer.dom(container).appendChild(createChild()); |
42 container.appendChild(createChild()); | 42 Polymer.dom(container).appendChild(createChild()); |
43 container.appendChild(createChild()); | 43 Polymer.dom(container).appendChild(createChild()); |
44 assert.isTrue(container.children[0].decorated); | 44 assert.isTrue(container.children[0].decorated); |
45 assert.isTrue(container.children[1].decorated); | 45 assert.isTrue(container.children[1].decorated); |
46 assert.isTrue(container.children[2].decorated); | 46 assert.isTrue(container.children[2].decorated); |
47 }); | 47 }); |
48 | 48 |
49 test('clearUsingTextContent', function() { | 49 test('clearUsingTextContent', function() { |
50 var c0 = createChild(); | 50 var c0 = createChild(); |
51 var container = new SimpleContainer(); | 51 var container = new SimpleContainer(); |
52 container.appendChild(c0); | 52 Polymer.dom(container).appendChild(c0); |
53 container.textContent = ''; | 53 container.textContent = ''; |
54 assert.isFalse(c0.decorated); | 54 assert.isFalse(c0.decorated); |
55 }); | 55 }); |
56 | 56 |
57 test('clear', function() { | 57 test('clear', function() { |
58 var c0 = createChild(); | 58 var c0 = createChild(); |
59 var container = new SimpleContainer(); | 59 var container = new SimpleContainer(); |
60 container.appendChild(c0); | 60 Polymer.dom(container).appendChild(c0); |
61 container.clear(); | 61 container.clear(); |
62 assert.isFalse(c0.decorated); | 62 assert.isFalse(c0.decorated); |
63 }); | 63 }); |
64 | 64 |
65 test('insertNewBefore', function() { | 65 test('insertNewBefore', function() { |
66 var c0 = createChild(); | 66 var c0 = createChild(); |
67 var c1 = createChild(); | 67 var c1 = createChild(); |
68 var container = new SimpleContainer(); | 68 var container = new SimpleContainer(); |
69 container.appendChild(c1); | 69 Polymer.dom(container).appendChild(c1); |
70 container.insertBefore(c0, c1); | 70 container.insertBefore(c0, c1); |
71 assert.isTrue(c0.decorated); | 71 assert.isTrue(c0.decorated); |
72 assert.isTrue(c1.decorated); | 72 assert.isTrue(c1.decorated); |
73 }); | 73 }); |
74 | 74 |
75 test('insertExistingBefore', function() { | 75 test('insertExistingBefore', function() { |
76 var c0 = createChild(); | 76 var c0 = createChild(); |
77 var c1 = createChild(); | 77 var c1 = createChild(); |
78 var container = new SimpleContainer(); | 78 var container = new SimpleContainer(); |
79 container.appendChild(c1); | 79 Polymer.dom(container).appendChild(c1); |
80 container.appendChild(c0); | 80 Polymer.dom(container).appendChild(c0); |
81 container.insertBefore(c0, c1); | 81 container.insertBefore(c0, c1); |
82 assert.isTrue(c0.decorated); | 82 assert.isTrue(c0.decorated); |
83 assert.isTrue(c1.decorated); | 83 assert.isTrue(c1.decorated); |
84 }); | 84 }); |
85 | 85 |
86 test('testReplace', function() { | 86 test('testReplace', function() { |
87 var c0 = createChild(); | 87 var c0 = createChild(); |
88 var c1 = createChild(); | 88 var c1 = createChild(); |
89 var container = new SimpleContainer(); | 89 var container = new SimpleContainer(); |
90 container.appendChild(c0); | 90 Polymer.dom(container).appendChild(c0); |
91 container.replaceChild(c1, c0); | 91 container.replaceChild(c1, c0); |
92 assert.isFalse(c0.decorated); | 92 assert.isFalse(c0.decorated); |
93 assert.isTrue(c1.decorated); | 93 assert.isTrue(c1.decorated); |
94 }); | 94 }); |
95 | 95 |
96 }); | 96 }); |
97 </script> | 97 </script> |
OLD | NEW |