Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0cec513f
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0cec513f
编写于
7月 06, 2023
作者:
W
wangzx0705
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the error code
Signed-off-by:
N
wangzx0705
<
wangzx0705@thundersoft.com
>
上级
7edefc44
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
49 addition
and
44 deletion
+49
-44
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/AdjustSystemVolumeByStep.test.ets
...hance/src/main/ets/test/AdjustSystemVolumeByStep.test.ets
+20
-20
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/AdjustVolumeByStep.test.ets
...agerEnhance/src/main/ets/test/AdjustVolumeByStep.test.ets
+9
-8
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/GetDefaultVolume.test.ets
...anagerEnhance/src/main/ets/test/GetDefaultVolume.test.ets
+1
-0
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/GetMax_Minvolume.test.ets
...anagerEnhance/src/main/ets/test/GetMax_Minvolume.test.ets
+1
-0
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/GetSystemVolumeInDb.test.ets
...gerEnhance/src/main/ets/test/GetSystemVolumeInDb.test.ets
+17
-16
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/IsVolumeUnadjustable.test.ets
...erEnhance/src/main/ets/test/IsVolumeUnadjustable.test.ets
+1
-0
未找到文件。
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/AdjustSystemVolumeByStep.test.ets
浏览文件 @
0cec513f
...
...
@@ -15,6 +15,7 @@
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'@ohos/hypium'
;
import
audio
from
'@ohos.multimedia.audio'
;
import
featureAbility
from
'@ohos.ability.featureAbility'
;
import
*
as
env
from
'./Const.ets'
;
export
default
function
audioManagerTest
()
{
describe
(
'adjustSystemVolumeByStep'
,
function
()
{
...
...
@@ -128,7 +129,7 @@ export default function audioManagerTest() {
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
audio
.
AudioVolumeType
[
index
],
VOLUME_ADJUST_DOWN
)
.
then
((
data
)
=>
{
console
.
info
(
`####${index} adjustSystemVolumeByStep :SUCCESS ${data}`
);
})
.
catch
((
error
)
=>
{
if
(
index
==
'ALL'
&&
error
.
code
==
6800104
){
if
(
index
==
'ALL'
&&
error
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`${TagFrmwk}: ####${index} adjustSystemVolumeByStep : error ${error.message} ${error.code}`
);
}
else
{
expect
(
false
)
.
assertTrue
();
...
...
@@ -166,7 +167,7 @@ export default function audioManagerTest() {
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
audio
.
AudioVolumeType
[
index
],
VOLUME_ADJUST_UP
)
.
then
((
data
)
=>
{
console
.
info
(
`####${index} adjustSystemVolumeByStep :SUCCESS ${data}`
);
})
.
catch
((
error
)
=>
{
if
(
index
==
'ALL'
&&
error
.
code
==
6800104
){
if
(
index
==
'ALL'
&&
error
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`${TagFrmwk}: ####${index} adjustSystemVolumeByStep : data ${error.message} ${error.code}`
);
}
else
{
expect
(
false
)
.
assertTrue
();
...
...
@@ -203,7 +204,7 @@ export default function audioManagerTest() {
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
AUDIO_VLOUME_TYPE_ERROR
,
VOLUME_ADJUST_DOWN
)
.
then
((
data
)
=>
{
console
.
info
(
`####Unknown volume type, Set it to default MEDIA! adjustSystemVolumeByStep :SUCCESS ${data}`
);
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800104
){
if
(
error
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`${TagFrmwk}: ####adjustSystemVolumeByStep : error ${error.message}, code ${error.code}`
);
}
else
{
console
.
log
(
`${TagFrmwk}: ####adjustSystemVolumeByStep : error ${error.message}, code ${error.code}`
);
...
...
@@ -242,7 +243,7 @@ export default function audioManagerTest() {
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
audio
.
AudioVolumeType
.
MEDIA
,
VOLUME_ADJUST_ERROR
)
.
then
((
data
)
=>
{
console
.
info
(
`####adjustSystemVolumeByStep :SUCCESS ${data}`
);
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800104
){
if
(
error
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
info
(
`####adjustSystemVolumeByStep : ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -278,7 +279,7 @@ export default function audioManagerTest() {
expect
(
false
)
.
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####adjustSystemVolumeByStep : error ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -310,7 +311,7 @@ export default function audioManagerTest() {
expect
(
false
)
.
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####adjustSystemVolumeByStep : error ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -343,7 +344,7 @@ export default function audioManagerTest() {
expect
(
false
)
.
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800104
){
if
(
error
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`${TagFrmwk}: ####adjustSystemVolumeByStep : error ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -412,7 +413,7 @@ export default function audioManagerTest() {
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
audio
.
AudioVolumeType
[
index
],
VOLUME_ADJUST_UP
)
.
then
((
data
)
=>
{
console
.
info
(
`####${index} adjustSystemVolumeByStep :SUCCESS ${data}`
);
})
.
catch
((
error
)
=>
{
if
(
index
==
'ALL'
&&
error
.
code
==
6800104
){
if
(
index
==
'ALL'
&&
error
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
info
(
`####${index} adjustSystemVolumeByStep: error ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -481,7 +482,7 @@ export default function audioManagerTest() {
}
done
();
}
catch
(
error
){
if
(
type
==
'ALL'
&&
error
.
code
==
6800301
){
if
(
type
==
'ALL'
&&
error
.
code
==
UNSUPORTED_OPTION_6800104
){
console
.
info
(
`####${type} adjustSystemVolumeByStep: error ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -604,7 +605,7 @@ export default function audioManagerTest() {
console
.
info
(
`####${index} setVolume :volome ${Vol}`
);
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
audio
.
AudioVolumeType
[
index
],
VOLUME_ADJUST_DOWN
,
(
err
,
data
)
=>
{
if
(
err
){
if
(
index
==
'ALL'
&&
err
.
code
==
6800104
){
if
(
index
==
'ALL'
&&
err
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`${TagFrmwk}: ####${index} adjustSystemVolumeByStep : error ${err.message}, code ${err.code}`
);
}
else
{
console
.
log
(
`${TagFrmwk}: ####${index} adjustSystemVolumeByStep : error ${err.message}, code ${err.code}`
);
...
...
@@ -644,7 +645,7 @@ export default function audioManagerTest() {
console
.
info
(
`####${index} setVolume :volome ${Vol}`
);
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
audio
.
AudioVolumeType
[
index
],
VOLUME_ADJUST_UP
,
(
err
,
data
)
=>
{
if
(
err
){
if
(
index
==
'ALL'
&&
err
.
code
==
6800104
){
if
(
index
==
'ALL'
&&
err
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`####${index} adjustSystemVolumeByStep : error ${err.message}, code ${err.code}`
);
}
else
{
console
.
log
(
`####${index} adjustSystemVolumeByStep : error ${err.message}, code ${err.code}`
);
...
...
@@ -682,7 +683,7 @@ export default function audioManagerTest() {
await
audioVolumeGroupManager
.
setVolume
(
audio
.
AudioVolumeType
.
MEDIA
,
vol_MEDIA
);
console
.
info
(
`####setVolume :volume ${vol_MEDIA}`
);
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
AUDIO_VOLUME_TYPE_ERROR
,
VOLUME_ADJUST_UP
,
(
err
,
data
)
=>
{
if
(
err
.
code
==
6800104
){
if
(
err
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`${TagFrmwk}: ####adjustSystemVolumeByStep : error ${err.message}, code ${err.code}`
);
}
else
{
console
.
info
(
`####adjustSystemVolumeByStep :SUCCESS ${data}`
);
...
...
@@ -721,7 +722,7 @@ export default function audioManagerTest() {
try
{
let
VOLUME_ADJUST_TYPE_ERROR
=
3
;
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
audio
.
AudioVolumeType
.
MEDIA
,
VOLUME_ADJUST_TYPE_ERROR
,
(
err
,
data
)
=>
{
if
(
err
.
code
==
6800104
){
if
(
err
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`${TagFrmwk}: ####adjustSystemVolumeByStep : error ${err.message}, code ${err.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -749,8 +750,7 @@ export default function audioManagerTest() {
try
{
let
AUDIO_VOLUME_TYPE_ERROR
=
'123'
;
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
AUDIO_VOLUME_TYPE_ERROR
,
VOLUME_ADJUST_DOWN
,
(
err
,
data
)
=>
{
if
(
err
.
code
==
6800101
){
//error invalid parameter, code 6800101
if
(
err
.
code
==
INVALID_INPUT_PARAMETER_6800101
){
console
.
log
(
`${TagFrmwk}: ####adjustSystemVolumeByStep : error ${err.message}, code ${err.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -816,7 +816,7 @@ export default function audioManagerTest() {
expect
(
false
)
.
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####adjustSystemVolumeByStep : error ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -849,7 +849,7 @@ export default function audioManagerTest() {
expect
(
true
)
.
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####adjustSystemVolumeByStep : error ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -884,7 +884,7 @@ export default function audioManagerTest() {
console
.
info
(
`####${index} set max Volume :volome ${maxVol}`
);
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
audio
.
AudioVolumeType
[
index
],
VOLUME_ADJUST_UP
,
(
err
,
data
)
=>
{
if
(
err
){
if
(
index
==
'ALL'
&&
err
.
code
==
6800104
){
if
(
index
==
'ALL'
&&
err
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
info
(
`####${index} adjustSystemVolumeByStep: error ${err.message}, code ${err.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -910,7 +910,7 @@ export default function audioManagerTest() {
}
done
();
}
catch
(
error
){
if
(
type
==
'ALL'
&&
error
.
code
==
6800104
){
if
(
type
==
'ALL'
&&
error
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
info
(
`####${type} adjustSystemVolumeByStep: error ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -960,7 +960,7 @@ export default function audioManagerTest() {
}
done
();
}
catch
(
error
){
if
(
type
==
'ALL'
&&
error
.
code
==
6800301
){
if
(
type
==
'ALL'
&&
error
.
code
==
UNSUPORTED_OPTION_6800104
){
console
.
info
(
`####${type} adjustSystemVolumeByStep: error ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/AdjustVolumeByStep.test.ets
浏览文件 @
0cec513f
...
...
@@ -16,6 +16,7 @@
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'@ohos/hypium'
;
import
audio
from
'@ohos.multimedia.audio'
;
import
featureAbility
from
'@ohos.ability.featureAbility'
;
import
*
as
env
from
'./Const.ets'
;
export
default
function
audioManagerTest
()
{
describe
(
'adjustVolumeByStep'
,
function
()
{
...
...
@@ -158,7 +159,7 @@ export default function audioManagerTest() {
await
audioVolumeGroupManager
.
adjustVolumeByStep
(
VOLUME_ADJUST_ERROR
)
.
then
((
data
)
=>
{
console
.
info
(
`####adjustVolumeByStep :SUCCESS ${data}`
);
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800104
){
if
(
error
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`####adjustVolumeByStep : error.code ${error.code}, ${error.message}`
);
}
else
{
console
.
log
(
`${TagFrmwk}: ####adjustVolumeByStep : error.code ${error.code}, ${error.message}`
);
...
...
@@ -193,7 +194,7 @@ export default function audioManagerTest() {
expect
(
false
)
.
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####adjustVolumeByStep : error ${error.code}, message ${error.message}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -224,7 +225,7 @@ export default function audioManagerTest() {
expect
(
true
)
.
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####adjustVolumeByStep : error ${error.code}, message ${error.message}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -442,7 +443,7 @@ export default function audioManagerTest() {
await
audioVolumeGroupManager
.
setVolume
(
audio
.
AudioVolumeType
.
MEDIA
,
Vol
);
await
audioVolumeGroupManager
.
adjustVolumeByStep
(
VOLUME_ADJUST_ERROR
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
.
code
==
6800104
){
if
(
err
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`####adjustVolumeByStep : error ${err.code}, message ${err.message}`
);
}
else
{
console
.
log
(
`####adjustVolumeByStep : error ${err.code}, message ${err.message}`
);
...
...
@@ -475,7 +476,7 @@ export default function audioManagerTest() {
try
{
let
VOLUME_ADJUST_ERROR
=
'123'
;
await
audioVolumeGroupManager
.
adjustVolumeByStep
(
VOLUME_ADJUST_ERROR
,
(
err
,
data
)
=>
{
if
(
err
.
code
==
6800101
){
if
(
err
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####adjustVolumeByStep : error ${err.code}, message ${err.message}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -512,7 +513,7 @@ export default function audioManagerTest() {
done
();
}
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####adjustVolumeByStep : error ${error.code}, message ${error.message}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -556,7 +557,7 @@ export default function audioManagerTest() {
expect
(
curVol
)
.
assertEqual
(
maxVol
);
done
();
}
catch
(
error
){
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
info
(
`####adjustVolumeByStep : error ${error.message} ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -596,7 +597,7 @@ export default function audioManagerTest() {
expect
(
curVol
)
.
assertEqual
(
minVol
);
done
();
}
catch
(
error
){
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
info
(
`####adjustVolumeByStep : error ${error.message} ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/GetDefaultVolume.test.ets
浏览文件 @
0cec513f
...
...
@@ -16,6 +16,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import
audio
from
'@ohos.multimedia.audio'
;
import
featureAbility
from
'@ohos.ability.featureAbility'
;
import
ArrayList
from
'@ohos.util.ArrayList'
;
import
*
as
env
from
'./Const.ets'
;
export
default
function
audioManagerTest
()
{
describe
(
'getDefaultVolume'
,
function
()
{
...
...
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/GetMax_Minvolume.test.ets
浏览文件 @
0cec513f
...
...
@@ -16,6 +16,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import
audio
from
'@ohos.multimedia.audio'
;
import
featureAbility
from
'@ohos.ability.featureAbility'
;
import
ArrayList
from
'@ohos.util.ArrayList'
;
import
*
as
env
from
'./Const.ets'
;
export
default
function
audioManagerTest
()
{
describe
(
'getMax_Minvolume'
,
function
()
{
...
...
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/GetSystemVolumeInDb.test.ets
浏览文件 @
0cec513f
...
...
@@ -16,6 +16,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import
audio
from
'@ohos.multimedia.audio'
;
import
featureAbility
from
'@ohos.ability.featureAbility'
;
import
ArrayList
from
'@ohos.util.ArrayList'
;
import
*
as
env
from
'./Const.ets'
;
export
default
function
audioManagerTest
()
{
describe
(
'getSystemVolumeInDb'
,
function
()
{
...
...
@@ -202,7 +203,7 @@ export default function audioManagerTest() {
expect
(
false
)
.
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800104
){
if
(
error
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${error.message} ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -233,7 +234,7 @@ export default function audioManagerTest() {
expect
(
false
)
.
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800104
){
if
(
error
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${error.message} ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -265,7 +266,7 @@ export default function audioManagerTest() {
expect
(
false
)
.
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${error.message} ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -322,7 +323,7 @@ export default function audioManagerTest() {
expect
(
false
)
.
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${error.message} ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -353,7 +354,7 @@ export default function audioManagerTest() {
expect
(
false
)
.
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${error.message} ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -655,7 +656,7 @@ export default function audioManagerTest() {
it
(
'SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETSYSTEMVOLUMEINDB_CALLBACK_0500'
,
0
,
async
function
(
done
)
{
try
{
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
-
1
,
3
,
audio
.
DeviceType
.
SPEAKER
,
(
err
,
data
)
=>
{
if
(
err
.
code
==
6800104
){
if
(
err
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${err.message} ${err.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -683,7 +684,7 @@ export default function audioManagerTest() {
it
(
'SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETSYSTEMVOLUMEINDB_CALLBACK_0600'
,
0
,
async
function
(
done
)
{
try
{
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
audio
.
AudioVolumeType
.
MEDIA
,
-
1
,
audio
.
DeviceType
.
SPEAKER
,
(
err
,
data
)
=>
{
if
(
err
.
code
==
6800104
){
if
(
err
.
code
==
UNSUPORTED_OPTION_
6800104
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${err.message} ${err.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -712,7 +713,7 @@ export default function audioManagerTest() {
try
{
let
maxVol
=
audioVolumeGroupManager
.
getMaxVolume
(
audio
.
AudioVolumeType
.
MEDIA
);
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
audio
.
AudioVolumeType
.
MEDIA
,
maxVol
+
1
,
audio
.
DeviceType
.
SPEAKER
,
(
err
,
data
)
=>
{
if
(
err
.
code
==
6800101
){
if
(
err
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${err.message} ${err.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -768,7 +769,7 @@ export default function audioManagerTest() {
it
(
'SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETSYSTEMVOLUMEINDB_CALLBACK_0900'
,
0
,
async
function
(
done
)
{
try
{
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
'123'
,
3
,
audio
.
DeviceType
.
SPEAKER
,
(
err
,
data
)
=>
{
if
(
err
.
code
==
6800101
){
if
(
err
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${err.message} ${err.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -796,7 +797,7 @@ export default function audioManagerTest() {
it
(
'SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETSYSTEMVOLUMEINDB_CALLBACK_1000'
,
0
,
async
function
(
done
)
{
try
{
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
audio
.
AudioVolumeType
.
MEDIA
,
'123'
,
audio
.
DeviceType
.
SPEAKER
,
(
err
,
data
)
=>
{
if
(
err
.
code
==
6800101
){
if
(
err
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${err.message} ${err.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -853,7 +854,7 @@ export default function audioManagerTest() {
try
{
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
3
,
audio
.
DeviceType
.
SPEAKER
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
.
code
==
6800101
)
{
if
(
err
.
code
==
INVALID_INPUT_PARAMETER_
6800101
)
{
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${err.message} ${err.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -865,7 +866,7 @@ export default function audioManagerTest() {
}
});
}
catch
(
error
){
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${error.message} ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -889,7 +890,7 @@ export default function audioManagerTest() {
try
{
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
audio
.
AudioVolumeType
.
MEDIA
,
audio
.
DeviceType
.
SPEAKER
,
(
err
,
data
)
=>
{
if
(
err
){
if
(
err
.
code
==
6800101
){
if
(
err
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${err.message} ${err.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -901,7 +902,7 @@ export default function audioManagerTest() {
}
});
}
catch
(
error
){
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${error.message} ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -925,7 +926,7 @@ export default function audioManagerTest() {
try
{
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
audio
.
AudioVolumeType
.
MEDIA
,
3
,
(
err
,
data
)
=>
{
if
(
err
){
if
(
err
.
code
==
6800101
){
if
(
err
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${err.message} ${err.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
@@ -937,7 +938,7 @@ export default function audioManagerTest() {
}
});
}
catch
(
error
){
if
(
error
.
code
==
6800101
){
if
(
error
.
code
==
INVALID_INPUT_PARAMETER_
6800101
){
console
.
log
(
`${TagFrmwk}: ####getSystemVolumeInDb : error ${error.message} ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
...
...
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/IsVolumeUnadjustable.test.ets
浏览文件 @
0cec513f
...
...
@@ -15,6 +15,7 @@
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'@ohos/hypium'
;
import
audio
from
'@ohos.multimedia.audio'
;
import
featureAbility
from
'@ohos.ability.featureAbility'
;
import
*
as
env
from
'./Const.ets'
;
export
default
function
audioManagerTest
()
{
describe
(
'isVolumeUnadjustable'
,
function
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录