diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /security/manager/ssl/tests/unit/test_pkcs11_slot.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'security/manager/ssl/tests/unit/test_pkcs11_slot.js')
-rw-r--r-- | security/manager/ssl/tests/unit/test_pkcs11_slot.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/security/manager/ssl/tests/unit/test_pkcs11_slot.js b/security/manager/ssl/tests/unit/test_pkcs11_slot.js new file mode 100644 index 000000000..8aebf0439 --- /dev/null +++ b/security/manager/ssl/tests/unit/test_pkcs11_slot.js @@ -0,0 +1,38 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +// Any copyright is dedicated to the Public Domain. +// http://creativecommons.org/publicdomain/zero/1.0/ +"use strict"; + +// Tests the methods and attributes for interfacing with a PKCS #11 slot. + +// Ensure that the appropriate initialization has happened. +do_get_profile(); + +function run_test() { + loadPKCS11TestModule(false); + + let moduleDB = Cc["@mozilla.org/security/pkcs11moduledb;1"] + .getService(Ci.nsIPKCS11ModuleDB); + let testModule = moduleDB.findModuleByName("PKCS11 Test Module"); + let testSlot = testModule.findSlotByName("Test PKCS11 Slot 二"); + + equal(testSlot.name, "Test PKCS11 Slot 二", + "Actual and expected name should match"); + equal(testSlot.desc, "Test PKCS11 Slot 二", + "Actual and expected description should match"); + equal(testSlot.manID, "Test PKCS11 Manufacturer ID", + "Actual and expected manufacturer ID should match"); + equal(testSlot.HWVersion, "0.0", + "Actual and expected hardware version should match"); + equal(testSlot.FWVersion, "0.0", + "Actual and expected firmware version should match"); + equal(testSlot.status, Ci.nsIPKCS11Slot.SLOT_READY, + "Actual and expected status should match"); + equal(testSlot.tokenName, "Test PKCS11 Tokeñ 2 Label", + "Actual and expected token name should match"); + + let testToken = testSlot.getToken(); + notEqual(testToken, null, "getToken() should succeed"); + equal(testToken.tokenLabel, "Test PKCS11 Tokeñ 2 Label", + "Spot check: the actual and expected test token labels should be equal"); +} |