Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(628)

Side by Side Diff: LayoutTests/fast/dom/NodeIterator/NodeIterator-dont-overcollect.html

Issue 21274004: Fix Document leak from NodeFilter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: don't print numberOfLiveDocuments when test passed Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../js/resources/js-test-pre.js"></script>
5 <script>
6 var callbackWasTriggered = false;
7
8 var callback = function(node) {
9 callbackWasTriggered = true;
10 return NodeFilter.FILTER_ACCEPT;
11 };
12 var nodeIterator = document.createNodeIterator(document, NodeFilter.SHOW_ELE MENT, callback, false);
13
14 var callbackObservation = internals.observeGC(callback);
15 callback = null;
16 var nodeFilterObservation = internals.observeGC(nodeIterator.filter);
17 var nodeIteratorObservation = internals.observeGC(nodeIterator);
18
19 gc();
20 shouldBeFalse('nodeFilterObservation.wasCollected');
21 shouldBeFalse('callbackObservation.wasCollected');
22
23 nodeIterator.nextNode();
24 shouldBeTrue('callbackWasTriggered');
25
26 nodeIterator = null;
27 gc();
28 shouldBeTrue('nodeIteratorObservation.wasCollected');
29 shouldBeTrue('nodeFilterObservation.wasCollected');
30 shouldBeTrue('callbackObservation.wasCollected');
31 </script>
32 <script src="../../js/resources/js-test-post.js"></script>
33 </body>
34 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698