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 function TestRegistrationContextSharing(window, documentA, documentB) { | 7 function TestRegistrationContextSharing(window, documentA, documentB) { |
8 this.window = window; | 8 this.window = window; |
9 this.documentA = documentA; | 9 this.documentA = documentA; |
10 this.documentB = documentB; | 10 this.documentB = documentB; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 var documentA; | 139 var documentA; |
140 | 140 |
141 t.step(function () { | 141 t.step(function () { |
142 // FIXME: When inserting a <link> within a frame triggers an import, | 142 // FIXME: When inserting a <link> within a frame triggers an import, |
143 // run this part of the test in isolation within a frame. | 143 // run this part of the test in isolation within a frame. |
144 documentA = document; | 144 documentA = document; |
145 | 145 |
146 link = documentA.createElement('link'); | 146 link = documentA.createElement('link'); |
147 link.rel = 'import'; | 147 link.rel = 'import'; |
148 link.href = 'resources/empty-document.html'; | 148 link.href = 'resources/empty-document.html'; |
149 link.onload = function() { | |
150 t.step(function () { | |
dominicc (has gone to gerrit)
2013/09/10 23:06:30
You can use step_func for this.
| |
151 var documentB = link.import; | |
152 var tester = new TestRegistrationContextSharing(window, | |
153 documentA, documentB ); | |
154 tester.testRegistrationContextIsShared(); | |
155 t.done(); | |
156 }); | |
157 }; | |
149 documentA.head.appendChild(link); | 158 documentA.head.appendChild(link); |
150 | |
151 // FIXME: When imports raise the 'load' event, use that instead of | |
152 // polling. | |
153 waitForLinkToLoad(); | |
154 }); | 159 }); |
155 | 160 |
156 function waitForLinkToLoad() { | |
157 if (!link.import) { | |
158 setTimeout(waitForLinkToLoad, 100); | |
159 return; | |
160 } | |
161 | |
162 t.step(function () { | |
163 var documentB = link.import; | |
164 var tester = new TestRegistrationContextSharing(window, | |
165 documentA, documentB); | |
166 tester.testRegistrationContextIsShared(); | |
167 t.done(); | |
168 }); | |
169 } | |
170 | |
171 })(); | 161 })(); |
172 | 162 |
173 </script> | 163 </script> |
OLD | NEW |