Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/js-test.js"></script> | |
|
foolip
2016/12/08 16:28:59
It looks like this test doesn't depend on any inte
Sami
2016/12/09 17:24:36
I'll give it a shot. This was just a carbon copy o
| |
| 3 <script src="../resources/intersection-observer-helper-functions.js"></script> | |
| 4 <div id='target' style='width:0px; height:0px; position: fixed; top: -1000px'</d iv>" | |
| 5 <script> | |
| 6 description("Ensure that a hidden zero-area element is treated correctly."); | |
|
foolip
2016/12/08 16:28:59
With testharness.js this can go in <title>, if the
| |
| 7 | |
| 8 var entries = []; | |
| 9 var target; | |
| 10 | |
| 11 onload = function() { | |
|
foolip
2016/12/08 16:28:59
Does the test need to wait for the window load eve
Sami
2016/12/09 17:24:36
You're right -- there's no need to wait for anythi
| |
| 12 target = document.getElementById("target"); | |
| 13 new IntersectionObserver((changes) => { | |
| 14 entries.push(...changes); | |
| 15 }).observe(target); | |
| 16 waitForNotification(step0); | |
|
foolip
2016/12/08 16:28:59
With testharness.js, this would be:
waitForNotific
Sami
2016/12/09 17:24:36
Done.
| |
| 17 }; | |
| 18 | |
| 19 function step0() { | |
| 20 // Since the element is initially assumed to be hidden, there are no entries. | |
| 21 shouldBeEqualToNumber("entries.length", 0); | |
| 22 finishJSTest(); | |
| 23 } | |
| 24 </script> | |
| OLD | NEW |