mozilla-b2g/gaia-email-libs-and-more — pull request #96 by asutherland (2012-12-08 08:42:58+00:00)
Title: Bug 799828 - [email/IMAP] data eviction from cache; discard messages outside sync window periodically

https://bugzilla.mozilla.org/show_bug.cgi?id=799828

r? @mozsquib

This adds:
- excess message purging for IMAP with tests in test_folder_storage.js for the low-level mechanics, and test_torture_imap.js for the triggering of the job that causes the purge.
- cache flushing for everybody with tests in test_folder_storage.js and some new console.log() calls on discard to make it obvious when it's happening (or failing to happen)
- fixes to the body size estimate logic; IMAP was screwing up and ActiveSync was't computing size at all. I moved the estimate logic into mailslice.js to deal with that.