diff -r 000000000000 -r 6474c204b198 toolkit/components/thumbnails/test/browser_thumbnails_bg_timeout.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toolkit/components/thumbnails/test/browser_thumbnails_bg_timeout.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,19 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +function runTests() { + let url = bgTestPageURL({ wait: 30000 }); + ok(!thumbnailExists(url), "Thumbnail should not be cached already."); + let numCalls = 0; + BackgroundPageThumbs.capture(url, { + timeout: 0, + onDone: function onDone(capturedURL) { + is(capturedURL, url, "Captured URL should be URL passed to capture"); + is(numCalls++, 0, "onDone should be called only once"); + ok(!thumbnailExists(url), + "Capture timed out so thumbnail should not be cached"); + next(); + }, + }); + yield true; +}