OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
4 <script src="test-harness-utils.js"></script> | 4 <script src="test-harness-utils.js"></script> |
5 <body> | 5 <body> |
6 <script> | 6 <script> |
7 test(function() { | 7 test(function() { |
8 var createdInvocations = 0; | 8 var createdInvocations = 0; |
9 function created() { | 9 function created() { |
10 createdInvocations++; | 10 createdInvocations++; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 assert_array_equals( | 105 assert_array_equals( |
106 messages, | 106 messages, |
107 ['created started', 'created finished', 'entered', 'left', | 107 ['created started', 'created finished', 'entered', 'left', |
108 'attribute changed', 'done'], | 108 'attribute changed', 'done'], |
109 'callbacks should not be dispatched until the created callback has ' + | 109 'callbacks should not be dispatched until the created callback has ' + |
110 'finished'); | 110 'finished'); |
111 t.done(); | 111 t.done(); |
112 })); | 112 })); |
113 | 113 |
114 })(); | 114 })(); |
115 | |
116 (function() { | |
117 | |
118 t = async_test('callback is called even if the element is moved to foreign docum ent'); | |
119 var callbackInvoked = false; | |
120 | |
121 withFrame(t.step_func(function(originalFrame) { | |
122 withFrame(function(destinationFrame) { | |
123 var protoA = Object.create(originalFrame.contentWindow.HTMLElement.proto type); | |
124 protoA.createdCallback = function() { | |
125 var toBeMoved = originalFrame.contentDocument.getElementById("toBeMo ved"); | |
dominicc (has gone to gerrit)
2013/12/18 08:46:41
Use single-quoted string literal for consistency.
Hajime Morrita
2013/12/19 05:06:59
Done.
| |
126 destinationFrame.contentDocument.body.appendChild(toBeMoved); | |
127 }; | |
128 | |
129 var protoB = Object.create(originalFrame.contentWindow.HTMLElement.proto type); | |
130 protoB.createdCallback = function() { | |
131 callbackInvoked = true; | |
132 }; | |
133 | |
134 originalFrame.contentDocument.register('x-a', {prototype: protoA}); | |
135 originalFrame.contentDocument.register('x-b', {prototype: protoB}); | |
136 originalFrame.contentDocument.body.innerHTML = "<x-a></x-a><x-b id='toBe Moved'></x-b>"; | |
dominicc (has gone to gerrit)
2013/12/18 08:46:41
...also here.
Hajime Morrita
2013/12/19 05:06:59
Done.
| |
137 assert_true(callbackInvoked); | |
138 | |
139 t.done(); | |
140 }); | |
141 })); | |
142 | |
143 })(); | |
115 </script> | 144 </script> |
OLD | NEW |