Index: LayoutTests/fast/forms/associatedFormControls-leak-nodes.html |
diff --git a/LayoutTests/fast/forms/associatedFormControls-leak-nodes.html b/LayoutTests/fast/forms/associatedFormControls-leak-nodes.html |
index 0b7af5004844caace3842b8de4ca48086b9bbeec..1325d06999a507fd24a726c6466987791caca1ea 100644 |
--- a/LayoutTests/fast/forms/associatedFormControls-leak-nodes.html |
+++ b/LayoutTests/fast/forms/associatedFormControls-leak-nodes.html |
@@ -8,19 +8,25 @@ |
if (!window.internals) { |
debug("This test only runs on \"content_shell --dump-render-tree\", as it requires existence of window.internals."); |
} else { |
- gc(); |
- var documentsBefore = window.internals.numberOfLiveDocuments(); |
+ testRunner.waitUntilDone(); |
+ var documentsBefore; |
+ var documentsAfter; |
+ collectGarbage(function() { |
+ documentsBefore = window.internals.numberOfLiveDocuments(); |
- var frame = document.getElementById('frame'); |
- frame.contentDocument.body.innerHTML = '<form></form>'; |
- document.body.removeChild(frame); |
- frame = null; |
+ var frame = document.getElementById('frame'); |
+ frame.contentDocument.body.innerHTML = '<form></form>'; |
+ document.body.removeChild(frame); |
+ frame = null; |
- gc(); |
- var documentsAfter = window.internals.numberOfLiveDocuments(); |
+ collectGarbage(function() { |
+ documentsAfter = window.internals.numberOfLiveDocuments(); |
- // -1 is from removing frame itself. |
- shouldBe('documentsBefore - 1', 'documentsAfter'); |
+ // -1 is from removing frame itself. |
+ shouldBe('documentsBefore - 1', 'documentsAfter'); |
+ testRunner.notifyDone(); |
+ }); |
+ }); |
} |
</script> |
</body> |