This commit is contained in:
cbiesinger%web.de 2006-09-28 20:56:42 +00:00
Родитель efc58ce4b2
Коммит 93e8d01a5f
2 изменённых файлов: 36 добавлений и 0 удалений

Просмотреть файл

@ -53,3 +53,15 @@ DIRS += lite
endif
include $(topsrcdir)/config/rules.mk
ifdef ENABLE_TESTS
_UNIT_FILES := $(wildcard $(srcdir)/tests/unit/*.js)
libs:: $(_UNIT_FILES)
$(INSTALL) $^ $(DIST)/bin/embedding_unit_tests
check::
$(RUN_TEST_PROGRAM) $(DIST)/bin/test_all.sh $(DIST)/bin/embedding_unit_tests
endif

Просмотреть файл

@ -0,0 +1,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);
}