toolkit/components/thumbnails/test/browser_thumbnails_bg_no_auth_prompt.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_no_auth_prompt.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,21 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +// the following tests attempt to display modal dialogs.  The test just
     1.8 +// relies on the fact that if the dialog was displayed the test will hang
     1.9 +// and timeout.  IOW - the tests would pass if the dialogs appear and are
    1.10 +// manually closed by the user - so don't do that :)  (obviously there is
    1.11 +// noone available to do that when run via tbpl etc, so this should be safe,
    1.12 +// and it's tricky to use the window-watcher to check a window *does not*
    1.13 +// appear - how long should the watcher be active before assuming it's not
    1.14 +// going to appear?)
    1.15 +function runTests() {
    1.16 +  let url = "http://mochi.test:8888/browser/browser/base/content/test/general/authenticate.sjs?user=anyone";
    1.17 +  ok(!thumbnailExists(url), "Thumbnail file should not already exist.");
    1.18 +
    1.19 +  let capturedURL = yield bgCapture(url);
    1.20 +  is(capturedURL, url, "Captured URL should be URL passed to capture.");
    1.21 +  ok(thumbnailExists(url),
    1.22 +     "Thumbnail file should exist even though it requires auth.");
    1.23 +  removeThumbnail(url);
    1.24 +}

mercurial