OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../resources/js-test.js"></script> | 2 <script src="../resources/js-test.js"></script> |
3 <script src="../resources/gc.js"></script> | 3 <script src="../resources/gc.js"></script> |
4 <div style="width:100%; height:700px;"></div> | 4 <div style="width:100%; height:700px;"></div> |
5 <div id="target" style="background-color: green; width:100px; height:100px"></di v> | 5 <div id="target" style="background-color: green; width:100px; height:100px"></di v> |
6 <div style="width:100%; height:700px;"></div> | 6 <div style="width:100%; height:700px;"></div> |
7 | 7 |
8 <script> | 8 <script> |
9 jsTestIsAsync = true; | 9 jsTestIsAsync = true; |
10 description("IntersectionObserver continues to produce notifications when it h as no javascript references."); | 10 description("IntersectionObserver continues to produce notifications when it has no javascript references."); |
11 var target = document.getElementById("target"); | 11 var target = document.getElementById("target"); |
12 var entries = []; | 12 var entries = []; |
13 new IntersectionObserver(function(changes) { | 13 new IntersectionObserver(function(changes) { |
14 entries.push(...changes); | 14 entries.push(...changes); |
15 }).observe(target); | 15 }).observe(target); |
16 gc(); | 16 gc(); |
17 document.scrollingElement.scrollTop = 300; | 17 document.scrollingElement.scrollTop = 300; |
18 requestAnimationFrame(function () { | 18 requestAnimationFrame(() => { requestAnimationFrame(() => { |
19 setTimeout(function() { | 19 setTimeout(() => { |
20 shouldBeEqualToNumber("entries.length", 1); | 20 shouldBeEqualToNumber("entries.length", 1); |
21 finishJSTest(); | 21 finishJSTest(); |
22 }); | 22 }, 100); |
Sami
2016/03/08 17:32:42
Is there a chance this could add some flake?
szager1
2016/03/08 18:51:32
In other tests, I added a call to observer.takeRec
Sami
2016/03/09 18:29:55
I see, that makes sense. Maybe also add correspond
szager1
2016/03/09 20:45:25
Done.
| |
23 }); | 23 }) }); |
24 </script> | 24 </script> |
OLD | NEW |