From d8de162bbc5d56efd4c83167444ceadafa7c8e4a Mon Sep 17 00:00:00 2001 From: David Greenspan Date: Sun, 16 Sep 2012 04:37:20 -0700 Subject: [PATCH] use atFlush in UI test helpers --- packages/test-helpers/onscreendiv.js | 4 +--- packages/test-helpers/wrappedfrag.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/test-helpers/onscreendiv.js b/packages/test-helpers/onscreendiv.js index 0495f28abc..0bf7cc0a80 100644 --- a/packages/test-helpers/onscreendiv.js +++ b/packages/test-helpers/onscreendiv.js @@ -50,11 +50,9 @@ OnscreenDiv.prototype.kill = function() { if (self.div.parentNode) self.div.parentNode.removeChild(self.div); - var cx = new Meteor.deps.Context; - cx.on_invalidate(function() { + Meteor.atFlush(function () { Spark.finalize(self.div); }); - cx.invalidate(); }; // remove the DIV from the document diff --git a/packages/test-helpers/wrappedfrag.js b/packages/test-helpers/wrappedfrag.js index 5c45b26dd5..e99ff653f5 100644 --- a/packages/test-helpers/wrappedfrag.js +++ b/packages/test-helpers/wrappedfrag.js @@ -31,13 +31,11 @@ WrappedFrag.prototype.release = function() { // decrement frag's GC protection reference count // Clean up on flush, if hits 0. Wait to decrement // so no one else cleans it up first. - var cx = new Meteor.deps.Context; - cx.on_invalidate(function() { + Meteor.atFlush(function () { if (! --frag["_protect"]) { Spark.finalize(frag); } }); - cx.invalidate(); return this; };