提交 9dcf9a8a 编写于 作者: Q qiaozzzh

New Use Cases for XTS

Signed-off-by: Nqiaozzzh <qiaozhang@huawei.com>
Change-Id: I4dbb15a91319d0f14c34768d37757630436ecf66
上级 0fadb77d
/*
* Copyright (C) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, it, expect, Level } from '@ohos/hypium'
import userAuth from '@ohos.userIAM.userAuth'
export default function signNormalNotAccessBiometricEnumExecute() {
describe('signNormalNotAccessBiometricEnumExecute', function () {
/*
* @tc.number : Security_IAM_userAuthType_Kit_Func_0084
* @tc.name : execute_enum_userAuthType
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level.LEVEL2
*/
it('Security_IAM_userAuthType_Kit_Func_0084', Level.LEVEL2, async function (done) {
console.info('testFace Security_IAM_userAuthType_Kit_Func_0084 start');
expect(1).assertEqual(userAuth.UserAuthType.PIN);
expect(2).assertEqual(userAuth.UserAuthType.FACE);
expect(4).assertEqual(userAuth.UserAuthType.FINGERPRINT);
console.info('Security_IAM_userAuthType_Kit_Func_0084 end');
done();
})
/*
* @tc.number : Security_IAM_widgetNotice_Kit_Func_0085
* @tc.name : execute_enum_windowModeType
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level.LEVEL2
*/
it('Security_IAM_widgetNotice_Kit_Func_0085', Level.LEVEL2, async function (done) {
console.info('Security_IAM_widgetNotice_Kit_Func_0085 start');
expect(1).assertEqual(userAuth.WindowModeType.DIALOG_BOX);
expect(2).assertEqual(userAuth.WindowModeType.FULLSCREEN);
console.info('Security_IAM_widgetNotice_Kit_Func_0085 end');
done();
})
/*
* @tc.number : Security_IAM_widgetNotice_Kit_Func_0086
* @tc.name : execute_enum_noticeType
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level.LEVEL2
*/
it('Security_IAM_widgetNotice_Kit_Func_0086', Level.LEVEL2, async function (done) {
console.info('testFace Security_IAM_widgetNotice_Kit_Func_0086 start');
expect(1).assertEqual(userAuth.NoticeType.WIDGET_NOTICE);
console.info('Security_IAM_widgetNotice_Kit_Func_0086 end');
done();
})
/*
* @tc.number : Security_IAM_userAuthResultCode_Kit_Func_0087
* @tc.name : execute_enum_userAuthResultCode
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level.LEVEL2
*/
it('Security_IAM_userAuthResultCode_Kit_Func_0087', Level.LEVEL2, async function (done) {
console.info('Security_IAM_userAuthResultCode_Kit_Func_0087 start');
expect(12500011).assertEqual(userAuth.UserAuthResultCode.CANCELED_FROM_WIDGET);
console.info('Security_IAM_userAuthResultCode_Kit_Func_0087 end');
done();
})
});
};
\ No newline at end of file
......@@ -14,7 +14,13 @@
*/
import userauthTest from './Security_IAM_PIN_Kit_CallbackJsunit.test.js'
import userauthTest_API9 from './Security_IAM_FUNC_Jsunit.test.js'
import signNormalAccessBiometricExecute from './Execute.test.js'
import signNormalNotAccessBiometricEnumExecute from './Enum.test.js'
import signNormalNotAccessBiometricExecute from './SignNormalNotAccessBiometricExecute.test.js'
export default function testsuite() {
userauthTest()
userauthTest_API9()
signNormalAccessBiometricExecute()
signNormalNotAccessBiometricEnumExecute()
signNormalNotAccessBiometricExecute()
}
/*
* Copyright (C) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, it, expect, Level } from '@ohos/hypium'
import userAuth from '@ohos.userIAM.userAuth'
const authParamDefault = {
challenge: new Uint8Array([49, 49, 49, 49, 49, 49]),
authType: [1],
authTrustLevel: 10000,
};
const widgetParamDefault = {
title: '使用密码验证',
};
export default function signNormalNotAccessBiometricExecute() {
describe('signNormalNotAccessBiometricExecute', function () {
/*
* @tc.number : Security_IAM_UserAuthInstance_Func_0042
* @tc.name : execute_userAuthInstance_on_off_result
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level.LEVEL2
*/
it('Security_IAM_UserAuthInstance_Func_0042', Level.LEVEL2, async function (done) {
console.info("Security_IAM_UserAuthInstance_Func_0042 start");
try {
const userAuthInstance = userAuth.getUserAuthInstance(authParamDefault, widgetParamDefault);
userAuthInstance.on("result", { callback: (result) => {} });
userAuthInstance.off("result", { callback: (result) => {} });
console.info("Security_IAM_UserAuthInstance_Func_0042 success");
expect(userAuthInstance).not().assertNull();
} catch (e) {
console.info("Security_IAM_UserAuthInstance_Func_0042 fail " + e.code);
expect(null).assertFail();
}
done();
});
/*
* @tc.number : Security_IAM_UserAuthInstance_Func_0050
* @tc.name : execute_userAuthInstance_start
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level.LEVEL2
*/
it('Security_IAM_UserAuthInstance_Func_0050', Level.LEVEL2, async function (done) {
console.info("Security_IAM_UserAuthInstance_Func_0050 start");
try {
const userAuthInstance = userAuth.getUserAuthInstance(authParamDefault, widgetParamDefault);
userAuthInstance.start();
console.info("Security_IAM_UserAuthInstance_Func_0050 success");
} catch (e) {
console.info("Security_IAM_UserAuthInstance_Func_0050 fail " + e.code);
expect(e.code).assertEqual(201);
}
done();
});
/*
* @tc.number : Security_IAM_UserAuthInstance_Func_0090
* @tc.name : execute_userAuthInstance_cancel
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level.LEVEL2
*/
it('Security_IAM_UserAuthInstance_Func_0090', Level.LEVEL2, async function (done) {
console.info("Security_IAM_UserAuthInstance_Func_0090 start");
try {
const userAuthInstance = userAuth.getUserAuthInstance(authParamDefault, widgetParamDefault);
userAuthInstance.cancel();
console.info("Security_IAM_UserAuthInstance_Func_0090 success");
expect(null).assertFail();
} catch (e) {
console.info("Security_IAM_UserAuthInstance_Func_0090 fail " + e.code);
expect(e.code).assertEqual(userAuth.UserAuthResultCode.GENERAL_ERROR);
}
done();
});
});
};
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册