toolkit/components/thumbnails/test/browser_thumbnails_bg_no_auth_prompt.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 * http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 3
michael@0 4 // the following tests attempt to display modal dialogs. The test just
michael@0 5 // relies on the fact that if the dialog was displayed the test will hang
michael@0 6 // and timeout. IOW - the tests would pass if the dialogs appear and are
michael@0 7 // manually closed by the user - so don't do that :) (obviously there is
michael@0 8 // noone available to do that when run via tbpl etc, so this should be safe,
michael@0 9 // and it's tricky to use the window-watcher to check a window *does not*
michael@0 10 // appear - how long should the watcher be active before assuming it's not
michael@0 11 // going to appear?)
michael@0 12 function runTests() {
michael@0 13 let url = "http://mochi.test:8888/browser/browser/base/content/test/general/authenticate.sjs?user=anyone";
michael@0 14 ok(!thumbnailExists(url), "Thumbnail file should not already exist.");
michael@0 15
michael@0 16 let capturedURL = yield bgCapture(url);
michael@0 17 is(capturedURL, url, "Captured URL should be URL passed to capture.");
michael@0 18 ok(thumbnailExists(url),
michael@0 19 "Thumbnail file should exist even though it requires auth.");
michael@0 20 removeThumbnail(url);
michael@0 21 }

mercurial