Bug 847100 - Make sure dummy thumbnails aren't expired too early when testing thumbnail expiration; r=yoric

This commit is contained in:
Tim Taubert 2013-03-11 13:53:50 +01:00
Родитель 414d887fff
Коммит ccae75cc95
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -51,6 +51,14 @@ function runTests() {
urls.forEach(createDummyThumbnail); urls.forEach(createDummyThumbnail);
ok(urls.every(thumbnailExists), "all dummy thumbnails created"); ok(urls.every(thumbnailExists), "all dummy thumbnails created");
// Make sure our dummy thumbnails aren't expired too early.
let dontExpireDummyURLs = function (cb) cb(urls);
PageThumbs.addExpirationFilter(dontExpireDummyURLs);
registerCleanupFunction(function () {
PageThumbs.removeExpirationFilter(dontExpireDummyURLs);
});
// Expire thumbnails and expect 10 remaining. // Expire thumbnails and expect 10 remaining.
yield expireThumbnails([]); yield expireThumbnails([]);
let remainingURLs = [u for (u of urls) if (thumbnailExists(u))]; let remainingURLs = [u for (u of urls) if (thumbnailExists(u))];