зеркало из https://github.com/mozilla/gecko-dev.git
add unit test for bug 354522
This commit is contained in:
Родитель
efc58ce4b2
Коммит
93e8d01a5f
|
@ -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);
|
||||
}
|
Загрузка…
Ссылка в новой задаче