summaryrefslogtreecommitdiffstats
path: root/embedding/tests/unit/test_wwpromptfactory.js
blob: d595988c98e856fd746102d8e408a40cdf88d333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function run_test() {
  // Make sure that getting both nsIAuthPrompt and nsIAuthPrompt2 works
  // (these should work independently of whether the application has
  // nsIPromptService2)
  var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
                     .getService();

  var prompt;

  prompt = ww.nsIWindowWatcher.getNewPrompter(null);
  do_check_neq(prompt, null);
  prompt = ww.nsIWindowWatcher.getNewAuthPrompter(null);
  do_check_neq(prompt, null);

  prompt = ww.nsIPromptFactory.getPrompt(null,
                                         Components.interfaces.nsIPrompt);
  do_check_neq(prompt, null);
  prompt = ww.nsIPromptFactory.getPrompt(null,
                                         Components.interfaces.nsIAuthPrompt);
  do_check_neq(prompt, null);
  prompt = ww.nsIPromptFactory.getPrompt(null,
                                         Components.interfaces.nsIAuthPrompt2);
  do_check_neq(prompt, null);
}