提交 c9bb741b 编写于 作者: D daiweiqi

Modify AudioTestCase Name

Signed-off-by: Ndaiweiqi <daiweiqi@huawei.com>
上级 007e3b23
...@@ -348,30 +348,26 @@ describe('audioCall', function () { ...@@ -348,30 +348,26 @@ describe('audioCall', function () {
} }
/**
/* * *@tc.number : SUB_MULTIMEDIA_AUDIO_CALL_PlAY_0100
* @tc.number : SUB_AUDIO_VOIP_Play_001 *@tc.name
* @tc.name : *@tc.desc
* @tc.desc : *@tc.size : MEDIUM
* @tc.size : MEDIUM *@tc.type : Function
* @tc.type : Function *@tc.level : Level 2
* @tc.level : Level 0 */
*/ it('SUB_MULTIMEDIA_AUDIO_CALL_PlAY_0100', 2, async function (done) {
it('SUB_AUDIO_CALL_Play_001', 0, async function (done) {
var AudioStreamInfo = { var AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_1, channels: audio.AudioChannel.CHANNEL_1,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
} }
var AudioRendererInfo = { var AudioRendererInfo = {
content: audio.ContentType.CONTENT_TYPE_SPEECH, content: audio.ContentType.CONTENT_TYPE_SPEECH,
usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION,
rendererFlags: 0 rendererFlags: 0
} }
var AudioRendererOptions = { var AudioRendererOptions = {
streamInfo: AudioStreamInfo, streamInfo: AudioStreamInfo,
rendererInfo: AudioRendererInfo rendererInfo: AudioRendererInfo
...@@ -386,16 +382,15 @@ describe('audioCall', function () { ...@@ -386,16 +382,15 @@ describe('audioCall', function () {
done(); done();
}) })
/* * /**
* @tc.number : SUB_AUDIO_VOIP_Rec_001 *@tc.number : SUB_MULTIMEDIA_AUDIO_CALL_REC_0100
* @tc.name : *@tc.name
* @tc.desc : *@tc.desc
* @tc.size : MEDIUM *@tc.size : MEDIUM
* @tc.type : Function *@tc.type : Function
* @tc.level : Level 0 *@tc.level : Level 2
*/ */
it('SUB_AUDIO_CALL_Rec_001', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_CALL_REC_0100', 2, async function (done) {
var AudioStreamInfo = { var AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_2, channels: audio.AudioChannel.CHANNEL_2,
...@@ -421,17 +416,15 @@ describe('audioCall', function () { ...@@ -421,17 +416,15 @@ describe('audioCall', function () {
done(); done();
}) })
/**
/* * *@tc.number : SUB_MULTIMEDIA_AUDIO_CALL_RECPLAY_0100
* @tc.number : SUB_AUDIO_VOIP_RecPlay_001 *@tc.name
* @tc.name : *@tc.desc
* @tc.desc : *@tc.size : MEDIUM
* @tc.size : MEDIUM *@tc.type : Function
* @tc.type : Function *@tc.level : Level 2
* @tc.level : Level 0 */
*/ it('SUB_MULTIMEDIA_AUDIO_CALL_RECPLAY_0100', 2, async function (done) {
it('SUB_AUDIO_CALL_RecPlay_001', 0, async function (done) {
var AudioStreamInfoCap = { var AudioStreamInfoCap = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_2, channels: audio.AudioChannel.CHANNEL_2,
...@@ -485,5 +478,4 @@ describe('audioCall', function () { ...@@ -485,5 +478,4 @@ describe('audioCall', function () {
await closeFileDescriptor(readpath); await closeFileDescriptor(readpath);
done(); done();
}) })
}) })
\ No newline at end of file
...@@ -360,15 +360,15 @@ describe('audioVoip', function () { ...@@ -360,15 +360,15 @@ describe('audioVoip', function () {
} }
/* * /**
* @tc.number : SUB_AUDIO_VOIP_Play_001 * @tc.number : SUB_MULTIMEDIA_VOIP_PLAY_0100
* @tc.name : AudioRenderer-Set1-Media * @tc.name : AudioRenderer-Set1-Media
* @tc.desc : AudioRenderer with parameter set 1 * @tc.desc : AudioRenderer with parameter set 1
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_AUDIO_VOIP_Play_001', 0, async function (done) { it('SUB_MULTIMEDIA_VOIP_PLAY_0100', 2, async function (done) {
var AudioStreamInfo = { var AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
...@@ -397,15 +397,15 @@ describe('audioVoip', function () { ...@@ -397,15 +397,15 @@ describe('audioVoip', function () {
done(); done();
}) })
/* * /**
* @tc.number : SUB_AUDIO_VOIP_Rec_001 * @tc.number : SUB_MULTIMEDIA_VOIP_REC_0100
* @tc.name : AudioCapturer-Set1-Media * @tc.name : AudioCapturer-Set1-Media
* @tc.desc : AudioCapturer with parameter set 1 * @tc.desc : AudioCapturer with parameter set 1
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_AUDIO_VOIP_Rec_001', 0, async function (done) { it('SUB_MULTIMEDIA_VOIP_REC_0100', 2, async function (done) {
var AudioStreamInfo = { var AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
...@@ -432,15 +432,15 @@ describe('audioVoip', function () { ...@@ -432,15 +432,15 @@ describe('audioVoip', function () {
done(); done();
}) })
/* * /**
* @tc.number : SUB_AUDIO_VOIP_RecPlay_001 * @tc.number : SUB_MULTIMEDIA_VOIP_RECPLAY_0100
* @tc.name : AudioCapturer-Set1-Media * @tc.name : AudioCapturer-Set1-Media
* @tc.desc : AudioCapturer with parameter set 1 * @tc.desc : AudioCapturer with parameter set 1
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_AUDIO_VOIP_RecPlay_001', 0, async function (done) { it('SUB_MULTIMEDIA_VOIP_RECPLAY_0100', 2, async function (done) {
var AudioStreamInfoCap = { var AudioStreamInfoCap = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
......
...@@ -13,42 +13,41 @@ ...@@ -13,42 +13,41 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll,afterAll, it, expect } from 'deccjsunit/index'; import { describe, beforeAll, afterAll, it, expect } from 'deccjsunit/index';
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
import bundle from '@ohos.bundle'; import bundle from '@ohos.bundle';
import account from '@ohos.account.osAccount'; import account from '@ohos.account.osAccount';
describe("get_permission", function () { describe("get_permission", function () {
let userId ; let userId;
async function getUserId () { async function getUserId() {
await account.getAccountManager().getOsAccountLocalIdFromProcess().then(account => { await account.getAccountManager().getOsAccountLocalIdFromProcess().then(account => {
console.info("getOsAccountLocalIdFromProcess userid ==========" + account); console.info("getOsAccountLocalIdFromProcess userid ==========" + account);
userId = account; userId = account;
}).catch(err=>{ }).catch(err => {
console.info("getOsAccountLocalIdFromProcess err ==========" + JSON.stringify(err)); console.info("getOsAccountLocalIdFromProcess err ==========" + JSON.stringify(err));
}) })
} }
/** /**
* @tc.number SUB_DF_GRANT_USER_GRANTED_PERMISSION_0000 * @tc.number SUB_DF_GRANT_USER_GRANTED_PERMISSION_0000
* @tc.name grant_user_granted_permission_async_000 * @tc.name grant_user_granted_permission_async_000
* @tc.desc Test grantUserGrantedPermission() interfaces, grant permission. * @tc.desc Test grantUserGrantedPermission() interfaces, grant permission.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 0 * @tc.level Level 0
* @tc.require */
*/
it("grant_user_granted_permission_async_000", 0, async function (done) { it("grant_user_granted_permission_async_000", 0, async function (done) {
await getUserId(); await getUserId();
let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.audio.audiomanager', 0, userId); let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.audio.audiomanager', 0, userId);
let tokenID = appInfo.accessTokenId; let tokenID = appInfo.accessTokenId;
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
let result1 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.MEDIA_LOCATION",1); let result1 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.MEDIA_LOCATION", 1);
let result2 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.READ_MEDIA",1); let result2 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.READ_MEDIA", 1);
let result3 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.WRITE_MEDIA",1); let result3 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.WRITE_MEDIA", 1);
let result4 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",1); let result4 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", 1);
let result5 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",1); let result5 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", 1);
let result6 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.MICROPHONE",1); let result6 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.MICROPHONE", 1);
let result7 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.ACCESS_NOTIFICATION_POLICY",1); let result7 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.ACCESS_NOTIFICATION_POLICY", 1);
let result8 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.MODIFY_AUDIO_SETTINGS",1); let result8 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.MODIFY_AUDIO_SETTINGS", 1);
let isGranted1 = await atManager.verifyAccessToken(tokenID, "ohos.permission.MEDIA_LOCATION"); let isGranted1 = await atManager.verifyAccessToken(tokenID, "ohos.permission.MEDIA_LOCATION");
let isGranted2 = await atManager.verifyAccessToken(tokenID, "ohos.permission.READ_MEDIA"); let isGranted2 = await atManager.verifyAccessToken(tokenID, "ohos.permission.READ_MEDIA");
let isGranted3 = await atManager.verifyAccessToken(tokenID, "ohos.permission.WRITE_MEDIA"); let isGranted3 = await atManager.verifyAccessToken(tokenID, "ohos.permission.WRITE_MEDIA");
...@@ -57,22 +56,22 @@ describe("get_permission", function () { ...@@ -57,22 +56,22 @@ describe("get_permission", function () {
let isGranted6 = await atManager.verifyAccessToken(tokenID, "ohos.permission.MICROPHONE"); let isGranted6 = await atManager.verifyAccessToken(tokenID, "ohos.permission.MICROPHONE");
let isGranted7 = await atManager.verifyAccessToken(tokenID, "ohos.permission.ACCESS_NOTIFICATION_POLICY"); let isGranted7 = await atManager.verifyAccessToken(tokenID, "ohos.permission.ACCESS_NOTIFICATION_POLICY");
let isGranted8 = await atManager.verifyAccessToken(tokenID, "ohos.permission.MODIFY_AUDIO_SETTINGS"); let isGranted8 = await atManager.verifyAccessToken(tokenID, "ohos.permission.MODIFY_AUDIO_SETTINGS");
console.info("AudioManagerLog: Perm1:"+result1); console.info("AudioManagerLog: Perm1:" + result1);
console.info("AudioManagerLog: Perm2:"+result2); console.info("AudioManagerLog: Perm2:" + result2);
console.info("AudioManagerLog: Perm3:"+result3); console.info("AudioManagerLog: Perm3:" + result3);
console.info("AudioManagerLog: Perm1G:"+isGranted1); console.info("AudioManagerLog: Perm1G:" + isGranted1);
console.info("AudioManagerLog: Perm2G:"+isGranted2); console.info("AudioManagerLog: Perm2G:" + isGranted2);
console.info("AudioManagerLog: Perm3G:"+isGranted3); console.info("AudioManagerLog: Perm3G:" + isGranted3);
console.info("AudioManagerLog: Perm4:"+result4); console.info("AudioManagerLog: Perm4:" + result4);
console.info("AudioManagerLog: Perm5:"+result5); console.info("AudioManagerLog: Perm5:" + result5);
console.info("AudioManagerLog: Perm6:"+result6); console.info("AudioManagerLog: Perm6:" + result6);
console.info("AudioManagerLog: Perm4G:"+isGranted4); console.info("AudioManagerLog: Perm4G:" + isGranted4);
console.info("AudioManagerLog: Perm5G:"+isGranted5); console.info("AudioManagerLog: Perm5G:" + isGranted5);
console.info("AudioManagerLog: Perm6G:"+isGranted6); console.info("AudioManagerLog: Perm6G:" + isGranted6);
console.info("AudioManagerLog: Perm7:"+result7); console.info("AudioManagerLog: Perm7:" + result7);
console.info("AudioManagerLog: Perm8:"+result8); console.info("AudioManagerLog: Perm8:" + result8);
console.info("AudioManagerLog: Perm7G:"+isGranted7); console.info("AudioManagerLog: Perm7G:" + isGranted7);
console.info("AudioManagerLog: Perm8G:"+isGranted8); console.info("AudioManagerLog: Perm8G:" + isGranted8);
done(); done();
}); });
}); });
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册