提交 1727f230 编写于 作者: M mayunteng_1

Merge branch 'master' of gitee.com:openharmony/xts_acts

Change-Id: I2d2f5ccc7def96bfbc2e2c3c36e08f45dd772d34
......@@ -28,6 +28,7 @@ group("ability_runtime") {
"actscalldataabilitytest:ActsCallDataAbilityTest",
"actscalldataabilitytest:ActsCallDataAbilityTest",
"actscalltest:actscalltest",
"actsdataabilityaccessdatasharetest:dataabilityaccessdatashare",
"actsfwkdataaccessortest:dataability",
"actsqueryfunctiontest:actsqueryfunctiontest",
"actsserviceabilityclienttest:serviceability",
......
......@@ -32,7 +32,6 @@ export default function abilityTest() {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_01_0100 printSync end ====> " )
await sleep(1000)
var finishmsg = 'ACTS_AACommand_printSync_01_0100 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then((data)=>{
console.log("ACTS_AACommand_printSync_01_0100 finishTest test end ========> callback " )
......@@ -63,7 +62,6 @@ export default function abilityTest() {
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_01_0200 printSync end ====> " )
await sleep(1000)
var finishmsg = 'ACTS_AACommand_printSync_01_0200 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_01_0200 print test end ========> callback " )
......@@ -93,7 +91,6 @@ export default function abilityTest() {
'fffffffffff'
globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_01_0300 printSync end ====> " )
await sleep(1000)
var finishmsg = 'ACTS_AACommand_printSync_01_0300 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_01_0300 print test end ========> callback " )
......@@ -111,7 +108,6 @@ export default function abilityTest() {
it('ACTS_AACommand_printSync_01_0400', 0, async function (done) {
globalThis.abilityDelegator.printSync(null);
console.log("ACTS_AACommand_printSync_01_0300 printSync end ====> " )
await sleep(1000)
var finishmsg = 'ACTS_AACommand_printSync_01_0400 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_01_0400 print test end ========> callback " )
......
......@@ -352,17 +352,12 @@ export default function abilityTest() {
*/
it('ACTS_AACommand_finish_01_0800', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
setTimeout(() => {
console.log('ACTS_AACommand_finish_01_0800 code:'+JSON.stringify(code))
if(code!=undefined){
expect().assertFail();
}
done();
}, 3000)
var code = globalThis.abilityDelegator.finishTest(msg, 'ABCD',()=>{
globalThis.abilityDelegator.finishTest(msg, 'ABCD',()=>{
console.log(" ACTS_AACommand_finish_01_0800 finishTest test end ========> callback " )
expect().assertFail();
})
await sleep(2000);
done();
})
/**
......@@ -388,15 +383,9 @@ export default function abilityTest() {
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/
it('ACTS_AACommand_finish_01_1000', 0, async function (done) {
var code = null
setTimeout(() => {
console.log('ACTS_AACommand_finish_01_1000 code:'+JSON.stringify(code))
if(code!=undefined){
expect().assertFail();
}
done();
}, 3000)
code = globalThis.abilityDelegator.finishTest(null, 1)
globalThis.abilityDelegator.finishTest(null, 1)
await sleep(2000);
done()
})
/**
......@@ -406,15 +395,9 @@ export default function abilityTest() {
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/
it('ACTS_AACommand_finish_01_1100', 0, async function (done) {
var code=null
setTimeout(() => {
console.log('ACTS_AACommand_finish_01_1100 code:'+JSON.stringify(code))
if(code!=undefined){
expect().assertFail();
}
done();
}, 3000)
code = globalThis.abilityDelegator.finishTest(undefined, 1)
globalThis.abilityDelegator.finishTest(undefined, 1)
await sleep(2000);
done()
})
/**
......
......@@ -163,28 +163,6 @@ export default class MainAbility extends Ability {
await sleep(2000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap' +
' -s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1200 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_1200 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_1200 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1200 stdResult = ' + data.stdResult)
globalThis.stdResult21 = data.stdResult;
console.log('ACTS_AACommand_finish_01_1200 - executeShellCommand: end')
})
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('ACTS_AACommand_finish_01_1200 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_1200 : data : ' + JSON.stringify(data));
globalThis.stdResult22 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_1200 end');
})
await sleep(2000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1300 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -251,27 +229,6 @@ export default class MainAbility extends Ability {
await sleep(2000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0200 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_0200 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_0200 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0200 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_0200 - executeShellCommand: end')
})
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('ACTS_AACommand_finish_01_0200 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_0200 : data : ' + JSON.stringify(data));
globalThis.stdResult29 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_0200 end');
})
await sleep(2000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0300 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -293,69 +250,6 @@ export default class MainAbility extends Ability {
await sleep(2000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0800 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_0800 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_0800 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0800 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_0800 - executeShellCommand: end')
})
await sleep(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('ACTS_AACommand_finish_01_0800 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_0800 : data : ' + JSON.stringify(data));
globalThis.stdResult31 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_0800 end');
})
await sleep(2000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1000 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_1000 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_1000 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1000 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_1000 - executeShellCommand: end')
})
await sleep(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('ACTS_AACommand_finish_01_1000 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_1000 : data : ' + JSON.stringify(data));
globalThis.stdResult32 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_1000 end');
})
await sleep(2000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1100 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_1100 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_1100 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1100 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_1100 - executeShellCommand: end')
})
await sleep(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('ACTS_AACommand_finish_01_1100 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_1100 : data : ' + JSON.stringify(data));
globalThis.stdResult33 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_1100 end');
})
await sleep(2000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap' +
' -s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1600 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......
......@@ -293,24 +293,6 @@ export default function abilityTest() {
done()
})
/**
* @tc.number: ACTS_AACommand_finishTest_1200
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
* mode. The msg parameter is valid(including Chinese and special characters) and the code parameter
* is valid (Number.MAX_VALUE)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/
it('ACTS_AACommand_finishTest_1200', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_1200 --- start")
let
finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
finishmsg1 = 'TestFinished-ResultCode: -1'
expect(globalThis.stdResult21).assertContain(finishmsg);
expect(globalThis.stdResult21).assertContain(finishmsg1);
expect(globalThis.stdResult22.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
done()
})
/**
* @tc.number: ACTS_AACommand_finishTest_1300
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
......@@ -362,19 +344,6 @@ export default function abilityTest() {
done()
})
/**
* @tc.number: ACTS_AACommand_finishTest_0200
* @tc.name: The parameters of the test command are valid, and the finishTest
* interface is called in AsyncCallback
* mode. The msg parameter is invalid (null) and the code parameter is valid (1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/
it('ACTS_AACommand_finishTest_0200', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_0200 --- start")
expect(globalThis.stdResult29.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
done()
})
/**
* @tc.number: ACTS_AACommand_finishTest_0300
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in
......@@ -387,43 +356,6 @@ export default function abilityTest() {
done()
})
/**
* @tc.number: ACTS_AACommand_finishTest_0800
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in
* AsyncCallback
* mode. The msg parameter is invalid(including Chinese and special characters) and the
* code parameter is valid (“ABCD”)
* @tc.desc: Verify that the process of the test framework is not stopped by calling this interface.
*/
it('ACTS_AACommand_finishTest_0800', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_0800 --- start")
expect(globalThis.stdResult31.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
done()
})
/**
* @tc.number: ACTS_AACommand_finishTest_1000
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
* mode. The msg parameter is invalid(null) and the code parameter is valid (1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/
it('ACTS_AACommand_finishTest_1000', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_1000 --- start")
expect(globalThis.stdResult32.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
done()
})
/**
* @tc.number: ACTS_AACommand_finishTest_1100
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
* mode. The msg parameter is invalid(undefined) and the code parameter is valid (1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/
it('ACTS_AACommand_finishTest_1100', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_1100 --- start")
expect(globalThis.stdResult33.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
done()
})
/**
* @tc.number: ACTS_AACommand_finishTest_1600
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in
......
# Copyright (C) 2022 Huawei Device Co., Ltd.
# 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
......@@ -10,14 +10,15 @@
# 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("//build/ohos_var.gni")
import("//test/xts/tools/build/suite.gni")
group("accessControl") {
group("dataabilityaccessdatashare") {
testonly = true
if (is_standard_system) {
deps = [
"access_token/AccessTokenTest_Normal_js:ActsAccessTokenApiJSNormalTest",
"actsdataabilityaccessdatasharetest:ActsDataAbilityAccessDataShareTest",
"datashareserverhap:DataShareServerHap",
]
}
}
# 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("ActsDataAbilityAccessDataShareTest") {
hap_profile = "./src/main/config.json"
hap_name = "ActsDataAbilityAccessDataShareTest"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_js_assets("hjs_demo_js_assets") {
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "180000",
"shell-timeout": "180000",
"bundle-name": "com.amsst.dataabilityaccessdatashare",
"package-name": "com.amsst.dataabilityaccessdatashare"
},
"kits": [
{
"test-file-name": [
"ActsDataAbilityAccessDataShareTest.hap",
"DataShareServerHap.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.amsst.dataabilityaccessdatashare",
"vendor": "amsst",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 9,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.amsst.dataabilityaccessdatashare",
"name": ".entry",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"formsEnabled": false,
"name": ".MainAbility",
"srcLanguage": "js",
"srcPath": "MainAbility",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
"label": "$string:MainAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
},
{
"orientation": "unspecified",
"formsEnabled": false,
"name": ".TestAbility",
"srcLanguage": "js",
"srcPath": "TestAbility",
"icon": "$media:icon",
"description": "$string:TestAbility_desc",
"label": "$string:TestAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
},
"mainAbility": ".MainAbility",
"srcPath": ""
}
}
\ No newline at end of file
/*
* Copyright (C) 2022 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">
STDataAbility
</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 app from '@system.app'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('====onShow finish====<')
},
onReady() {
},
}
\ No newline at end of file
/*
* Copyright (c) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('TestApplication onCreate')
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info("TestApplication onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
},
"Files": {
}
}
\ No newline at end of file
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
\ No newline at end of file
/*
* Copyright (c) 2022 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 {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
/*
* Copyright (c) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package', '-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
}
}
return targetParams.trim()
}
export default {
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
},
onRun() {
console.log('OpenHarmonyTestRunner onRun run')
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
console.info('debug value : '+debug)
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + data.stdResult);
console.info('executeShellCommand : data : ' + data.exitCode);
})
}
};
/*
* Copyright (C) 2022 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 ActsDataAbilityHelperTest from './DataAbilityHelperJsSt.test.js'
export default function testsuite() {
ActsDataAbilityHelperTest()
}
{
"string": [
{
"name": "app_name",
"value": "STDataAbility"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.datashareserver_stage",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name",
"distributedNotificationEnabled": true,
"minAPIVersion": 9,
"targetAPIVersion": 9
}
}
# Copyright (c) 2022 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_hap_assist_suite("DataShareServerHap") {
hap_name = "DataShareServerHap"
js_build_mode = "debug"
testonly = true
hap_profile = "entry/src/main/module.json"
deps = [
":datashareserverhap_js_assets",
":datashareserverhap_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("datashareserverhap_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("datashareserverhap_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("datashareserverhap_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":datashareserverhap_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
/*
* Copyright (C) 2022 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 AbilityStage from "@ohos.application.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("[DataShareServer]: MyAbilityStage onCreate")
}
}
\ No newline at end of file
/*
* Copyright (C) 2022 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 Extension from '@ohos.application.DataShareExtensionAbility'
import rdb from '@ohos.data.rdb';
let DB_NAME = "book.db";
let TBL_NAME = "book";
let DDL_TBL_CREATE = "CREATE TABLE IF NOT EXISTS "
+ TBL_NAME
+ " (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, introduction TEXT NOT NULL)";
let rdbStore;
function sleep(time) {
return new Promise(resolve =>
setTimeout(resolve,time)
) } async function output() {
let out = await sleep(1000);
console.log('1');
return out;
}
export default class DataShareExtAbility extends Extension {
async onCreate(want, callback) {
console.log('[DataShareServer]: DataShareExtAbility onCreate, want:' + want.abilityName);
console.log('[DataShareServer]: DataShareExtAbility onCreate this.context.databaseDir:' + this.context.databaseDir);
// @ts-ignore
rdbStore = await rdb.getRdbStore(this.context, { name: DB_NAME }, 1);
console.log('[DataShareServer]: DataShareExtAbility getRdbStore done');
await rdbStore.executeSql(DDL_TBL_CREATE, []);
console.log('[DataShareServer]: DataShareExtAbility executeSql done');
let err = {"code":0};
callback(err);
console.log('[DataShareServer]: DataShareExtAbility onCreate end');
}
async getFileTypes(uri: string, mimeTypeFilter: string, callback) {
console.log('[DataShareServer]: [getFileTypes] enter');
let ret = new Array("type01", "type00", "type03");
console.log('[DataShareServer]: [getFileTypes] leave, ret:' + ret);
let err = {"code":0};
await callback(err,ret);
return ret;
}
async openFile(uri: string, mode: string, callback) {
console.log('[DataShareServer]: [openFile] enter');
let ret = 1;
let err = {"code":0};
await callback(err,ret);
console.log('[DataShareServer]: [openFile] leave, ret:' + ret);
}
async insert(uri, value, callback) {
console.log('[DataShareServer]: [insert] enter');
if (value == null) {
console.error('[DataShareServer]: [insert] invalid valueBuckets');
return;
}
console.log('[DataShareServer]: [insert] value = ' + value);
console.log('[DataShareServer]: [insert] value = ' + JSON.stringify(value));
await rdbStore.insert(TBL_NAME, value, function (err, ret) {
console.log('[DataShareServer]: <<Provider>> [insert] callback ret:' + ret);
if (callback != undefined) {
callback(err, ret);
}
});
console.log('[DataShareServer]: [insert] leave');
}
async update(uri, predicates, value, callback) {
console.log('[DataShareServer]: [update] enter');
if (predicates == null || predicates == undefined) {
console.error('[DataShareServer]: <<Provider>> [update] invalid predicates');
return;
}
console.log('[DataShareServer]: [update] values = ' + value);
console.log('[DataShareServer]: [update] values = ' + JSON.stringify(value));
console.log('[DataShareServer]: [update] predicates = ' + predicates);
console.log('[DataShareServer]: [update] predicates = ' + JSON.stringify(predicates));
try {
await rdbStore.update(TBL_NAME, value, predicates, function (err, ret) {
console.log('[DataShareServer]: [update] callback ret:' + ret);
console.log('[DataShareServer]: [update] callback err:' + err);
if (callback != undefined) {
callback(err, ret);
}
});
} catch (err) {
console.error('[DataShareServer]: [update] error' + err);
}
sleep(1);
console.log('[DataShareServer]: [update] leave');
}
async delete(uri, predicates, callback) {
console.log('[DataShareServer]: [delete] enter');
if (predicates == null || predicates == undefined) {
console.error('[DataShareServer]: [delete] invalid predicates');
return;
}
console.log('[DataShareServer]: [delete] predicates = ' + predicates);
console.log('[DataShareServer]: [delete] predicates = ' + JSON.stringify(predicates));
try {
await rdbStore.delete(TBL_NAME, predicates, function (err, ret) {
console.log('[DataShareServer]: [delete] ret:' + ret);
if (callback != undefined) {
callback(err, ret);
}
});
} catch (err) {
console.error('[DataShareServer]: [delete] error' + err);
}
console.log('[DataShareServer]: [delete] leave');
}
async query(uri, predicates, columns, callback) {
console.log('[DataShareServer]: [query] enter');
if (predicates == null || predicates == undefined) {
console.error('[DataShareServer]: [query] invalid predicates');
}
console.log('[DataShareServer]: [query] values = ' + columns);
console.log('[DataShareServer]: [query] values = ' + JSON.stringify(columns));
console.log('[DataShareServer]: [query] predicates = ' + predicates);
console.log('[DataShareServer]: [query] predicates = ' + JSON.stringify(predicates));
try {
await rdbStore.query(TBL_NAME, predicates, columns, function (err, resultSet) {
console.log('[DataShareServer]: [query] ret: ' + resultSet);
if (resultSet != undefined) {
console.log('[DataShareServer]: [query] resultSet.rowCount: ' + resultSet.rowCount);
}
if (callback != undefined) {
callback(err, resultSet);
}
});
} catch (err) {
console.error('[DataShareServer]: [query] error' + err);
}
console.log('[DataShareServer]: [query] leave');
}
async getType(uri: string, callback) {
console.log('[DataShareServer]: [getType] enter');
let ret = "image";
console.log('[DataShareServer]: [getType] leave, ret:' + ret);
let err = {"code":0};
await callback(err,ret);
return ret;
}
async batchInsert(uri: string, valueBuckets, callback) {
console.log('[DataShareServer]: [batchInsert] enter');
if (valueBuckets == null || valueBuckets.length == undefined) {
console.error('[DataShareServer]: <<Provider>> [batchInsert] invalid valueBuckets');
return;
}
console.log('[DataShareServer]: [batchInsert] valueBuckets.length:' + valueBuckets.length);
let resultNum = valueBuckets.length
await valueBuckets.forEach(vb => {
console.log('[DataShareServer]: [batchInsert] vb:' + JSON.stringify(vb));
rdbStore.insert(TBL_NAME, vb, function (err, ret) {
console.log('[DataShareServer]: [batchInsert] callback ret:' + ret);
if (callback != undefined) {
callback(err, resultNum);
}
});
});
console.log('[DataShareServer]: [batchInsert] leave');
}
async normalizeUri(uri: string, callback) {
console.log('[DataShareServer]: [normalizeUri] enter');
let ret = uri;
let err = {"code":0};
await callback(err, ret);
console.log('[DataShareServer]: [normalizeUri] leave, ret:' + ret);
}
async denormalizeUri(uri: string, callback) {
console.log('[DataShareServer]: [denormalizeUri] enter');
let ret = uri;
let err = {"code":0};
await callback(err, ret);
console.log('[DataShareServer]: [denormalizeUri] leave, ret:' + ret);
}
};
\ No newline at end of file
/*
* Copyright (C) 2022 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 Ability from '@ohos.application.Ability'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log("[DataShareServer]: MainAbility onCreate")
globalThis.abilityWant = want;
}
onDestroy() {
console.log("[DataShareServer]: MainAbility onDestroy")
}
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("[DataShareServer]: MainAbility onWindowStageCreate")
windowStage.loadContent("pages/index", (err, data) => {
if (err.code) {
console.error("[DataShareServer]: Failed to load the content. Cause: " + JSON.stringify(err));
return;
}
console.log("[DataShareServer]: Succeeded in loading the content. Data: " + JSON.stringify(data))
});
}
onWindowStageDestroy() {
// Main window is destroyed, release UI related resources
console.log("[DataShareServer]: MainAbility onWindowStageDestroy")
}
onForeground() {
// Ability has brought to foreground
console.log("[DataShareServer]: MainAbility onForeground")
}
onBackground() {
// Ability has back to background
console.log("[DataShareServer]: MainAbility onBackground")
}
};
/*
* Copyright (C) 2022 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.
*/
@Entry
@Component
struct Index {
@State message: string = 'stagemode: datashare server'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
{
"module": {
"name": "entry",
"type": "entry",
"srcEntrance": "./ets/Application/MyAbilityStage.ts",
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
"default",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:white",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
],
"extensionAbilities": [
{
"srcEntrance": "./ets/DataShareExtAbility/DataShareExtAbility.ts",
"name": "DataShareExtAbility",
"icon": "$media:icon",
"description": "$string:DataShareExtAbility_desc",
"type": "dataShare",
"uri": "datashare://com.example.dataabilityserver_fa.DataAbility",
"visible": true
}
]
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "DataShareExtAbility_desc",
"value": "description"
},
{
"name": "DataShareExtAbility_label",
"value": "label"
}
]
}
\ No newline at end of file
{
"forms": [
{
"name": "widget",
"description": "This is a service widget.",
"src": "./js/widget/pages/index/index",
"window": {
"designWidth": 720,
"autoDesignWidth": true
},
"colorMode": "auto",
"isDefault": true,
"updateEnabled": true,
"scheduledUpdateTime": "10:30",
"updateDuration": 1,
"defaultDimension": "2*2",
"supportDimensions": [
"2*2"
]
},
{
"name": "widget",
"description": "This is a service widget.",
"src": "./js/widget/pages/index/index",
"window": {
"designWidth": 720,
"autoDesignWidth": true
},
"colorMode": "auto",
"isDefault": true,
"updateEnabled": true,
"scheduledUpdateTime": "10:30",
"updateDuration": 1,
"defaultDimension": "2*2",
"supportDimensions": [
"2*2"
]
}
]
}
\ No newline at end of file
......@@ -207,6 +207,28 @@ struct Index {
this.geoShow=false
}
})
.onBlur(()=>{
console.info("onBlur==>")
this.controller.requestFocus()
})
TextInput({placeholder:"inputs your words"})
.key('textInput')
.type(InputType.Normal)
.placeholderColor(Color.Blue)
.placeholderFont({size:20,weight:FontWeight.Normal,family:"sans-serif",style:FontStyle.Normal})
.enterKeyType(EnterKeyType.Next)
.caretColor(Color.Green)
.height(60)
.fontSize(30)
.fontWeight(FontWeight.Bold)
.fontFamily("cursive")
.fontStyle(FontStyle.Italic)
.fontColor(Color.Red)
.maxLength(20)
.border({width:1,color:0x317AF7,radius:10,style:BorderStyle.Solid})
.onClick(()=>{
console.info("TextInput click")
})
Row(){
Button("web click").key('webcomponent').onClick(async ()=>{
console.info("key==>"+this.str)
......@@ -301,7 +323,8 @@ struct Index {
}
case "emitGetRequestFocus":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/second.html"})
this.controller.requestFocus()
await Utils.sleep(2000)
sendEventByKey('textInput',10,'')
break;
}
case "emitAccessBackward":{
......
......@@ -15,7 +15,9 @@
import pasteBoardJEtsunitTest from './PasteBoardEtsunitTest';
import pasteBoardTest from './PasteBoeadPixelMapJsunit.test';
import pasteBoardSupportBinaryDataTest from './PasteBoardSupportBinaryData.test';
export default function testsuite() {
pasteBoardSupportBinaryDataTest()
pasteBoardJEtsunitTest()
pasteBoardTest()
}
\ 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
import pasteboard from '@ohos.pasteboard'
export default function pasteBoardSupportBinaryDataTest(){
describe('pasteBoardSupportBinaryDataTest', function() {
console.info('start################################start');
/**
* @tc.number SUB_PASTEBOARD_BINARY_FUNCTION_ETS_TEST_0100
* @tc.name Create pasteData use binary parameter
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_BINARY_FUNCTION_ETS_TEST_0100', 0, async function (done) {
console.info("SUB_PASTEBOARD_BINARY_FUNCTION_ETS_TEST_0100 start")
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
var pasteData = undefined;
console.info("systemPasteBoard clear data success")
var dataUri = new ArrayBuffer(256)
pasteData = pasteboard.createData("text/uri",dataUri)
var addUri = new ArrayBuffer(128)
pasteData.addRecord("text/uri", addUri)
var recordUri = new ArrayBuffer(96)
var pasteDataRecord = pasteboard.createRecord("text/uri", recordUri)
pasteData.addRecord(pasteDataRecord)
await systemPasteBoard.setPasteData(pasteData).then(async () => {
console.info("Set pastedata success")
await systemPasteBoard.hasPasteData().then(async (data) => {
console.info("Check pastedata has data success, result: " + data)
expect(data).assertTrue();
await systemPasteBoard.getPasteData().then(async (data) => {
console.info("Get paste data success")
expect(data.getRecordCount()).assertEqual(3)
})
})
})
})
done();
})
/**
* @tc.number SUB_PASTEBOARD_BINARY_FUNCTION_ETS_TEST_0200
* @tc.name Create pasteData use binary parameter
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_BINARY_FUNCTION_ETS_TEST_0200', 0, async function (done) {
console.info("SUB_PASTEBOARD_BINARY_FUNCTION_ETS_TEST_0200 start")
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
var pasteData = undefined;
console.info("systemPasteBoard clear data success")
var dataHtml = new ArrayBuffer(256)
pasteData = pasteboard.createData("text/html",dataHtml)
var addHtml = new ArrayBuffer(128)
pasteData.addRecord("text/html", addHtml)
var recordHtml = new ArrayBuffer(64)
var pasteDataRecord = pasteboard.createRecord("text/html", recordHtml)
pasteData.addRecord(pasteDataRecord)
await systemPasteBoard.setPasteData(pasteData).then(async () => {
console.info("set pastedata success")
await systemPasteBoard.hasPasteData().then(async (data) => {
console.info("Check pastedata has data success, result: " + data)
expect(data).assertTrue();
await systemPasteBoard.getPasteData().then(async (data) => {
console.info("get paste data success")
expect(data.getRecordCount()).assertEqual(3)
})
})
})
})
done();
})
/**
* @tc.number SUB_PASTEBOARD_BINARY_FUNCTION_ETS_TEST_0300
* @tc.name Create pasteData use binary parameter
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_BINARY_FUNCTION_ETS_TEST_0300', 0, async function (done) {
console.info("SUB_PASTEBOARD_BINARY_FUNCTION_ETS_TEST_0300 start")
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
console.info("systemPasteBoard clear data success")
var pasteData = undefined
var pasteRecord = undefined;
var dataHtml = new ArrayBuffer(256)
pasteData = pasteboard.createData("x".repeat(1025),dataHtml)
expect(pasteData).assertEqual(undefined)
pasteData = pasteboard.createData("x".repeat(1024),dataHtml)
expect(pasteData != undefined).assertTrue();
var addHtml = new ArrayBuffer(128)
pasteData.addRecord("x".repeat(1025),dataHtml)
expect(pasteData.getRecordCount()).assertEqual(1)
pasteData.addRecord("x".repeat(1024),dataHtml)
expect(pasteData.getRecordCount()).assertEqual(2)
var recordHtml = new ArrayBuffer(64)
pasteRecord = pasteboard.createRecord("x".repeat(1025),dataHtml)
expect(pasteRecord).assertEqual(undefined);
pasteRecord = pasteboard.createRecord("x".repeat(1024),dataHtml)
expect(pasteRecord != undefined).assertTrue();;
pasteData.addRecord(pasteRecord)
await systemPasteBoard.setPasteData(pasteData).then(async () => {
console.info("set pastedata success")
await systemPasteBoard.hasPasteData().then(async (data) => {
console.info("Check pastedata has data success, result: " + data)
expect(data).assertTrue();
await systemPasteBoard.getPasteData().then(async (data) => {
console.info("get paste data success")
expect(data.getRecordCount()).assertEqual(3)
})
})
})
})
done();
})
console.info('end################################end');
});
}
......@@ -1795,20 +1795,22 @@ describe('deviceKvStoreCallbackTest', function () {
* @tc.name [JS-API8]DeviceKvStore.RemoveDeviceData()
* @tc.desc Test Js Api DeviceKvStore.RemoveDeviceData testcase 103
*/
it('testDeviceKvStoreRemoveDeviceData103', 0, async function (done) {
it('testDeviceKvStoreRemoveDeviceData103', 0, async function (done) {
console.info('testDeviceKvStoreRemoveDeviceData103');
try {
await kvStore.removeDeviceData('', function (err,data) {
if (err == undefined) {
console.info('testDeviceKvStoreRemoveDeviceData103 removeDeviceData success');
expect(null).assertFail();
expect(err == undefined).assertTrue();
} else {
console.info('testDeviceKvStoreRemoveDeviceData103 removeDeviceData fail');
console.info('testDeviceKvStoreRemoveDeviceData103 removeDeviceData fail ' + err);
expect(null).assertFail();
}
done();
});
}catch(e) {
console.info('testDeviceKvStoreRemoveDeviceData103 e ' + e);
expect(null).assertFail();
done();
}
})
......
......@@ -1990,11 +1990,11 @@ describe('deviceKvStorePromiseTest', function () {
it('testDeviceKvStoreRemoveDeviceData003', 0, async function (done) {
console.info('testDeviceKvStoreRemoveDeviceData003');
try {
await kvStore.removeDeviceData('').then((err) => {
await kvStore.removeDeviceData('').then(() => {
console.info('testDeviceKvStoreRemoveDeviceData003 removeDeviceData success');
expect(null).assertFail();
}).catch((err) => {
console.info('testDeviceKvStoreRemoveDeviceData003 removeDeviceData fail ' + err);
expect(null).assertFail();
});
}catch(e) {
console.info('testDeviceKvStoreRemoveDeviceData003 e ' + e);
......
......@@ -1754,20 +1754,22 @@ describe('singleKvStoreCallbackTest', function () {
* @tc.name [JS-API8]SingleKvStore.RemoveDeviceData()
* @tc.desc Test Js Api SingleKvStore.RemoveDeviceData() testcase 103
*/
it('testSingleKvStoreRemoveDeviceData103', 0, async function (done) {
it('testSingleKvStoreRemoveDeviceData103', 0, async function (done) {
console.info('testSingleKvStoreRemoveDeviceData103');
try {
await kvStore.removeDeviceData('', function (err,data) {
if (err == undefined) {
console.info('testSingleKvStoreRemoveDeviceData103 removeDeviceData success');
expect(null).assertFail();
expect(err == undefined).assertTrue();
} else {
console.info('testSingleKvStoreRemoveDeviceData103 removeDeviceData fail');
console.info('testSingleKvStoreRemoveDeviceData103 removeDeviceData fail: ' + err);
expect(null).assertFail();
}
done();
});
}catch(e) {
console.info('testSingleKvStoreRemoveDeviceData103 e ' + e);
expect(null).assertFail();
done();
}
})
......
......@@ -1959,11 +1959,11 @@ describe('singleKvStorePromiseTest', function () {
it('testSingleKvStoreRemoveDeviceData003', 0, async function (done) {
console.info('testSingleKvStoreRemoveDeviceData003');
try {
await kvStore.removeDeviceData('').then((err) => {
await kvStore.removeDeviceData('').then(() => {
console.info('testSingleKvStoreRemoveDeviceData003 removeDeviceData success');
expect(null).assertFail();
}).catch((err) => {
console.info('testSingleKvStoreRemoveDeviceData003 removeDeviceData fail ' + err);
expect(null).assertFail();
});
}catch(e) {
console.info('testSingleKvStoreRemoveDeviceData003 e ' + e);
......
......@@ -26,6 +26,7 @@ import rdbstoreStoreExcuteSqlTest from './RdbstoreStoreExcuteSqlJsunit.test.js'
import rdbstoreTransactionTest from './RdbstoreTransactionJsunit.test.js'
import rdbStoreUpdateTest from './RdbstoreUpdateJsunit.test.js'
import rdbstoreQueryTest from './RdbstoreQuery.test.js'
import rdbStoreEncryptionTest from './RdbstoreEncryptionJsunit.test.js'
export default function testsuite() {
rdbStoreBackupRestoreCallbackTest()
rdbStoreBackupRestoreWithFAContextTest()
......@@ -41,4 +42,5 @@ rdbstoreStoreExcuteSqlTest()
rdbstoreTransactionTest()
rdbStoreUpdateTest()
rdbstoreQueryTest()
rdbStoreEncryptionTest()
}
/*
* Copyright (C) 2022 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, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
import data_rdb from '@ohos.data.rdb'
import ability_featureAbility from '@ohos.ability.featureAbility'
const TAG = "[RDB_JSKITS_TEST]"
const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, "
+ "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)"
var rdbStore
var context
const STORE_CONFIG_ENCRYPT = {
name: "Encrypt.db",
encrypt: true,
}
const STORE_CONFIG_UNENCRYPT = {
name: "Unencrypt.db",
encrypt: false,
}
const STORE_CONFIG_WRONG = {
name: "Encrypt.db",
encrypt: false,
}
export default function rdbStoreEncryptionTest() {
async function CreatRdbStore(context, STORE_CONFIG) {
let rdbStore = await data_rdb.getRdbStore(context, STORE_CONFIG, 1)
await rdbStore.executeSql(CREATE_TABLE_TEST, null)
let u8 = new Uint8Array([1, 2, 3])
{
const valueBucket = {
"name": "zhangsan",
"age": 18,
"salary": 100.5,
"blobType": u8,
}
await rdbStore.insert("test", valueBucket)
}
{
const valueBucket = {
"name": "lisi",
"age": 28,
"salary": 100.5,
"blobType": u8,
}
await rdbStore.insert("test", valueBucket)
}
{
const valueBucket = {
"name": "wangwu",
"age": 38,
"salary": 90.0,
"blobType": u8,
}
await rdbStore.insert("test", valueBucket)
}
return rdbStore
}
describe('rdbEncryptTest', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
})
beforeEach(async function () {
console.info(TAG + 'beforeEach')
})
afterEach(async function () {
console.info(TAG + 'afterEach')
await data_rdb.deleteRdbStore(context, STORE_CONFIG_ENCRYPT.name)
await data_rdb.deleteRdbStore(context, STORE_CONFIG_UNENCRYPT.name)
await data_rdb.deleteRdbStore(context, STORE_CONFIG_WRONG.name)
rdbStore = null
})
afterAll(async function () {
console.info(TAG + 'afterAll')
})
console.log(TAG + "*************Unit Test Begin*************")
/**
* @tc.name RDB encrypted test
* @tc.number SUB_DDM_RDB_JS_RdbEncryptTest_0010
* @tc.desc RDB create encrypt db test
*/
it('RdbEncryptTest_0010', 0, async function (done) {
await console.log(TAG + "************* RdbEncryptTest_0010 start *************")
context = ability_featureAbility.getContext()
let storePromise = data_rdb.getRdbStore(context, STORE_CONFIG_ENCRYPT, 1);
storePromise.then(async (store) => {
try {
await console.log(TAG + "getRdbStore done: " + store);
} catch (err) {
expect(null).assertFail();
}
}).catch((err) => {
expect(null).assertFail();
})
await storePromise
storePromise = null
done()
await console.log(TAG + "************* RdbEncryptTest_0010 end *************")
})
/**
* @tc.name RDB unencrypted test
* @tc.number SUB_DDM_RDB_JS_RdbEncryptTest_0020
* @tc.desc RDB create unencrypted db test
*/
it('RdbEncryptTest_0020', 0, async function (done) {
await console.log(TAG + "************* RdbEncryptTest_0020 start *************")
context = ability_featureAbility.getContext()
let storePromise = data_rdb.getRdbStore(context, STORE_CONFIG_UNENCRYPT, 1);
storePromise.then(async (store) => {
try {
await console.log(TAG + "getRdbStore done: " + store);
} catch (err) {
expect(null).assertFail();
}
}).catch((err) => {
expect(null).assertFail();
})
await storePromise
storePromise = null
done()
await console.log(TAG + "************* RdbEncryptTest_0020 end *************")
})
/**
* @tc.name RDB Encrypt test
* @tc.number SUB_DDM_RDB_JS_RdbEncryptTest_0030
* @tc.desc RDB Encrypt function test
*/
it('RdbEncryptTest_0030', 0, async function (done) {
await console.log(TAG + "************* RdbEncryptTest_0030 start *************")
context = ability_featureAbility.getContext()
rdbStore = await CreatRdbStore(context, STORE_CONFIG_ENCRYPT)
let predicates = new data_rdb.RdbPredicates("test")
predicates.equalTo("name", "zhangsan")
let resultSet = await rdbStore.query(predicates)
try {
console.log(TAG + "After restore resultSet query done")
expect(true).assertEqual(resultSet.goToFirstRow())
const id = resultSet.getLong(resultSet.getColumnIndex("id"))
const name = resultSet.getString(resultSet.getColumnIndex("name"))
const blobType = resultSet.getBlob(resultSet.getColumnIndex("blobType"))
expect(1).assertEqual(id)
expect("zhangsan").assertEqual(name)
expect(1).assertEqual(blobType[0])
} catch (err) {
expect(false).assertTrue()
}
resultSet = null
rdbStore = null
done()
await console.log(TAG + "************* RdbEncryptTest_0030 end *************")
})
/**
* @tc.name RDB Encrypt test
* @tc.number SUB_DDM_RDB_JS_RdbEncryptTest_0040
* @tc.desc RDB Encrypt function test
*/
it('RdbEncryptTest_0040', 0, async function (done) {
await console.log(TAG + "************* RdbEncryptTest_0040 start *************")
context = ability_featureAbility.getContext()
rdbStore = await CreatRdbStore(context, STORE_CONFIG_ENCRYPT)
rdbStore = null
rdbStore = await CreatRdbStore(context, STORE_CONFIG_WRONG)
expect(rdbStore).assertNull
done()
await console.log(TAG + "************* RdbEncryptTest_0040 end *************")
})
console.log(TAG + "*************Unit Test End*************")
}
)
}
\ No newline at end of file
......@@ -3,6 +3,7 @@
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "600000",
"testcase-timeout": "300000",
"bundle-name": "ohos.global.napitest",
"package-name": "ohos.global.napitest",
"shell-timeout": "600000"
......
......@@ -3,6 +3,7 @@
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "300000",
"testcase-timeout": "300000",
"shell-timeout": "300000",
"bundle-name": "ohos.intl.test",
"package-name": "ohos.intl.test"
......
......@@ -89,7 +89,7 @@ describe('LangTest', function () {
console.log('i18n_test_clock_0100 ' + 'start');
let value = I18n.is24HourClock();
console.log('i18n_test_clock_0100 ' + value);
if(hour)
if(value)
{
expect(value).assertTrue();
}
......@@ -108,25 +108,21 @@ describe('LangTest', function () {
console.log('i18n_test_clock_0120 ' + 'start');
let value = I18n.is24HourClock();
console.log('i18n_test_clock_0120 ' + value);
if(hour)
if(value)
{
expect(value).assertTrue();
value = I18n.set24HourClock(false);
console.log('i18n_test_clock_0120 ' + value);
expect(value).assertTrue();
value = I18n.set24HourClock(true);
console.log('i18n_test_clock_0120 ' + value);
let hourclock = I18n.set24HourClock(false);
console.log('i18n_test_clock_0120 ' + hourclock);
hourclock = I18n.set24HourClock(true);
console.log('i18n_test_clock_0120 ' + hourclock);
expect(value).assertTrue();
}
else
{
let hourclock = I18n.set24HourClock(true);
console.log('i18n_test_clock_0120 ' + hourclock);
hourclock = I18n.set24HourClock(false);
console.log('i18n_test_clock_0120 ' + hourclock);
expect(value).assertFalse();
value = I18n.set24HourClock(true);
console.log('i18n_test_clock_0120 ' + value);
expect(value).assertTrue();
value = I18n.set24HourClock(false);
console.log('i18n_test_clock_0120 ' + value);
expect(value).assertTrue();
}
})
......@@ -160,7 +156,6 @@ describe('LangTest', function () {
else{
let value = I18n.addPreferredLanguage('en-Latn-US');
console.log('i18n_test_preferredlanguage_0120 ' + value);
expect(value).assertTrue();
}
console.log('i18n_test_preferredlanguage_0120 ' + I18n.getPreferredLanguageList());
})
......@@ -586,7 +581,7 @@ describe('LangTest', function () {
*/
it('dateorder_test_0100', 0, function () {
console.log('dateorder_test_0100 ' + 'start');
let value = I18n.Util.getDateOrder('zh');
let value = I18n.I18NUtil.getDateOrder('zh');
console.log('dateorder_test_0100 ' + value);
expect(value).assertEqual('y-L-d');
})
......@@ -598,7 +593,7 @@ describe('LangTest', function () {
*/
it('dateorder_test_0200', 0, function () {
console.log('dateorder_test_0200 ' + 'start');
let value = I18n.Util.getDateOrder('en');
let value = I18n.I18NUtil.getDateOrder('en');
console.log('dateorder_test_0200 ' + value);
expect(value).assertEqual('LLL-d-y');
})
......@@ -610,7 +605,7 @@ describe('LangTest', function () {
*/
it('dateorder_test_0300', 0, function () {
console.log('dateorder_test_0300 ' + 'start');
let value = I18n.Util.getDateOrder('th');
let value = I18n.I18NUtil.getDateOrder('th');
console.log('dateorder_test_0300 ' + value);
expect(value).assertEqual('d-LLL-y');
})
......@@ -622,7 +617,7 @@ describe('LangTest', function () {
*/
it('dateorder_test_0400', 0, function () {
console.log('dateorder_test_0400 ' + 'start');
let value = I18n.Util.getDateOrder('jp');
let value = I18n.I18NUtil.getDateOrder('jp');
console.log('dateorder_test_0400 ' + value);
expect(value).assertEqual('LLL-d-y');
})
......
......@@ -3,6 +3,7 @@
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "300000",
"testcase-timeout": "300000",
"shell-timeout": "300000",
"bundle-name": "ohos.perf.test",
"package-name": "ohos.perf.test"
......
......@@ -634,7 +634,7 @@ describe('PerfTest', function () {
let value = 'test';
let startTime = new Date().getTime();
for(let i = 0; i < EXETIME; i++){
value = I18n.Util.unitConvert({unit: 'hour', measureSystem: 'SI'},
value = I18n.I18NUtil.unitConvert({unit: 'hour', measureSystem: 'SI'},
{unit: 'second', measureSystem: 'SI'},
10,
'zh-CN',
......@@ -1068,7 +1068,7 @@ describe('PerfTest', function () {
let value = false;
let startTime = new Date().getTime();
for(let i = 0; i < EXETIME; i++){
value = I18n.Character.isDigit('abc');
value = I18n.Unicode.isDigit('abc');
}
let exeTime = new Date().getTime() - startTime;
let avgTime = exeTime/EXETIME;
......@@ -1094,7 +1094,7 @@ describe('PerfTest', function () {
let value = false;
let startTime = new Date().getTime();
for(let i = 0; i < EXETIME; i++){
value = I18n.Character.isSpaceChar('abc');
value = I18n.Unicode.isSpaceChar('abc');
}
let exeTime = new Date().getTime() - startTime;
let avgTime = exeTime/EXETIME;
......@@ -1121,7 +1121,7 @@ describe('PerfTest', function () {
let value = false;
let startTime = new Date().getTime();
for(let i = 0; i < EXETIME; i++){
value = I18n.Character.isWhitespace('abc');
value = I18n.Unicode.isWhitespace('abc');
}
let exeTime = new Date().getTime() - startTime;
let avgTime = exeTime/EXETIME;
......@@ -1147,7 +1147,7 @@ describe('PerfTest', function () {
let value = false;
let startTime = new Date().getTime();
for(let i = 0; i < EXETIME; i++){
value = I18n.Character.isRTL('abc');
value = I18n.Unicode.isRTL('abc');
}
let exeTime = new Date().getTime() - startTime;
let avgTime = exeTime/EXETIME;
......@@ -1173,7 +1173,7 @@ describe('PerfTest', function () {
let value = false;
let startTime = new Date().getTime();
for(let i = 0; i < EXETIME; i++){
value = I18n.Character.isIdeograph('abc');
value = I18n.Unicode.isIdeograph('abc');
}
let exeTime = new Date().getTime() - startTime;
let avgTime = exeTime/EXETIME;
......@@ -1199,7 +1199,7 @@ describe('PerfTest', function () {
let value = false;
let startTime = new Date().getTime();
for(let i = 0; i < EXETIME; i++){
value = I18n.Character.isLetter('abc');
value = I18n.Unicode.isLetter('abc');
}
let exeTime = new Date().getTime() - startTime;
let avgTime = exeTime/EXETIME;
......@@ -1225,7 +1225,7 @@ describe('PerfTest', function () {
let value = false;
let startTime = new Date().getTime();
for(let i = 0; i < EXETIME; i++){
value = I18n.Character.isLowerCase('abc');
value = I18n.Unicode.isLowerCase('abc');
}
let exeTime = new Date().getTime() - startTime;
let avgTime = exeTime/EXETIME;
......@@ -1251,7 +1251,7 @@ describe('PerfTest', function () {
let value = false;
let startTime = new Date().getTime();
for(let i = 0; i < EXETIME; i++){
value = I18n.Character.isUpperCase('ABC');
value = I18n.Unicode.isUpperCase('ABC');
}
let exeTime = new Date().getTime() - startTime;
let avgTime = exeTime/EXETIME;
......@@ -1277,7 +1277,7 @@ describe('PerfTest', function () {
let value = 'test';
let startTime = new Date().getTime();
for(let i = 0; i < EXETIME; i++){
value = I18n.Character.getType('a');
value = I18n.Unicode.getType('a');
}
let exeTime = new Date().getTime() - startTime;
let avgTime = exeTime/EXETIME;
......@@ -2101,7 +2101,7 @@ describe('PerfTest', function () {
let value = 'test';
let startTime = new Date().getTime();
for(let i = 0; i < EXETIME; i++){
value = I18n.Util.getDateOrder('zh');
value = I18n.I18NUtil.getDateOrder('zh');
}
let exeTime = new Date().getTime() - startTime;
let avgTime = exeTime/EXETIME;
......
......@@ -3,6 +3,7 @@
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "300000",
"testcase-timeout": "300000",
"shell-timeout": "60000",
"bundle-name": "ohos.resmgr.test",
"package-name": "ohos.resmgr.test"
......
......@@ -1418,6 +1418,57 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
})
})
/**
* @tc.number SUB_WINDOW_SETDENSITTYDPI_JSAPI_002
* @tc.name Test setDensityDpiTest2
* @tc.desc Verify Sets the screen pixel
*/
it('setDensityDpiTest2', 0, async function (done) {
let caseName = 'setDensityDpiTest2';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin');
let screens = await screenManager.getAllScreens().catch(errScreen => {
unexpectedError(errScreen, caseName, 'screenManager.getAllScreen', done);
})
console.log(msgStr + 'screenManager.getAllScreen' + JSON.stringify(screens));
expect(!!screens).assertTrue();
let currentDeviceDefaultDpi;
let currentDeviceDefault = null;
display.getDefaultDisplay(async(err, data) => {
if (err.code) {
console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(err));
return;
}
console.info('Succeeded in obtaining the default display object. Data:' + JSON.stringify(data));
currentDeviceDefault = data;
currentDeviceDefaultDpi = parseInt(currentDeviceDefault.densityDPI)
let dpiItem = [-80, 80, 1000, 160, 0, 320, 188.88, 0, 640, 300,currentDeviceDefaultDpi];
for (let i = 0;i < dpiItem.length; i++) {
await sleep(1000);
screens[0].setDensityDpi(dpiItem[i],(errDpi,dataDpi)=>{
if (errDpi.code) {
console.error('Failed to set DensityDpi. Cause: ' + JSON.stringify(err)+ dpiItem[i]);
return;
}
console.log(msgStr + 'screen.setDensityDpi success set DPI ' + dpiItem[i]);
display.getDefaultDisplay((error,result)=>{
if (error.code) {
console.error(msgStr + 'screen.setDensityDpi display.getDefaultDisplay failed');
return;
console.log(msgStr + 'screen.setDensityDpi display.getDefaultDisplay' + JSON.stringify(result));
let isEqual = Number(result.densityDPI) == parseInt(dpiItem[i])
console.log(msgStr + 'same ? ' + isEqual)
expect(isEqual).assertTrue()
}
})
})
}
});
console.log(msgStr + 'done ');
done();
})
/**
* @tc.number SUB_WINDOW_SETPREFERREDORIENTATION_JSAPI_002
* @tc.name Test setPreferredOrientationTest2
* @tc.desc Sets the display direction property of the window
......
......@@ -1332,7 +1332,12 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
})
console.log(msgStr + 'screenManager.getAllScreen' + JSON.stringify(screens));
expect(!!screens).assertTrue();
let dpiItem = [-80, 80, 1000, 160, 0, 320, 188.88, 0, 640, 300];
let currentDeviceDefault = await display.getDefaultDisplay().catch(err => {
console.log(msgStr + 'screen.setDensityDpi display.getDefaultDisplay failed current device');
});
console.log(msgStr + 'screen.setDensityDpi display.getDefaultDisplay current device' + JSON.stringify(currentDeviceDefault));
let currentDeviceDefaultDpi = parseInt(currentDeviceDefault.densityDPI)
let dpiItem = [-80, 80, 1000, 160, 0, 320, 188.88, 0, 640, 300,currentDeviceDefaultDpi];
for (let i = 0;i < dpiItem.length; i++) {
await sleep(1000);
await screens[0].setDensityDpi(dpiItem[i]).then(async () => {
......
......@@ -84,10 +84,10 @@ export default function inputMethodJSUnit() {
console.info("inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl));
inputMethodCtrl.stopInput().then(data => {
console.info("inputmethoh_test_006 stopInput result----" + data);
expect(data == true).assertTrue()
expect(data == true).assertTrue();
}).catch(err => {
console.info("inputmethoh_test_006 stopInput is err: " + JSON.stringify(err));
expect().assertFail()
expect().assertFail();
});
done();
});
......@@ -118,12 +118,12 @@ export default function inputMethodJSUnit() {
packageName:"com.example.kikakeyboard",
methodId:"ServiceExtAbility"
}
inputMethod.switchInputMethod(inputMethodProperty).then(data => {
console.info("inputmethod_test_switchInputMethod_001 data:" + data)
expect(data == true).assertTrue();
}).catch( err=> {
console.info("inputmethod_test_switchInputMethod_001 err:" + err)
expect().assertFail();
})
console.info("************* inputmethod_test_switchInputMethod_001 Test end*************");
done();
......@@ -144,7 +144,7 @@ export default function inputMethodJSUnit() {
inputMethod.switchInputMethod(inputMethodProperty, (err, data)=>{
if(err){
console.info("inputmethod_test_switchInputMethod_002 error:" + err);
expect().assertFail()
expect().assertFail();
}
console.info("inputmethod_test_switchInputMethod_002 data:" + data)
expect(data == true).assertTrue();
......@@ -164,8 +164,10 @@ export default function inputMethodJSUnit() {
inputMethodCtrl.showSoftKeyboard((data)=>{
if(data == undefined){
console.info("showSoftKeyboard callbace success" );
expect(true).assertTrue();
}else{
console.info('showSoftKeyboard callbace failed : ' + JSON.stringify(err))
expect().assertFail();
}
});
console.info("************* inputmethod_test_showSoftKeyboard_001 Test end*************");
......@@ -182,8 +184,10 @@ export default function inputMethodJSUnit() {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard().then((data) =>{
console.info("showSoftKeyboard promise success" );
expect(true).assertTrue();
}).catch((err) => {
console.info('showSoftKeyboard promise failed : ' + JSON.stringify(err))
expect().assertFail();
})
console.info("************* inputmethod_test_showSoftKeyboard_002 Test end*************");
done();
......@@ -200,8 +204,10 @@ export default function inputMethodJSUnit() {
inputMethodCtrl.hideSoftKeyboard((data)=>{
if(data == undefined){
console.info("hideSoftKeyboard callbace success" );
expect(true).assertTrue();
}else{
console.info('hideSoftKeyboard callbace failed : ' + JSON.stringify(err))
expect().assertFail();
}
});
console.info("************* inputmethod_test_hideSoftKeyboard_001 Test end*************");
......@@ -218,11 +224,72 @@ export default function inputMethodJSUnit() {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard().then((data) =>{
console.info("hideSoftKeyboard promise success" );
expect(true).assertTrue();
}).catch((err) => {
console.info('hideSoftKeyboard promise failed : ' + JSON.stringify(err))
expect().assertFail();
})
console.info("************* inputmethod_test_hideSoftKeyboard_002 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_getCurrentInputMethod_001
* @tc.name return The InputMethodProperty object of the current input method.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_getCurrentInputMethod_001', 0, async function (done) {
let currentIme = inputMethod.getCurrentInputMethod();
console.info("inputmethod_test_getCurrentInputMethod_001 currentIme---" + JSON.stringify(currentIme));
console.info(currentIme.packageName);
console.info(currentIme.methodId);
expect(currentIme.packageName != null).assertTrue();
expect(currentIme.methodId != null).assertTrue();
console.info("************* inputmethod_test_getCurrentInputMethod_001 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_listInputMethod_001
* @tc.name param enable :
* if true, collect enabled input methods.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_listInputMethod_001', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethod_test_listInputMethod_001 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.listInputMethod(true, (err, arr) => {
if (err) {
console.error("inputmethod_test_listInputMethod_001 failed because: " + JSON.stringify(err));
expect().assertFail();
};
console.info("inputmethod_test_listInputMethod_001 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue();
});
done();
});
/*
* @tc.number inputmethod_test_listInputMethod_002
* @tc.name param enable :
* if false, collect disabled input methods.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_listInputMethod_002', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethod_test_listInputMethod_002 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.listInputMethod(false, (err, arr) => {
if (err) {
console.error("inputmethod_test_listInputMethod_002 failed because: " + JSON.stringify(err));
expect().assertFail();
};
console.info("inputmethod_test_listInputMethod_002 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue();
});
done();
});
})
}
......@@ -36,11 +36,18 @@ const FILE_TYPE = mediaLibrary.MediaType.FILE;
const FILEKEY = mediaLibrary.FileKey;
const { RELATIVE_PATH, ALBUM_NAME, MEDIA_TYPE } = FILEKEY
const sleep = async function sleep(times = 10) {
await new Promise(res => setTimeout(res, times));
}
const allFetchOp = function (others = {}) {
const sleep = async function sleep(times) {
if (!times) {
times = 10;
}
await new Promise((res) => setTimeout(res, times));
};
const allFetchOp = function (others) {
if (!others) {
others = {};
}
return {
selections: '',
selectionArgs: [],
......@@ -48,7 +55,10 @@ const allFetchOp = function (others = {}) {
};
}
const fetchOps = function (testNum, path, type, others = {}) {
const fetchOps = function (testNum, path, type, others) {
if (!others) {
others = {};
}
let ops = {
selections: FILEKEY.RELATIVE_PATH + '= ? AND ' + FILEKEY.MEDIA_TYPE + '=?',
selectionArgs: [path, type.toString()],
......@@ -84,8 +94,10 @@ const fileIdFetchOps = function (testNum, id) {
return ops;
};
const albumFetchOps = function (testNum, path, albumName, type,
others = { order: FILEKEY.DATE_ADDED + " DESC", }) {
const albumFetchOps = function (testNum, path, albumName, type, others) {
if (!others) {
others = { order: FILEKEY.DATE_ADDED + " DESC", };
}
let ops = {
selections: RELATIVE_PATH + '= ? AND ' + ALBUM_NAME + '= ? AND ' + MEDIA_TYPE + '= ?',
selectionArgs: [path, albumName, type.toString()],
......@@ -96,8 +108,10 @@ const albumFetchOps = function (testNum, path, albumName, type,
}
// albums of two resource types
const albumTwoTypesFetchOps = function (testNum, paths, albumName, types,
others = { order: FILEKEY.DATE_ADDED + " DESC", }) {
const albumTwoTypesFetchOps = function (testNum, paths, albumName, types, others) {
if (!others) {
others = { order: FILEKEY.DATE_ADDED + " DESC" };
}
try {
let ops = {
selections: '(' + RELATIVE_PATH + '= ? or ' +
......@@ -116,7 +130,10 @@ const albumTwoTypesFetchOps = function (testNum, paths, albumName, types,
}
// albums of three resource types
const albumThreeTypesFetchOps = function (testNum, paths, albumName, types, others = { order: FILEKEY.DATE_ADDED, }) {
const albumThreeTypesFetchOps = function (testNum, paths, albumName, types, others) {
if (!others) {
others = { order: FILEKEY.DATE_ADDED + " DESC" };
}
try {
let ops = {
selections: '(' + RELATIVE_PATH + '= ? or ' +
......@@ -181,9 +198,12 @@ const checkAlbumsCount = function (done, testNum, albumList, expectCount) {
return albumsCount == expectCount;
}
const getPermission = async function (name = 'ohos.acts.multimedia.mediaLibrary') {
const getPermission = async function (name) {
if (!name) {
name = "ohos.acts.multimedia.mediaLibrary";
}
console.info('getPermission start', name)
let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.mediaLibrary', 0, 100);
let appInfo = await bundle.getApplicationInfo(name, 0, 100);
let tokenID = appInfo.accessTokenId;
let atManager = abilityAccessCtrl.createAtManager();
let result1 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.MEDIA_LOCATION", 1);
......
......@@ -77,6 +77,7 @@ export default function fileAssetTestCallbackTest(abilityContext) {
console.info(`fd1:${fd1},fd:${fd}`)
await asset.close(fd);
await asset1.close(fd1);
await sleep(50);
let newFetchFileResult = await media.getFileAssets(fileIdFetchOps(testNum, asset.id));
let checkAssetCountPass = await checkAssetsCount(done, testNum, newFetchFileResult, 1);
if (!checkAssetCountPass) return;
......
......@@ -71,6 +71,7 @@ export default function fileAssetTestPromiseTest(abilityContext) {
console.info(`fd1:${fd1},fd:${fd}`)
await asset.close(fd);
await asset1.close(fd1);
await sleep(50);
let newFetchFileResult = await media.getFileAssets(fileIdFetchOps(testNum, asset.id));
checkAssetCountPass = await checkAssetsCount(done, testNum, newFetchFileResult, 1);
if (!checkAssetCountPass) return;
......
......@@ -17,6 +17,7 @@ group("security") {
testonly = true
if (is_standard_system) {
deps = [
"access_token/AccessTokenTest_Normal_js:ActsAccessTokenApiJSNormalTest",
"cipher/datacipher:datacipher",
"security_huks_basic",
]
......
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
......@@ -89,12 +89,12 @@ protected:
};
/*
* @tc.name: testSecPMPMS_126
* @tc.name: SUB_SEC_AppSEC_PermissionMgmt_PMS_5000
* @tc.desc: revoke permissions to large and small PIDs
* @tc.type: FUNC
* @tc.require: AR000E07N7
*/
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_126, Function | MediumTest | Level3)
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_5000, Function | MediumTest | Level3)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
LoadPermissions(TEST_APP_ID, MAX_PID);
......@@ -113,12 +113,12 @@ HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_126, Function | MediumTest | Lev
}
/*
* @tc.name: testSecPMPMS_127
* @tc.name: SUB_SEC_AppSEC_PermissionMgmt_PMS_5100
* @tc.desc: revoke permissions while not load permiossion
* @tc.type: FUNC
* @tc.require: AR000F4FSI
*/
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_127, Function | MediumTest | Level2)
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_5100, Function | MediumTest | Level2)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
int ret = g_interface->RevokeRuntimePermission(TEST_TASKID, g_systemPers[0].name);
......@@ -129,12 +129,12 @@ HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_127, Function | MediumTest | Lev
}
/*
* @tc.name: testSecPMPMS_128
* @tc.name: SUB_SEC_AppSEC_PermissionMgmt_PMS_5200
* @tc.desc: revoke runtime app permissions
* @tc.type: FUNC
* @tc.require: AR000F4FSI
*/
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_128, Function | MediumTest | Level0)
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_5200, Function | MediumTest | Level0)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
LoadPermissions(TEST_APP_ID, TEST_TASKID);
......@@ -147,12 +147,12 @@ HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_128, Function | MediumTest | Lev
}
/*
* @tc.name: testSecPMPMS_129
* @tc.name: SUB_SEC_AppSEC_PermissionMgmt_PMS_5300
* @tc.desc: revoke permissions without request
* @tc.type: FUNC
* @tc.require: AR000F4FSI
*/
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_129, Function | MediumTest | Level2)
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_5300, Function | MediumTest | Level2)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, 1, FIRST_INSTALL);
LoadPermissions(TEST_APP_ID, TEST_TASKID);
......@@ -165,12 +165,12 @@ HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_129, Function | MediumTest | Lev
}
/*
* @tc.name: testSecPMPMS_130
* @tc.name: SUB_SEC_AppSEC_PermissionMgmt_PMS_5400
* @tc.desc: revoke system_grant permissions
* @tc.type: FUNC
* @tc.require: AR000F4FSI
*/
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_130, Function | MediumTest | Level2)
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_5400, Function | MediumTest | Level2)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
LoadPermissions(TEST_APP_ID, TEST_TASKID);
......@@ -183,12 +183,12 @@ HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_130, Function | MediumTest | Lev
}
/*
* @tc.name: testSecPMPMS_131
* @tc.name: SUB_SEC_AppSEC_PermissionMgmt_PMS_5500
* @tc.desc: revoke user_grant permissions
* @tc.type: FUNC
* @tc.require: AR000F4FSI
*/
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_131, Function | MediumTest | Level1)
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_5500, Function | MediumTest | Level1)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
LoadPermissions(TEST_APP_ID, TEST_TASKID);
......@@ -204,12 +204,12 @@ HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_131, Function | MediumTest | Lev
}
/*
* @tc.name: testSecPMPMS_132
* @tc.name: SUB_SEC_AppSEC_PermissionMgmt_PMS_5600
* @tc.desc: revoke unknown permissions
* @tc.type: FUNC
* @tc.require: AR000F4FSI
*/
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_132, Function | MediumTest | Level3)
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_5600, Function | MediumTest | Level3)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
LoadPermissions(TEST_APP_ID, TEST_TASKID);
......@@ -222,12 +222,12 @@ HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_132, Function | MediumTest | Lev
}
/*
* @tc.name: testSecPMPMS_133
* @tc.name: SUB_SEC_AppSEC_PermissionMgmt_PMS_5700
* @tc.desc: revoke runtime permissions after revoke permission
* @tc.type: FUNC
* @tc.require: AR000F4FSI
*/
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_133, Function | MediumTest | Level3)
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_5700, Function | MediumTest | Level3)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
g_interface->GrantPermission(TEST_APP_ID, g_systemPers[0].name);
......@@ -242,12 +242,12 @@ HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_133, Function | MediumTest | Lev
}
/*
* @tc.name: testSecPMPMS_134
* @tc.name: SUB_SEC_AppSEC_PermissionMgmt_PMS_5800
* @tc.desc: revoke runtime permissions after grant permission
* @tc.type: FUNC
* @tc.require: AR000F4FSI
*/
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_134, Function | MediumTest | Level2)
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_5800, Function | MediumTest | Level2)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
g_interface->GrantPermission(TEST_APP_ID, g_systemPers[0].name);
......@@ -261,12 +261,12 @@ HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_134, Function | MediumTest | Lev
}
/*
* @tc.name: testSecPMPMS_135
* @tc.name: SUB_SEC_AppSEC_PermissionMgmt_PMS_5900
* @tc.desc: revoke runtime permissions continuously
* @tc.type: FUNC
* @tc.require: AR000F4FSI
*/
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_135, Function | MediumTest | Level2)
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_5900, Function | MediumTest | Level2)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
LoadPermissions(TEST_APP_ID, TEST_TASKID);
......@@ -285,24 +285,24 @@ HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_135, Function | MediumTest | Lev
}
/*
* @tc.name: testSecPMPMS_136
* @tc.name: SUB_SEC_AppSEC_PermissionMgmt_PMS_6000
* @tc.desc: revoke permissions of unnormal task
* @tc.type: FUNC
* @tc.require: AR000F4FSI
*/
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_136, Function | MediumTest | Level3)
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_6000, Function | MediumTest | Level3)
{
int ret = g_interface->RevokeRuntimePermission(ABNORMAL_TASKID, g_systemPers[0].name);
EXPECT_EQ(ret, PERM_ERRORCODE_TASKID_NOT_EXIST) << "revoke ret = " << ret << endl;
}
/*
* @tc.name: testSecPMPMS_137
* @tc.name: SUB_SEC_AppSEC_PermissionMgmt_PMS_6100
* @tc.desc: revoke permissions of unnormal permission
* @tc.type: FUNC
* @tc.require: AR000F4FSI
*/
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_137, Function | MediumTest | Level4)
HWTEST_F(ActsPMSRevokeRuntimeTest, testSecPMPMS_6100, Function | MediumTest | Level4)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
LoadPermissions(TEST_APP_ID, TEST_TASKID);
......
......@@ -98,11 +98,11 @@ long GetCurrentTimeMillis()
}
/**
* @tc.number Security_AppSecurity_PermissionManager_L1_UpdatePermissionFlags_001
* @tc.number SUB_SEC_AppSEC_PermissionMgmt_PMS_6200
* @tc.name Update permission flags
* @tc.desc [C- SECURITY -1000]
*/
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_001, Function | MediumTest | Level2)
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_6200, Function | MediumTest | Level2)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
......@@ -130,11 +130,11 @@ HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_001, Function | Med
}
/**
* @tc.number Security_AppSecurity_PermissionManager_L1_UpdatePermissionFlags_002
* @tc.number SUB_SEC_AppSEC_PermissionMgmt_PMS_6300
* @tc.name Update permission flags (No reminds after rejection)
* @tc.desc [C- SECURITY -1000]
*/
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_002, Function | MediumTest | Level2)
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_6300, Function | MediumTest | Level2)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
......@@ -162,11 +162,11 @@ HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_002, Function | Med
}
/**
* @tc.number Security_AppSecurity_PermissionManager_L1_UpdatePermissionFlags_003
* @tc.number SUB_SEC_AppSEC_PermissionMgmt_PMS_6400
* @tc.name Update permission flags (Name does not exist)
* @tc.desc [C- SECURITY -1000]
*/
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_003, Function | MediumTest | Level2)
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_6400, Function | MediumTest | Level2)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
......@@ -199,11 +199,11 @@ HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_003, Function | Med
}
/**
* @tc.number Security_AppSecurity_PermissionManager_L1_UpdatePermissionFlags_004
* @tc.number SUB_SEC_AppSEC_PermissionMgmt_PMS_6500
* @tc.name Update permission flags (Name empty)
* @tc.desc [C- SECURITY -1000]
*/
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_004, Function | MediumTest | Level2)
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_6500, Function | MediumTest | Level2)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
......@@ -236,11 +236,11 @@ HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_004, Function | Med
}
/**
* @tc.number Security_AppSecurity_PermissionManager_L1_UpdatePermissionFlags_005
* @tc.number SUB_SEC_AppSEC_PermissionMgmt_PMS_6600
* @tc.name Update permission flags (Name invalid)
* @tc.desc [C- SECURITY -1000]
*/
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_005, Function | MediumTest | Level2)
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_6600, Function | MediumTest | Level2)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
......@@ -269,11 +269,11 @@ HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_005, Function | Med
}
/**
* @tc.number Security_AppSecurity_PermissionManager_L1_UpdatePermissionFlags_006
* @tc.number SUB_SEC_AppSEC_PermissionMgmt_PMS_6700
* @tc.name Updatepermissionflags interface stability test
* @tc.desc [C- SECURITY -1000]
*/
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_006, Function | MediumTest | Level2)
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_6700, Function | MediumTest | Level2)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
......@@ -302,11 +302,11 @@ HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_006, Function | Med
}
/**
* @tc.number Security_AppSecurity_PermissionManager_L1_UpdatePermissionFlags_007
* @tc.number SUB_SEC_AppSEC_PermissionMgmt_PMS_6800
* @tc.name Updatepermissionflags interface performace test
* @tc.desc [C- SECURITY -1000]
*/
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_007, Function | MediumTest | Level2)
HWTEST_F(ActsPMSUpdatePermissionTest, testSecPMUpdatePMFlags_6800, Function | MediumTest | Level2)
{
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
......
......@@ -17,7 +17,6 @@ _all_test_packages = [
"${ACTS_ROOT}/arkXtest:arkXtest",
"${ACTS_ROOT}/global:global",
"${ACTS_ROOT}/security:security",
"${ACTS_ROOT}/accessControl:accessControl",
"${ACTS_ROOT}/useriam:useriam",
"${ACTS_ROOT}/multimedia:multimedia",
"${ACTS_ROOT}/bundlemanager:appexecfwk",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册