зеркало из https://github.com/mozilla/gecko-dev.git
Bug 883741 - Part 2: testing for null in crypto legacy. r=bz
This commit is contained in:
Родитель
2e2cee1761
Коммит
40c1e002ad
|
@ -24,5 +24,33 @@ ok("signText" in window.crypto, "signText in window.crypto");
|
|||
ok("disableRightClick" in window.crypto,
|
||||
"disableRightClick in window.crypto");
|
||||
|
||||
function jsCallback () {
|
||||
}
|
||||
|
||||
try {
|
||||
window.crypto.generateCRMFRequest(null, null, null, null, jsCallback.toString());
|
||||
ok(false, "window.crypto.generateCRMFRequest failed, should throw error");
|
||||
} catch (e) {
|
||||
ok(e.toString().search(/Failure/) > -1,
|
||||
"Expected error: ReqDN cannot be null");
|
||||
}
|
||||
|
||||
try {
|
||||
window.crypto.generateCRMFRequest(document.documentElement, null, null, null,
|
||||
null);
|
||||
ok(false, "window.crypto.generateCRMFRequest failed, should throw error");
|
||||
} catch (e) {
|
||||
ok(e.toString().search(/Failure/) > -1,
|
||||
"Expected error: jsCallback cannot be null");
|
||||
}
|
||||
|
||||
try {
|
||||
window.crypto.generateCRMFRequest(document.documentElement, null, null, null,
|
||||
jsCallback.toString(), 1024);
|
||||
ok(false, "window.crypto.generateCRMFRequest failed, should throw error");
|
||||
} catch (e) {
|
||||
ok(e.toString().search(/TypeError/) > -1,
|
||||
"Expected error: Not enough arguments");
|
||||
}
|
||||
</script>
|
||||
</body></html>
|
||||
|
|
Загрузка…
Ссылка в новой задаче