提交 b6c38ee8 编写于 作者: Z zhaoyuan17

VerifyPermission modify

Signed-off-by: Nzhaoyuan17 <zhaoyuan17@huawei.com>
上级 0760cb37
......@@ -6,6 +6,5 @@
</div>
<div>
<input class="btn" type="button" value="permissionTest" on:click="clickAction"></input>
<input class="btn" type="button" value="changeTitle" on:click="titleAction"></input>
</div>
</div>
......@@ -23,28 +23,28 @@ div{
margin-bottom: 10px;
width: 200px;
height: 50px;
justify-content: center;
}
.log {
font-size: 20px;
text-align: center;
width: 100%;
height: 400px;
height: 250px;
}
.todo-wraper {
width: 450px;
height: 450px;
width: 100%;
height: 600px;
justify-content: center;
}
.todo-item {
width: 450px;
flex-direction: column;
width: 100%;
justify-content: center;
}
.text {
margin: 20%;
}
.menu-wraper {
width: 450px;
width: 100%;
height: 100px;
justify-content: center;
}
\ No newline at end of file
......@@ -10,17 +10,10 @@
</textarea>
</div>
<div>
<!-- <input class="btn" type="button" onclick="ShowMenu" class="text">Select Case</input>-->
<select class="menu-wraper" id="menu-wraper" onchange="CaseChange">
<option for="{{testcase}}" value="{{$item}}">abc</option>
</select>
<button type="capsule" class="btn" value="RunSelectCase" on:click="RunSelectCase"></button>
<list class="todo-wraper">
<list-item for="{{testcase}}" class="todo-item">
<input class="btn" type="button" value="{{$item}}" on:click="runCase({{$item}})"></input>
</list-item>
</list>
<button type="capsule" class="btn" value="RunTest" on:click="testAction"></button>
<input class="btn" type="button" value="Back" on:click="clickAction"></input>
</div>
</div>
......@@ -17,8 +17,7 @@ import file from '@system.file'
import app from '@system.app'
import router from '@system.router';
import featureAbility from '@ohos.ability.featureability'
import abilityManager from '@ohos.app.abilitymanager'
import bundle from '@ohos.bundle'
import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'
export default {
......@@ -27,37 +26,34 @@ export default {
title: "AbilityA1",
logmessage: "this is log message",
testcase: [
"AppPermission_0100",
"AppPermission_0200",
"AppPermission_0300",
"AppPermission_0400",
"AppPermission_0500",
"AppPermission_0600",
"AppPermission_0700",
"AppPermission_0800",
"AppPermission_0900",
"AppPermission_1000",
"AppPermission_1100",
"AppPermission_1200",
"AppPermission_1300",
"AppPermission_1400",
"AppPermission_1500",
"AppPermission_1600",
"AppPermission_1700",
"AppPermission_1800",
"AppPermission_1900",
"AppPermission_2000",
"AppPermission_2100",
"AppPermission_2200",
"AppPermission_2300",
"AppPermission_2400",
"AppPermission_2500",
"AppPermission_2600_ResPermission",
"AppPermission_2600",
"AppPermission_2700_ResPermission",
"AppPermission_2700",
"AppPermission_2800_ResPermission",
"AppPermission_2800",
"ACTS_AppPermission_0100",
"ACTS_AppPermission_0200",
"ACTS_AppPermission_0300",
"ACTS_AppPermission_0400",
"ACTS_AppPermission_0500",
"ACTS_AppPermission_0600",
"ACTS_AppPermission_0700",
"ACTS_AppPermission_0800",
"ACTS_AppPermission_0900",
"ACTS_AppPermission_1000",
"ACTS_AppPermission_1100",
"ACTS_AppPermission_1200",
"ACTS_AppPermission_1300",
"ACTS_AppPermission_1400",
"ACTS_AppPermission_1500",
"ACTS_AppPermission_1600",
"ACTS_AppPermission_1700",
"ACTS_AppPermission_1800",
"ACTS_AppPermission_1900",
"ACTS_AppPermission_2000",
"ACTS_AppPermission_2100",
"ACTS_AppPermission_2200",
"ACTS_AppPermission_2300",
"ACTS_AppPermission_2400",
"ACTS_AppPermission_2500",
"ACTS_AppPermission_2600",
"ACTS_AppPermission_2700",
"ACTS_AppPermission_2800",
],
},
onInit() {
......@@ -81,22 +77,6 @@ export default {
uri: 'pages/index/index'
})
},
testAction() {
console.info('===========per testAction===========>')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
const reportExtend = new ReportExtend(file)
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
runCase(caseName) {
console.debug("======per runCase======>:" + JSON.stringify(caseName))
this.logmessage += caseName + "\n"
......@@ -104,19 +84,5 @@ export default {
let { runAllCase } = require('./permissioncase.js')
runAllCase(caseName, this)
},
CaseChange(newValue) {
let { GetCaseInfo } = require('./permissioncase.js')
this.logmessage = newValue.value
this.logmessage += GetCaseInfo(newValue.value)
this.currentCase = newValue.value
},
RunSelectCase() {
let { runAllCase } = require('./permissioncase.js')
runAllCase(this.currentCase, this)
},
ShowMenu() {
this.logmessage = "show"
this.$element("menu-wraper").show({ x: 200, y: 200 })
}
}
/*
* 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 bundle from '@ohos.bundle'
import featureAbility from '@ohos.ability.featureability'
import abilityManager from '@ohos.app.abilitymanager'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe ('AmsSystemTest_AppPermission', function () {
it('AppPermission_0100', 0, async function (done) {
console.info('=====================AppPermission_0100==================<');
var dataInfo = await bundle.getBundleInfo('com.amsst.amsjsstmain',1);
console.debug("======dataInfo======>:" + JSON.stringify(dataInfo));
var processInfoArray = await abilityManager.getAllRunningProcesses();
console.debug("======processInfoArray======>:" + JSON.stringify(processInfoArray));
var thisProcessInfo = processInfoArray[0];
for(let i=0; i<processInfoArray.length;i++) {
if(processInfoArray[i].processName == "com.amsst.amsjsstmain") {
thisProcessInfo = processInfoArray[i]
break
}
}
console.debug("======thisProcessInfo======>:" + JSON.stringify(thisProcessInfo));
var context = await featureAbility.getContext();
await context.verifyPermission("ohos.permission.GET_NETWORK_INFO", thisProcessInfo.pid, thisProcessInfo.uid,
(err, data) => {
console.debug("======verifyPermission:data======>:" + JSON.stringify(data));
expect(err.code).assertEqual(0)
expect(data).assertEqual(0)
done()
})
done()
})
it('AppPermission_0200', 0, async function (done) {
console.info('=====================AppPermission_0200==================<');
var processInfoArray = await abilityManager.getAllRunningProcesses();
console.debug("======processInfoArray======>:" + JSON.stringify(processInfoArray));
var thisProcessInfo = processInfoArray[0];
for(let i=0; i<processInfoArray.length;i++) {
if(processInfoArray[i].processName == "com.amsst.amsjsstmain") {
thisProcessInfo = processInfoArray[i]
break
}
}
console.debug("======thisProcessInfo======>:" + JSON.stringify(thisProcessInfo));
var context = await featureAbility.getContext();
var result = await context.verifyPermission("ohos.permission.GET_NETWORK_INFO", thisProcessInfo.pid, thisProcessInfo.uid)
console.debug("======result======>:" + JSON.stringify(result));
expect(result).assertEqual(0);
done()
})
it('AppPermission_0300', 0, async function (done) {
console.info('=====================AppPermission_0300==================<');
var processInfoArray = await abilityManager.getAllRunningProcesses();
console.debug("======processInfoArray======>:" + JSON.stringify(processInfoArray));
var thisProcessInfo = processInfoArray[0];
for(let i=0; i<processInfoArray.length;i++) {
if(processInfoArray[i].processName == "com.amsst.amsjsstmain") {
thisProcessInfo = processInfoArray[i]
break
}
}
console.debug("======thisProcessInfo======>:" + JSON.stringify(thisProcessInfo));
var context = await featureAbility.getContext();
await context.verifyPermission("ohos.permission.GET_NETWORK_INFO", thisProcessInfo.pid, thisProcessInfo.uid,
(err, data) => {
expect(err.code).assertEqual(0)
expect(data).assertEqual(0)
done()
})
done()
})
it('AppPermission_0400', 0, async function (done) {
console.info('=====================AppPermission_0400==================<');
var processInfoArray = await abilityManager.getAllRunningProcesses();
console.debug("======processInfoArray======>:" + JSON.stringify(processInfoArray));
var thisProcessInfo = processInfoArray[0];
for(let i=0; i<processInfoArray.length;i++) {
if(processInfoArray[i].processName == "com.amsst.amsjsstmain") {
thisProcessInfo = processInfoArray[i]
break
}
}
console.debug("======thisProcessInfo======>:" + JSON.stringify(thisProcessInfo));
var context = await featureAbility.getContext();
var result = await context.verifyPermission("com.amsst.permission.SYSPERMISSION", thisProcessInfo.pid, thisProcessInfo.uid)
console.debug("======result======>:" + JSON.stringify(result));
expect(result).assertEqual(0);
done()
})
it('AppPermission_0500', 0, async function (done) {
console.info('=====================AppPermission_0500==================<');
var processInfoArray = await abilityManager.getAllRunningProcesses();
console.debug("======processInfoArray======>:" + JSON.stringify(processInfoArray));
var thisProcessInfo = processInfoArray[0];
for(let i=0; i<processInfoArray.length;i++) {
if(processInfoArray[i].processName == "com.amsst.amsjsstmain") {
thisProcessInfo = processInfoArray[i]
break
}
}
console.debug("======thisProcessInfo======>:" + JSON.stringify(thisProcessInfo));
var context = await featureAbility.getContext();
var result = await context.verifySelfPermission("com.amsst.permission.SYSPERMISSION")
console.debug("======com.amsst.permission.SYSPERMISSION:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.GET_NETWORK_INFO")
console.debug("======ohos.permission.GET_NETWORK_INFO======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.GET_WIFI_INFO")
console.debug("======ohos.permission.GET_WIFI_INFO:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.USE_BLUETOOTH")
console.debug("======ohos.permission.USE_BLUETOOTH:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.DISCOVER_BLUETOOTH")
console.debug("======ohos.permission.DISCOVER_BLUETOOTH:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.SET_NETWORK_INFO")
console.debug("======ohos.permission.SET_NETWORK_INFO:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.SET_WIFI_INFO")
console.debug("======ohos.permission.SET_WIFI_INFO:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.SPREAD_STATUS_BAR")
console.debug("======ohos.permission.SPREAD_STATUS_BAR:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.INTERNET")
console.debug("======ohos.permission.INTERNET:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.MODIFY_AUDIO_SETTINGS")
console.debug("======ohos.permission.MODIFY_AUDIO_SETTINGS:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.RECEIVER_STARTUP_COMPLETED")
console.debug("======ohos.permission.RECEIVER_STARTUP_COMPLETED:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.RUNNING_LOCK")
console.debug("======ohos.permission.RUNNING_LOCK:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.ACCESS_BIOMETRIC")
console.debug("======ohos.permission.ACCESS_BIOMETRIC:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.RCV_NFC_TRANSACTION_EVENT")
console.debug("======ohos.permission.RCV_NFC_TRANSACTION_EVENT:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.COMMONEVENT_STICKY")
console.debug("======ohos.permission.COMMONEVENT_STICKY:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.SYSTEM_FLOAT_WINDOW")
console.debug("======ohos.permission.SYSTEM_FLOAT_WINDOW:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.VIBRATE")
console.debug("======ohos.permission.VIBRATE:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.USE_TRUSTCIRCLE_MANAGER")
console.debug("======ohos.permission.USE_TRUSTCIRCLE_MANAGER:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.USE_WHOLE_SCREEN")
console.debug("======ohos.permission.USE_WHOLE_SCREEN:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.SET_WALLPAPER")
console.debug("======ohos.permission.SET_WALLPAPER:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.SET_WALLPAPER_DIMENSION")
console.debug("======ohos.permission.SET_WALLPAPER_DIMENSION:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.REARRANGE_MISSIONS")
console.debug("======ohos.permission.REARRANGE_MISSIONS:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.CLEAN_BACKGROUND_PROCESSES")
console.debug("======ohos.permission.CLEAN_BACKGROUND_PROCESSES:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.KEEP_BACKGROUND_RUNNING")
console.debug("======ohos.permission.KEEP_BACKGROUND_RUNNING:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.GET_BUNDLE_INFO")
console.debug("======ohos.permission.GET_BUNDLE_INFO:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.ACCELEROMETER")
console.debug("======ohos.permission.ACCELEROMETER:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.GYROSCOPE")
console.debug("======ohos.permission.GYROSCOPE:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.MULTIMODAL_INTERACTIVE")
console.debug("======ohos.permission.MULTIMODAL_INTERACTIVE:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.radio.ACCESS_FM_AM")
console.debug("======ohos.permission.radio.ACCESS_FM_AM:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.NFC_TAG")
console.debug("======ohos.permission.NFC_TAG:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.NFC_CARD_EMULATION")
console.debug("======ohos.permission.NFC_CARD_EMULATION:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.DISTRIBUTED_DEVICE_STATE_CHANGE")
console.debug("======ohos.permission.DISTRIBUTED_DEVICE_STATE_CHANGE:result======>:" + JSON.stringify(result));
result = await context.verifySelfPermission("ohos.permission.GET_DISTRIBUTED_DEVICE_INFO")
console.debug("======ohos.permission.GET_DISTRIBUTED_DEVICE_INFO:result======>:" + JSON.stringify(result));
expect(result).assertEqual(0);
done()
})
it('AppPermission_5000', 0, async function (done) {
console.info('=====================AppPermission_5000==================<');
var dataInfo = await bundle.getBundleInfo('com.amsst.amsjsstmain',1);
var context = await featureAbility.getContext();
await context.requestPermissionsFromUser(["ohos.permission.CAMERA"], 580).then(
data => console.log("then : " + data))
.catch(error => console.log("catch : " + error));
await context.verifyPermission("ohos.permission.CAMERA",0,dataInfo.uid,
(err, data) => {
expect(err.code).assertEqual(0);
expect(data).assertEqual(0);
done();
});
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('./AmsJsunit.test.js')
\ No newline at end of file
......@@ -26,12 +26,12 @@ export default {
title: "AbilityA1",
logmessage: "this is log message",
testcase: [
"AppPermission_1300",
"AppPermission_1400",
"AppPermission_1500",
"AppPermission_1600",
"AppPermission_1700",
"AppPermission_1800",
"ACTS_AppPermission_1300",
"ACTS_AppPermission_1400",
"ACTS_AppPermission_1500",
"ACTS_AppPermission_1600",
"ACTS_AppPermission_1700",
"ACTS_AppPermission_1800",
],
},
onInit() {
......
......@@ -29,40 +29,41 @@ export function GetCaseInfo(caseName) {
}
var allCase = {
AppPermission_1300: {
func: AppPermission_1300,
info: "Verify that a system_grand system`s permission(ohos.permission.GET_NETWORK_INFO) is automatically requested during installation."
ACTS_AppPermission_1300: {
func: ACTS_AppPermission_1300,
info: "Verify that calling application(different application in the same device) is requested the system_grant system`s permission(ohos.permission.GET_NETWORK_INFO)."
},
AppPermission_1400: {
func: AppPermission_1400,
info: ""
ACTS_AppPermission_1400: {
func: ACTS_AppPermission_1400,
info: "Verify that calling application(different application in the same device) is requested the system_grant system`s permission(ohos.permission.GET_NETWORK_INFO)."
},
AppPermission_1500: {
func: AppPermission_1500,
info: ""
ACTS_AppPermission_1500: {
func: ACTS_AppPermission_1500,
info: "Verify that calling application(different application in the same device) is not requested the user_grant system`s permission(ohos.permission.CAMERA)."
},
AppPermission_1600: {
func: AppPermission_1600,
info: ""
ACTS_AppPermission_1600: {
func: ACTS_AppPermission_1600,
info: "Verify that calling application(different application in the same device) is not requested the user_grant system`s permission(ohos.permission.CAMERA)."
},
AppPermission_1700: {
func: AppPermission_1700,
info: ""
ACTS_AppPermission_1700: {
func: ACTS_AppPermission_1700,
info: "Verify that calling application(different application in the same device) is requested the system_grant user`s permission(com.amsst.permission.SYSPERMISSION)."
},
AppPermission_1800: {
func: AppPermission_1800,
info: ""
ACTS_AppPermission_1800: {
func: ACTS_AppPermission_1800,
info: "Verify that calling application(different application in the same device) is requested the system_grant user`s permission(com.amsst.permission.SYSPERMISSION)."
},
}
async function AppPermission_1300(thisobj) {
var thisFunctionName = AppPermission_1300.name
async function ACTS_AppPermission_1300(thisobj) {
var thisFunctionName = ACTS_AppPermission_1300.name
thisobj.logmessage = ""
thisobj.logmessage += "run test case " + thisFunctionName + "\n"
thisobj.logmessage += thisFunctionName + "\n";
thisobj.logmessage += GetCaseInfo(thisFunctionName) + "\n";
var context = await featureAbility.getContext()
await context.verifyPermission("ohos.permission.GET_NETWORK_INFO",
await context.verifyCallingPermission("ohos.permission.GET_NETWORK_INFO",
(err, data) => {
console.debug("======verifyCallingPermission:data======>:" + JSON.stringify(data));
thisobj.logmessage += JSON.stringify(data) + "\n"
......@@ -75,14 +76,14 @@ async function AppPermission_1300(thisobj) {
})
}
async function AppPermission_1400(thisobj) {
var thisFunctionName = AppPermission_1400.name
async function ACTS_AppPermission_1400(thisobj) {
var thisFunctionName = ACTS_AppPermission_1400.name
thisobj.logmessage = ""
thisobj.logmessage += "run test case " + thisFunctionName + "\n"
thisobj.logmessage += thisFunctionName + "\n";
thisobj.logmessage += GetCaseInfo(thisFunctionName) + "\n";
var context = await featureAbility.getContext()
console.log("<======verfyPermissiom pass=====>")
var result = await context.verifyPermission("ohos.permission.GET_NETWORK_INFO")
var result = await context.verifyCallingPermission("ohos.permission.GET_NETWORK_INFO")
console.debug("======verifyCallingPermission:result======>:" + JSON.stringify(result))
thisobj.logmessage += JSON.stringify(result) + "\n"
if (result == 0) {
......@@ -93,13 +94,14 @@ async function AppPermission_1400(thisobj) {
}
}
async function AppPermission_1500(thisobj) {
var thisFunctionName = AppPermission_1500.name
async function ACTS_AppPermission_1500(thisobj) {
var thisFunctionName = ACTS_AppPermission_1500.name
thisobj.logmessage = ""
thisobj.logmessage += "run test case " + thisFunctionName + "\n"
thisobj.logmessage += thisFunctionName + "\n";
thisobj.logmessage += GetCaseInfo(thisFunctionName) + "\n";
var context = await featureAbility.getContext()
await context.verifyPermission("ohos.permission.CAMERA",
await context.verifyCallingPermission("ohos.permission.CAMERA",
(err, data) => {
console.debug("======verifyCallingPermission:data======>:" + JSON.stringify(data));
thisobj.logmessage += JSON.stringify(data) + "\n"
......@@ -112,13 +114,14 @@ async function AppPermission_1500(thisobj) {
})
}
async function AppPermission_1600(thisobj) {
var thisFunctionName = AppPermission_1600.name
async function ACTS_AppPermission_1600(thisobj) {
var thisFunctionName = ACTS_AppPermission_1600.name
thisobj.logmessage = ""
thisobj.logmessage += "run test case " + thisFunctionName + "\n"
thisobj.logmessage += thisFunctionName + "\n";
thisobj.logmessage += GetCaseInfo(thisFunctionName) + "\n";
var context = await featureAbility.getContext()
var result = await context.verifyPermission("ohos.permission.CAMERA")
var result = await context.verifyCallingPermission("ohos.permission.CAMERA")
console.debug("======verifyCallingPermission:result======>:" + JSON.stringify(result))
thisobj.logmessage += JSON.stringify(result) + "\n"
if (result == -1) {
......@@ -129,13 +132,14 @@ async function AppPermission_1600(thisobj) {
}
}
async function AppPermission_1700(thisobj) {
var thisFunctionName = AppPermission_1700.name
async function ACTS_AppPermission_1700(thisobj) {
var thisFunctionName = ACTS_AppPermission_1700.name
thisobj.logmessage = ""
thisobj.logmessage += "run test case " + thisFunctionName + "\n"
thisobj.logmessage += thisFunctionName + "\n";
thisobj.logmessage += GetCaseInfo(thisFunctionName) + "\n";
var context = await featureAbility.getContext()
await context.verifyPermission("com.amsst.permission.SYSPERMISSION",
await context.verifyCallingPermission("com.amsst.permission.SYSPERMISSION",
(err, data) => {
console.debug("======verifyCallingPermission:data======>:" + JSON.stringify(data));
thisobj.logmessage += JSON.stringify(data) + "\n"
......@@ -148,13 +152,14 @@ async function AppPermission_1700(thisobj) {
})
}
async function AppPermission_1800(thisobj) {
var thisFunctionName = AppPermission_1800.name
async function ACTS_AppPermission_1800(thisobj) {
var thisFunctionName = ACTS_AppPermission_1800.name
thisobj.logmessage = ""
thisobj.logmessage += "run test case " + thisFunctionName + "\n"
thisobj.logmessage += thisFunctionName + "\n";
thisobj.logmessage += GetCaseInfo(thisFunctionName) + "\n";
var context = await featureAbility.getContext()
var result = await context.verifyPermission("com.amsst.permission.SYSPERMISSION")
var result = await context.verifyCallingPermission("com.amsst.permission.SYSPERMISSION")
console.debug("======verifyCallingPermission:result======>:" + JSON.stringify(result))
thisobj.logmessage += JSON.stringify(result) + "\n"
if (result == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册