toolkit/components/thumbnails/test/browser_thumbnails_bg_timeout.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/thumbnails/test/browser_thumbnails_bg_timeout.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,19 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +function runTests() {
     1.8 +  let url = bgTestPageURL({ wait: 30000 });
     1.9 +  ok(!thumbnailExists(url), "Thumbnail should not be cached already.");
    1.10 +  let numCalls = 0;
    1.11 +  BackgroundPageThumbs.capture(url, {
    1.12 +    timeout: 0,
    1.13 +    onDone: function onDone(capturedURL) {
    1.14 +      is(capturedURL, url, "Captured URL should be URL passed to capture");
    1.15 +      is(numCalls++, 0, "onDone should be called only once");
    1.16 +      ok(!thumbnailExists(url),
    1.17 +         "Capture timed out so thumbnail should not be cached");
    1.18 +      next();
    1.19 +    },
    1.20 +  });
    1.21 +  yield true;
    1.22 +}

mercurial