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="./resources/resizeTestHelper.js"></script> | 4 <script src="./resources/resizeTestHelper.js"></script> |
5 <p>ResizeObserver tests</p> | 5 <p>ResizeObserver tests</p> |
6 <div id="target1" style="width:100px;height:100px;">t1</div> | 6 <div id="target1" style="width:100px;height:100px;">t1</div> |
7 <div id="target2" style="width:100px;height:100px;">t2</div> | 7 <div id="target2" style="width:100px;height:100px;">t2</div> |
8 <img id="target3" style="width:100px;height:100px;"> | 8 <img id="target3" style="width:100px;height:100px;"> |
9 <iframe src="./resources/iframe.html" width="300px" height="100px" style="displa y:block"></iframe> | 9 <iframe src="./resources/iframe.html" width="300px" height="100px" style="displa y:block"></iframe> |
10 <script> | 10 <script> |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 test.done(); | 157 test.done(); |
158 resolvePromise(); | 158 resolvePromise(); |
159 }); | 159 }); |
160 }); | 160 }); |
161 break; | 161 break; |
162 } | 162 } |
163 }, false); | 163 }, false); |
164 return promise; | 164 return promise; |
165 } | 165 } |
166 | 166 |
167 function test7() { | |
168 let harnessTest = async_test("test7: callback.this"); | |
169 let resolvePromise; | |
170 let ro = new ResizeObserver( function(entries, obs) { | |
171 let callbackThis = this; | |
172 resolvePromise(); | |
173 harnessTest.step(() => { | |
174 assert_equals(callbackThis, ro, "callback.this is ResizeObserver"); | |
175 assert_equals(obs, ro, "2nd argument is ResizeObserver"); | |
176 ro.disconnect(); | |
177 ro = null; // must null every reference to RO to prevent leaks | |
eae
2016/09/05 20:52:48
Is this documented anywhere?
esprehn
2016/09/06 01:35:30
Yeah that doesn't seem right, you shouldn't need t
esprehn
2016/09/06 01:35:31
Yeah that doesn't seem right, you shouldn't need t
atotic1
2016/09/06 17:22:37
This is only required to pass run-webkit-tests --e
haraken
2016/09/07 01:59:45
Ah, this makes sense. It's totally valid a thing t
| |
178 callbackThis = null; | |
179 obs = null; | |
180 harnessTest.done(); | |
181 }); | |
182 } | |
183 ); | |
184 ro.observe(t1); | |
185 | |
186 return new Promise( (resolve, reject) => { | |
187 resolvePromise = resolve; | |
188 }); | |
189 } | |
167 let guard = async_test('guard'); | 190 let guard = async_test('guard'); |
168 test0() | 191 test0() |
169 .then(() => { return test1(); }) | 192 .then(() => { return test1(); }) |
170 .then(() => { return test2(); }) | 193 .then(() => { return test2(); }) |
171 .then(() => { return test3(); }) | 194 .then(() => { return test3(); }) |
172 .then(() => { return test4(); }) | 195 .then(() => { return test4(); }) |
173 .then(() => { return test5(); }) | 196 .then(() => { return test5(); }) |
174 .then(() => { return test6(); }) | 197 .then(() => { return test6(); }) |
198 .then(() => { return test7(); }) | |
175 .then(() => { guard.done(); }); | 199 .then(() => { guard.done(); }); |
176 | 200 |
177 </script> | 201 </script> |
OLD | NEW |