embedding/tests/unit/test_wwpromptfactory.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.

     1 function run_test() {
     2   // Make sure that getting both nsIAuthPrompt and nsIAuthPrompt2 works
     3   // (these should work independently of whether the application has
     4   // nsIPromptService2)
     5   var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
     6                      .getService();
     8   var prompt;
    10   prompt = ww.nsIWindowWatcher.getNewPrompter(null);
    11   do_check_neq(prompt, null);
    12   prompt = ww.nsIWindowWatcher.getNewAuthPrompter(null);
    13   do_check_neq(prompt, null);
    15   prompt = ww.nsIPromptFactory.getPrompt(null,
    16                                          Components.interfaces.nsIPrompt);
    17   do_check_neq(prompt, null);
    18   prompt = ww.nsIPromptFactory.getPrompt(null,
    19                                          Components.interfaces.nsIAuthPrompt);
    20   do_check_neq(prompt, null);
    21   prompt = ww.nsIPromptFactory.getPrompt(null,
    22                                          Components.interfaces.nsIAuthPrompt2);
    23   do_check_neq(prompt, null);
    24 }

mercurial