tests: Delay loading old messages and starting get_updates until phantomjs thinks the page has loaded

This doesn't affect code when not in testing.  It shaves 7 seconds off of casper
test time on my machine.

(imported from commit 7e27fa781bcf16f36d9c8f058427ba57c41068bd)
This commit is contained in:
Zev Benjamin
2014-03-06 18:44:15 -05:00
committed by Steve Howell
parent f45f0b1df6
commit bdee9721ec
5 changed files with 18 additions and 3 deletions

View File

@@ -345,6 +345,14 @@ if (typeof $ !== 'undefined') {
};
}
exports.execute_early = function (func) {
if (page_params.test_suite) {
$(document).one('phantom_page_loaded', func);
} else {
$(func);
}
};
return exports;
}());
if (typeof module !== 'undefined') {