未验证 提交 7802e2c1 编写于 作者: O openharmony_ci 提交者: Gitee

!3071 账号子系统api xts用例整改release

Merge pull request !3071 from 高曦/OpenHarmony-3.1-Release
......@@ -16,12 +16,6 @@ import("//test/xts/tools/build/suite.gni")
group("osaccount_hap") {
testonly = true
if (is_standard_system) {
deps = [
"actsosaccountdomaintest:ActsOsAccountDomainTest",
"actsosaccountpermissiontest:osaccount_permission",
"actsosaccountsystemtest:ActsOsAccountSystemTest",
"actsosaccountthirdpartytest:ActsOsAccountThirdPartyTest",
"sceneProject:osaccount_scene",
]
deps = [ "actsosaccountthirdpartytest:ActsOsAccountThirdPartyTest" ]
}
}
# Copyright (c) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsOsAccountDomainTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsOsAccountDomainTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "200000",
"package": "com.example.actsosaccountdomaintest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsOsAccountDomainTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.actsosaccountdomaintest",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsosaccountdomaintest",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"defPermissions": [
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS"
}
],
"reqPermissions": [
{
"name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS",
"reason": "ceshi"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO",
"reason":"need use ohos.permission.GET_BUNDLE_INFO"
},
{
"name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE",
"reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name":"ohos.permission.REMOVE_CACHE_FILES",
"reason":"need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name":"ohos.permission.LISTEN_BUNDLE_CHANGE",
"reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
}
],
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.actsosaccountdomaintest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (c) 2021 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
.titleST {
font-size: 32px;
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<text class="titleST">
STActsOsAccountDomainTest
</text>
</div>
/*
* Copyright (c) 2021 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 file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 30000;
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "ActsOsAccountDomainTest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (c) 2021 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 account from '@ohos.account.osAccount'
const ERR_OSACCOUNT_SERVICE_INNER_DOMAIN_ALREADY_BIND_ERROR = 4653103;
describe('ActsOsAccountSystemTest', function () {
/**
* @tc.number ActsAccountDomainTest_0100
* @tc.name Test createOsAccountForDomain getOsAccountLocalIdFromDomain pormise
* @tc.desc Test createOsAccountForDomain getOsAccountLocalIdFromDomain API functionality
*/
it('ActsOsAccountDomainTest_0100', 0, async function (done) {
console.debug("====>ActsOsAccountDomainTest_0100 start====");
var osAccountManager = account.getAccountManager();
console.debug("====>createosAccountFormDomain start====");
var osAccountInfo = await osAccountManager.createOsAccountForDomain(0,{
domain: "abc",
accountName: "abcdef",
});
var localId = osAccountInfo.localId;
console.debug("====>OsAccountInfo" + JSON.stringify(osAccountInfo));
expect(osAccountInfo.localName).assertEqual("abc/abcdef");
console.debug("====>createosAccountFromDomain end====");
console.debug("====>getOsAccountLocalIdFromDomain start====");
var Number = await osAccountManager.getOsAccountLocalIdFromDomain({
domain: "abc",
accountName: "abcdef",
});
expect(Number).assertEqual(localId);
console.debug("====>getOsAccountLocalIdFromDomain end====");
osAccountManager.removeOsAccount(localId);
console.debug("====>ActsOsAccountDomainTest_0100 end====");
done();
});
/**
* @tc.number ActsAccountDomainTest_0200
* @tc.name Test createOsAccountForDomain callback
* @tc.desc Test repeated call createOsAccountForDomain API functionality
*/
it('ActsOsAccountDomainTest_0200', 0, async function (done) {
console.debug("====>ActsOsAccountDomainTest_0200 start====");
var osAccountManager = account.getAccountManager();
console.debug("====>createosAccountFormDomain start====");
osAccountManager.createOsAccountForDomain(0,{
domain: "def",
accountName: "abcdef",
}, (err, osAccountInfo)=>{
console.debug("====>err" + JSON.stringify(err));
console.debug("====>OsAccountInfo" + JSON.stringify(osAccountInfo));
expect(err.code).assertEqual(0);
expect(osAccountInfo.localName).assertEqual("def/abcdef");
var localId = osAccountInfo.localId;
console.debug("====>createosAccountFormDomain end====");
console.debug("====>createosAccountFormDomain repeat start====");
osAccountManager.createOsAccountForDomain(0,{
domain: "def",
accountName: "abcdef",
}, (err,OsAccountInfo)=>{
console.debug("====>createOsAccountFormDomain repeat err : " + JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_SERVICE_INNER_DOMAIN_ALREADY_BIND_ERROR);
console.debug("====>createosAccountFormDomain repeat end====");
osAccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>removeOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>ActsOsAccountDomainTest_0200 end====");
done();
})
});
});
});
});
\ No newline at end of file
/*
* Copyright (c) 2021 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.
*/
require('./DomainInfo.test.js')
\ No newline at end of file
# Copyright (c) 2021 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("//test/xts/tools/build/suite.gni")
group("osaccount_permission") {
testonly = true
if (is_standard_system) {
deps = [
"actsosaccountconstrainttest:ActsOsAccountConstraintTest",
"actsosaccountpermissioninteracttest:ActsOsAccountPermissionInteractTest",
"actsosaccountpermissionmanagetest:ActsOsAccountPermissionManageTest",
"actsosaccountpermissionnotest:ActsOsAccountPermissionNoTest",
]
}
}
# Copyright (c) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsOsAccountConstraintTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsOsAccountConstraintTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "200000",
"package": "com.example.actsosaccountconstrainttest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsOsAccountConstraintTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.actsosaccountconstrainttest",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsosaccountconstrainttest",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"defPermissions": [
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION"
},
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS"
}
],
"reqPermissions": [
{
"name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION",
"reason": "ceshi"
},
{
"name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS",
"reason": "ceshi"
}
],
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.actsosaccountconstrainttest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (c) 2021 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
.titleST {
font-size: 32px;
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<text class="titleST">
STActsOsAccountConstraintTest
</text>
</div>
/*
* Copyright (c) 2021 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 file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 20000;
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "ActsOsAccountPermissionSystemNoTest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (c) 2021 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 osAccount from '@ohos.account.osAccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const EACHTIMEOUT = 2000;
const ERR_OSACCOUNT_KIT_CREATE_OS_ACCOUNT_ERROR = 4587523;
const ERR_OSACCOUNT_KIT_REMOVE_OSACCOUNT_ERROR = 4587529;
const ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR = 4587571;
describe('ActsOsAccountPermissionTest', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
}
beforeEach(async function (done) {
console.debug("====>beforeEach enter====");
sleep(EACHTIMEOUT);
done();
})
/*
* @tc.number : ActsOsAccountConstraint_0100
* @tc.name : createOsAccount callback
* @tc.desc : failed to create local user local user after adding constraint
*/
it('ActsOsAccountConstraint_0100', 0, async function(done){
console.debug("====>ActsOsAccountConstraint_0100 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
AccountManager.setOsAccountConstraints(100, ["constraint.os.account.create"], true, (err)=>{
console.debug("====>add Constraints err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
AccountManager.createOsAccount("aaa", osAccount.OsAccountType.NORMAL, (err, info)=>{
console.debug("====>createOsAccount err:" + JSON.stringify(err));
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_CREATE_OS_ACCOUNT_ERROR);
AccountManager.setOsAccountConstraints(100, ["constraint.os.account.create"], false, (err)=>{
console.debug("====>delete Constraints err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>ActsOsAccountPermission_0100 end====");
done();
})
})
})
})
/*
* @tc.number : ActsOsAccountConstraint_0200
* @tc.name : createOsAccount promise
* @tc.desc : failed to create local user local user after adding constraint
*/
it('ActsOsAccountConstraint_0200', 0, async function(done){
console.debug("====>ActsOsAccountConstraint_0200 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
await AccountManager.setOsAccountConstraints(100, ["constraint.os.account.create"], true);
try{
await AccountManager.createOsAccount("aaa", osAccount.OsAccountType.NORMAL);
}
catch(err){
console.debug("====>createOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_CREATE_OS_ACCOUNT_ERROR);
await AccountManager.setOsAccountConstraints(100, ["constraint.os.account.create"], false);
console.debug("====>ActsOsAccountConstraint_0200 end====");
done();
}
})
/*
* @tc.number : ActsOsAccountConstraint_0300
* @tc.name : removeOsAccount callback
* @tc.desc : failed to delete local user local user after adding constraint
*/
it('ActsOsAccountConstraint_0300', 0, async function(done){
console.debug("====>ActsOsAccountConstraint_0300 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
var localId;
AccountManager.createOsAccount("aaa", osAccount.OsAccountType.NORMAL, (err, info)=>{
console.debug("====>createOsAccount err:" + JSON.stringify(err));
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(err.code).assertEqual(0);
expect(info.localName).assertEqual("aaa");
localId = info.localId;
AccountManager.setOsAccountConstraints(100, ["constraint.os.account.remove"], true, (err)=>{
console.debug("====>add Constraints err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
AccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>removeOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_REMOVE_OSACCOUNT_ERROR);
AccountManager.setOsAccountConstraints(100, ["constraint.os.account.remove"], false, (err)=>{
console.debug("====>delete Constraints err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
AccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>removeOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>ActsOsAccountConstraint_0300 end====");
done();
})
})
})
})
})
})
/*
* @tc.number : ActsOsAccountConstraint_0400
* @tc.name : removeOsAccount promise
* @tc.desc : failed to delete local user local user after adding constraint
*/
it('ActsOsAccountConstraint_0400', 0, async function(done){
console.debug("====>ActsOsAccountConstraint_0400 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
var localId;
var info = await AccountManager.createOsAccount("aaa", osAccount.OsAccountType.NORMAL);
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(info.localName).assertEqual("aaa");
localId = info.localId;
await AccountManager.setOsAccountConstraints(100, ["constraint.os.account.remove"], true);
try{
await AccountManager.removeOsAccount(localId);
}
catch(err){
console.debug("====>removeOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_REMOVE_OSACCOUNT_ERROR);
await AccountManager.setOsAccountConstraints(100, ["constraint.os.account.remove"], false);
console.debug("====>delete Constraint finish====");
await AccountManager.removeOsAccount(localId);
console.debug("====>ActsOsAccountConstraint_0400 end====");
done();
}
})
/*
* @tc.number : ActsOsAccountConstraint_0500
* @tc.name : activateOsAccount callback
* @tc.desc : switching local users fails after adding constraints
*/
it('ActsOsAccountConstraint_0500', 0, async function(done){
console.debug("====>ActsOsAccountConstraint_0500 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
var localId;
AccountManager.createOsAccount("aaa", osAccount.OsAccountType.NORMAL, (err, info)=>{
console.debug("====>createOsAccount err:" + JSON.stringify(err));
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(err.code).assertEqual(0);
expect(info.localName).assertEqual("aaa");
localId = info.localId;
AccountManager.setOsAccountConstraints(100, ["constraint.os.account.start"], true, (err)=>{
console.debug("====>add Constraints err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
AccountManager.activateOsAccount(localId, (err)=>{
console.debug("====>activateOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR);
AccountManager.setOsAccountConstraints(100, ["constraint.os.account.start"], false, (err)=>{
console.debug("====>delete Constraints err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
AccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>removeOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>ActsOsAccountConstraint_0500 end====");
done();
})
})
})
})
})
})
/*
* @tc.number : ActsOsAccountConstraint_0600
* @tc.name : activateOsAccount promise
* @tc.desc : switching local users fails after adding constraints
*/
it('ActsOsAccountConstraint_0600', 0, async function(done){
console.debug("====>ActsOsAccountConstraint_0600 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
var localId;
var info = await AccountManager.createOsAccount("aaa", osAccount.OsAccountType.NORMAL);
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(info.localName).assertEqual("aaa");
localId = info.localId;
await AccountManager.setOsAccountConstraints(100, ["constraint.os.account.start"], true);
try{
await AccountManager.activateOsAccount(localId);
}
catch(err){
console.debug("====>activateOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR);
await AccountManager.setOsAccountConstraints(100, ["constraint.os.account.start"], false);
console.debug("====>delete Constraint finish====");
await AccountManager.removeOsAccount(localId);
console.debug("====>ActsOsAccountConstraint_0600 end====");
done();
}
})
/*
* @tc.number : ActsOsAccountConstraint_0700
* @tc.name : setOsAccountProfilePhoto callback
* @tc.desc : failed to set profile photo for local user after adding constraint
*/
it('ActsOsAccountConstraint_0700', 0, async function(done){
console.debug("====>ActsOsAccountConstraint_0700 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
var localId;
var photo = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMD"+
"AsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUF"+
"BQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAALAAwDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAA"+
"gEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTV"+
"FVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5"+
"ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBU"+
"QdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEh"+
"YaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAP"+
"wD2v4p+OPEXwz+LN3rvivwn4nh0bV9dsP7Oe51nRLOC7EF0kpEkL6psLRLDGsVwFhZkm8ucFljc/R1z8SPiZqBjl0n4SXljb7cPD4g1iwiuA"+
"+TyBbTzoVxtwd+c5yBwT1/hv4W+F/CupalqVjpSy6rqQaO81PUJpL28niLFvJaednkMKljti3bEzhVArQ8H+CtE+H+iro/h7T49J0mORpIbC"+
"3ZvIt9xyUiQnbFGO0aAIMnAGaxlTcqPsnJrrdb7Jfpv1vt1eilap7Syfk/n/nt09NF//9k=";
AccountManager.createOsAccount("aaa", osAccount.OsAccountType.NORMAL, (err, info)=>{
console.debug("====>createOsAccount err:" + JSON.stringify(err));
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(err.code).assertEqual(0);
expect(info.localName).assertEqual("aaa");
localId = info.localId;
AccountManager.setOsAccountConstraints(100, ["constraint.os.account.set.icon"], true, (err)=>{
console.debug("====>add Constraints err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
AccountManager.setOsAccountProfilePhoto(localId, photo, (err)=>{
console.debug("====>setOsAccountProfilePhoto err:" + JSON.stringify(err));
expect(err.code !=0 ).assertEqual(true);
AccountManager.setOsAccountConstraints(100, ["constraint.os.account.set.icon"], false, (err)=>{
console.debug("====>delete Constraints err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
AccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>removeOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>ActsOsAccountConstraint_0700 end====");
done();
})
})
})
})
})
})
/*
* @tc.number : ActsOsAccountConstraint_0800
* @tc.name : setOsAccountProfilePhoto promise
* @tc.desc : failed to set profile photo for local user after adding constraint
*/
it('ActsOsAccountConstraint_0800', 0, async function(done){
console.debug("====>ActsOsAccountConstraint_0800 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
var localId;
var photo = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMD"+
"AsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUF"+
"BQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAALAAwDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAA"+
"gEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTV"+
"FVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5"+
"ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBU"+
"QdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEh"+
"YaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAP"+
"wD2v4p+OPEXwz+LN3rvivwn4nh0bV9dsP7Oe51nRLOC7EF0kpEkL6psLRLDGsVwFhZkm8ucFljc/R1z8SPiZqBjl0n4SXljb7cPD4g1iwiuA"+
"+TyBbTzoVxtwd+c5yBwT1/hv4W+F/CupalqVjpSy6rqQaO81PUJpL28niLFvJaednkMKljti3bEzhVArQ8H+CtE+H+iro/h7T49J0mORpIbC"+
"3ZvIt9xyUiQnbFGO0aAIMnAGaxlTcqPsnJrrdb7Jfpv1vt1eilap7Syfk/n/nt09NF//9k=";
var info = await AccountManager.createOsAccount("aaa", osAccount.OsAccountType.NORMAL);
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(info.localName).assertEqual("aaa");
localId = info.localId;
await AccountManager.setOsAccountConstraints(100, ["constraint.os.account.set.icon"], true);
try{
await AccountManager.setOsAccountProfilePhoto(localId, photo);
}
catch(err){
console.debug("====>setOsAccountProfilePhoto err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
await AccountManager.setOsAccountConstraints(100, ["constraint.os.account.set.icon"], false);
console.debug("====>delete Constraints finish====");
await AccountManager.removeOsAccount(localId);
console.debug("====>ActsOsAccountConstraint_0800 end====");
done();
}
})
})
\ No newline at end of file
/*
* Copyright (c) 2021 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.
*/
require('./Constraint.test.js')
\ No newline at end of file
# Copyright (c) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsOsAccountPermissionInteractTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsOsAccountPermissionInteractTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "60000",
"package": "com.example.actsosaccountpermissioninteracttest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsOsAccountPermissionInteractTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.actsosaccountpermissioninteracttest",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsosaccountpermissioninteracttest",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"defPermissions": [
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION"
}
],
"reqPermissions": [
{
"name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION",
"reason": "ceshi"
}
],
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.actsosaccountpermissioninteracttest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (c) 2021 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
.titleST {
font-size: 32px;
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<text class="titleST">
STActsOsAccountPermissionInteractTest
</text>
</div>
/*
* Copyright (c) 2021 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 file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "ActsAccountTest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (c) 2021 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 osAccount from '@ohos.account.osAccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('ActsOsAccountPermissionTest', function () {
/*
* @tc.number : ActsOsAccountPermissionInteract_0100
* @tc.name : isOsAccountActived callback
* @tc.desc : only satisfies the INTERACT permission
*/
it('ActsOsAccountPermissionInteract_0100', 0, async function(done){
console.debug("====>ActsOsAccountPermissionInteract_0100 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
AccountManager.isOsAccountActived(100, (err, isActived)=>{
console.debug("====>isOsAccountActived err:" + JSON.stringify(err));
console.debug("====>isOsAccountActived isActived:" + isActived);
expect(err.code).assertEqual(0);
expect(isActived).assertEqual(true);
console.debug("====>ActsOsAccountPermissionInteract_0100 end====");
done();
})
})
/*
* @tc.number : ActsOsAccountPermissionInteract_0200
* @tc.name : isOsAccountActived promise
* @tc.desc : only satisfies the INTERACT permission
*/
it('ActsOsAccountPermissionInteract_0200', 0, async function(done){
console.debug("====>ActsOsAccountPermissionInteract_0200 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
try{
var isActived = await AccountManager.isOsAccountActived(100);
}
catch(err){
console.debug("====>isOsAccountActived err:" + JSON.stringify(err));
expect().assertFail();
done();
}
console.debug("====>isOsAccountActived isActived:" + isActived);
expect(isActived).assertEqual(true);
console.debug("====>ActsOsAccountPermissionInteract_0200 end====");
done();
})
/*
* @tc.number : ActsOsAccountPermissionInteract_0300
* @tc.name : isOsAccountVerified callback
* @tc.desc : only satisfies the INTERACT permission
*/
it('ActsOsAccountPermissionInteract_0300', 0, async function(done){
console.debug("====>ActsOsAccountPermissionInteract_0300 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
AccountManager.isOsAccountVerified(100, (err, isVerified)=>{
console.debug("====>isOsAccountVerified err:" + JSON.stringify(err));
console.debug("====>isOsAccountVerified isVerified:" + isVerified);
expect(err.code).assertEqual(0);
expect(isVerified).assertEqual(false);
console.debug("====>ActsOsAccountPermissionInteract_0300 end====");
done();
})
})
/*
* @tc.number : ActsOsAccountPermissionInteract_0400
* @tc.name : isOsAccountVerified promise
* @tc.desc : only satisfies the INTERACT permission
*/
it('ActsOsAccountPermissionInteract_0400', 0, async function(done){
console.debug("====>ActsOsAccountPermissionInteract_0400 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
try{
var isVerified = await AccountManager.isOsAccountVerified(100);
}
catch(err){
console.debug("====>isOsAccountVerified err:" + JSON.stringify(err));
expect().assertFail();
done();
}
console.debug("====>isOsAccountVerified isVerified:" + isVerified);
expect(isVerified).assertEqual(false);
console.debug("====>ActsOsAccountPermissionInteract_0400 end====");
done();
})
/*
* @tc.number : ActsOsAccountPermissionInteract_0500
* @tc.name : queryOsAccountById callback
* @tc.desc : only satisfies the INTERACT permission
*/
it('ActsOsAccountPermissionInteract_0500', 0, async function(done){
console.debug("====>ActsOsAccountPermissionInteract_0500 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
AccountManager.queryOsAccountById(100, (err, data)=>{
console.debug("====>queryOsAccountById err:" + JSON.stringify(err));
console.debug("====>queryOsAccountById data:" + JSON.stringify(data));
expect(err.code).assertEqual(0);
expect(data.localId).assertEqual(100);
expect(data.type.ADMIN).assertEqual(0);
var serialNumberStr = data.serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept);
expect(serialIntercept).assertEqual("00000001");
expect(data.isCreateCompleted).assertTrue();
console.debug("====>ActsOsAccountPermissionInteract_0500 end====");
done();
})
})
/*
* @tc.number : ActsOsAccountPermissionInteract_0600
* @tc.name : queryOsAccountById promise
* @tc.desc : only satisfies the INTERACT permission
*/
it('ActsOsAccountPermissionInteract_0600', 0, async function(done){
console.debug("====>ActsOsAccountPermissionInteract_0600 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
var osAccountInfo = await AccountManager.queryOsAccountById(100);
console.debug("====>queryOsAccountById osAccountInfo:" + JSON.stringify(osAccountInfo));
expect(osAccountInfo.localId).assertEqual(100);
expect(osAccountInfo.type.ADMIN).assertEqual(0);
var serialNumberStr = osAccountInfo.serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept);
expect(serialIntercept).assertEqual("00000001");
expect(osAccountInfo.isCreateCompleted).assertTrue();
console.debug("====>ActsOsAccountPermissionInteract_0600 end====");
done();
})
})
\ No newline at end of file
/*
* Copyright (c) 2021 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.
*/
require('./Interact.test.js')
\ No newline at end of file
# Copyright (c) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsOsAccountPermissionManageTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsOsAccountPermissionManageTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "60000",
"package": "com.example.actsosaccountpermissionmanagetest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsOsAccountPermissionManageTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.actsosaccountpermissionmanagetest",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsosaccountpermissionmanagetest",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"defPermissions": [
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS"
}
],
"reqPermissions": [
{
"name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS",
"reason": "ceshi"
}
],
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.actsosaccountpermissionmanagetest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (c) 2021 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
.titleST {
font-size: 32px;
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<text class="titleST">
STActsOsAccountPermissionManageTest
</text>
</div>
/*
* Copyright (c) 2021 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 file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "ActsAccountTest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (c) 2021 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.
*/
require('./Manage.test.js')
\ No newline at end of file
/*
* Copyright (c) 2021 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 osAccount from '@ohos.account.osAccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('ActsOsAccountPermissionTest', function () {
/*
* @tc.number : ActsOsAccountPermissionManage_0100
* @tc.name : isOsAccountActived callback
* @tc.desc : only satisfies the MANAGE permission
*/
it('ActsOsAccountPermissionManage_0100', 0, async function(done){
console.debug("====>ActsOsAccountPermissionManage_0100 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
AccountManager.isOsAccountActived(100, (err, isActived)=>{
console.debug("====>isOsAccountActived err:" + JSON.stringify(err));
console.debug("====>isOsAccountActived isActived:" + isActived);
expect(err.code).assertEqual(0);
expect(isActived).assertEqual(true);
console.debug("====>ActsOsAccountPermissionManage_0100 end====");
done();
})
})
/*
* @tc.number : ActsOsAccountPermissionManage_0200
* @tc.name : isOsAccountActived promise
* @tc.desc : only satisfies the MANAGE permission
*/
it('ActsOsAccountPermissionManage_0200', 0, async function(done){
console.debug("====>ActsOsAccountPermissionManage_0200 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
try{
var isActived = await AccountManager.isOsAccountActived(100);
}
catch(err){
console.debug("====>isOsAccountActived err:" + JSON.stringify(err));
expect().assertFail();
done();
}
console.debug("====>isOsAccountActived isActived:" + isActived);
expect(isActived).assertEqual(true);
console.debug("====>ActsOsAccountPermissionManage_0200 end====");
done();
})
/*
* @tc.number : ActsOsAccountPermissionManage_0300
* @tc.name : isOsAccountVerified callback
* @tc.desc : only satisfies the MANAGE permission
*/
it('ActsOsAccountPermissionManage_0300', 0, async function(done){
console.debug("====>ActsOsAccountPermissionManage_0300 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
AccountManager.isOsAccountVerified(100, (err, isVerified)=>{
console.debug("====>isOsAccountVerified err:" + JSON.stringify(err));
console.debug("====>isOsAccountVerified isVerified:" + isVerified);
expect(err.code).assertEqual(0);
expect(isVerified).assertEqual(false);
console.debug("====>ActsOsAccountPermissionManage_0300 end====");
done();
})
})
/*
* @tc.number : ActsOsAccountPermissionManage_0400
* @tc.name : isOsAccountVerified promise
* @tc.desc : only satisfies the MANAGE permission
*/
it('ActsOsAccountPermissionManage_0400', 0, async function(done){
console.debug("====>ActsOsAccountPermissionManage_0400 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
try{
var isVerified = await AccountManager.isOsAccountVerified(100);
}
catch(err){
console.debug("====>isOsAccountVerified err:" + JSON.stringify(err));
expect().assertFail();
done();
}
console.debug("====>isOsAccountVerified isVerified:" + isVerified);
expect(isVerified).assertEqual(false);
console.debug("====>ActsOsAccountPermissionManage_0400 end====");
done();
})
/*
* @tc.number : ActsOsAccountPermissionManage_0500
* @tc.name : queryOsAccountById callback
* @tc.desc : only satisfies the MANAGE permission
*/
it('ActsOsAccountPermissionManage_0500', 0, async function(done){
console.debug("====>ActsOsAccountPermissionManage_0500 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
AccountManager.queryOsAccountById(100, (err, data)=>{
console.debug("====>queryOsAccountById err:" + JSON.stringify(err));
console.debug("====>queryOsAccountById data:" + JSON.stringify(data));
expect(err.code).assertEqual(0);
expect(data.localId).assertEqual(100);
expect(data.type.ADMIN).assertEqual(0);
var serialNumberStr = data.serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept);
expect(serialIntercept).assertEqual("00000001");
expect(data.isCreateCompleted).assertTrue();
console.debug("====>ActsOsAccountPermissionManage_0500 end====");
done();
})
})
/*
* @tc.number : ActsOsAccountPermissionManage_0600
* @tc.name : queryOsAccountById promise
* @tc.desc : only satisfies the MANAGE permission
*/
it('ActsOsAccountPermissionManage_0600', 0, async function(done){
console.debug("====>ActsOsAccountPermissionManage_0600 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
var osAccountInfo = await AccountManager.queryOsAccountById(100);
console.debug("====>queryOsAccountById osAccountInfo:" + JSON.stringify(osAccountInfo));
expect(osAccountInfo.localId).assertEqual(100);
expect(osAccountInfo.type.ADMIN).assertEqual(0);
var serialNumberStr = osAccountInfo.serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept);
expect(serialIntercept).assertEqual("00000001");
expect(osAccountInfo.isCreateCompleted).assertTrue();
console.debug("====>ActsOsAccountPermissionManage_0600 end====");
done();
})
})
\ No newline at end of file
# Copyright (c) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsOsAccountPermissionNoTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsOsAccountPermissionNoTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "150000",
"package": "com.example.actsosaccountpermissionnotest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsOsAccountPermissionNoTest.hap",
"ActsOsAccountScenePermission.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.actsosaccountpermissionnotest",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsosaccountpermissionnotest",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"reqPermissions": [
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO",
"reason":"need use ohos.permission.GET_BUNDLE_INFO"
},
{
"name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE",
"reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name":"ohos.permission.REMOVE_CACHE_FILES",
"reason":"need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name":"ohos.permission.LISTEN_BUNDLE_CHANGE",
"reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
}
],
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.actsosaccountpermissionnotest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (c) 2021 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
.titleST {
font-size: 32px;
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<text class="titleST">
STActsOsAccountPermissionNoTest
</text>
</div>
/*
* Copyright (c) 2021 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 file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "ActsOsAccountPermissionSystemNoTest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (c) 2021 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.
*/
require('./Permission.test.js')
\ No newline at end of file
# Copyright (c) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsOsAccountSystemTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsOsAccountSystemTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "8000000",
"package": "com.example.actsosaccountsystemtest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsOsAccountSystemTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.actsosaccountsystemtest",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsosaccountsystemtest",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"defPermissions": [
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS"
},
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION"
}
],
"reqPermissions": [
{
"name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS",
"reason": "ceshi"
},
{
"name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION",
"reason": "ceshi"
}
],
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.actsosaccountsystemtest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (c) 2021 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
.titleST {
font-size: 32px;
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<text class="titleST">
STActsOsAccountSystemTest
</text>
</div>
/*
* Copyright (c) 2021 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 file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 180000;
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "ActsOsAccountSystemTest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (c) 2021 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.
*/
require('./Query.test.js')
require('./Activate.test.js')
require('./OnOff.test.js')
require('./Set.test.js')
require('./Constraints.test.js')
require('./Photo.test.js')
require('./Create.test.js')
require('./Limit.test.js')
\ No newline at end of file
# Copyright (c) 2021 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("//test/xts/tools/build/suite.gni")
group("osaccount_scene") {
testonly = true
if (is_standard_system) {
deps = [ "actsosaccountscenepermission:ActsOsAccountScenePermission" ]
}
}
{
"description": "Configuration for hjunit demo Tests",
}
/*
* Copyright (c) 2021 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册