toolkit/components/thumbnails/test/browser_thumbnails_capture.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_capture.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,20 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +/**
     1.8 + * These tests ensure that capturing a sites's thumbnail, saving it and
     1.9 + * retrieving it from the cache works.
    1.10 + */
    1.11 +function runTests() {
    1.12 +  // Create a tab with a red background.
    1.13 +  yield addTab("data:text/html,<body bgcolor=ff0000></body>");
    1.14 +  yield captureAndCheckColor(255, 0, 0, "we have a red thumbnail");
    1.15 +
    1.16 +  // Load a page with a green background.
    1.17 +  yield navigateTo("data:text/html,<body bgcolor=00ff00></body>");
    1.18 +  yield captureAndCheckColor(0, 255, 0, "we have a green thumbnail");
    1.19 +
    1.20 +  // Load a page with a blue background.
    1.21 +  yield navigateTo("data:text/html,<body bgcolor=0000ff></body>");
    1.22 +  yield captureAndCheckColor(0, 0, 255, "we have a blue thumbnail");
    1.23 +}

mercurial