Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0c45de2a
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看板
未验证
提交
0c45de2a
编写于
7月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4464 audioXTS整改
Merge pull request !4464 from liuxueqi/master
上级
b41f7df7
e6cfa307
变更
11
展开全部
显示空白变更内容
内联
并排
Showing
11 changed file
with
8997 addition
and
8567 deletion
+8997
-8567
multimedia/audio/audio_js_standard/audioManager/Test.json
multimedia/audio/audio_js_standard/audioManager/Test.json
+26
-29
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCall.test.js
..._standard/audioManager/src/main/js/test/AudioCall.test.js
+174
-182
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturer.test.js
...ndard/audioManager/src/main/js/test/AudioCapturer.test.js
+1197
-1441
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturerChangeInfo.test.js
...oManager/src/main/js/test/AudioCapturerChangeInfo.test.js
+1008
-371
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioEventManagement.test.js
...udioManager/src/main/js/test/AudioEventManagement.test.js
+28
-2
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
...dard/audioManager/src/main/js/test/AudioFramework.test.js
+783
-774
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioIndependentInterrupt.test.js
...anager/src/main/js/test/AudioIndependentInterrupt.test.js
+230
-0
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js
...ndard/audioManager/src/main/js/test/AudioRenderer.test.js
+3980
-5016
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRendererChangeInfo.test.js
...oManager/src/main/js/test/AudioRendererChangeInfo.test.js
+1446
-619
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioVOIP.test.js
..._standard/audioManager/src/main/js/test/AudioVOIP.test.js
+123
-131
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/List.test.js
...io_js_standard/audioManager/src/main/js/test/List.test.js
+2
-2
未找到文件。
multimedia/audio/audio_js_standard/audioManager/Test.json
浏览文件 @
0c45de2a
...
...
@@ -12,41 +12,38 @@
"ActsAudioManagerJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"chmod 777 /data/*"
,
"chmod 777 /data -R"
,
"mkdir /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files/media"
"mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/media"
],
"cleanup-apps"
:
true
},
{
"type"
:
"PushKit"
,
"pre-push"
:
[
],
"pre-push"
:
[],
"push"
:
[
"./resource/audio/audioManager/Believer.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/Believer60s.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/StarWars10s-1C-8000-2SW.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/StarWars10s-1C-16000-2SW.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/StarWars10s-1C-32000-1SW.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/StarWars10s-1C-44100-2SW.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/StarWars10s-1C-64000-3SW.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/StarWars10s-1C-96000-4SW.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/StarWars10s-2C-11025-1SW.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/StarWars10s-2C-12000-2SW.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/StarWars10s-2C-16000-3SW.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/StarWars10s-2C-22050-2SW.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/StarWars10s-2C-24000-3SW.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/StarWars10s-2C-48000-4SW.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files"
,
"./resource/audio/audioManager/Believer.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files/media"
,
"./resource/audio/audioManager/file_example_WAV_1MG.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files/media"
,
"./resource/audio/audioManager/safe_and_sound_32.wav ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files/media"
,
"./resource/audio/audioManager/test.mp3 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files/media"
,
"./resource/audio/audioManager/test.mp4 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiomanager/files/media"
"./resource/audio/audioManager/Believer.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/Believer60s.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/StarWars10s-1C-8000-2SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/StarWars10s-1C-16000-2SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/StarWars10s-1C-32000-1SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/StarWars10s-1C-44100-2SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/StarWars10s-1C-64000-3SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/StarWars10s-1C-96000-4SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/StarWars10s-2C-11025-1SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/StarWars10s-2C-12000-2SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/StarWars10s-2C-16000-3SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/StarWars10s-2C-22050-2SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/StarWars10s-2C-24000-3SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/StarWars10s-2C-48000-4SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/"
,
"./resource/audio/audioManager/Believer.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/media"
,
"./resource/audio/audioManager/file_example_WAV_1MG.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/media"
,
"./resource/audio/audioManager/safe_and_sound_32.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/media"
,
"./resource/audio/audioManager/test.mp3 ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/media"
,
"./resource/audio/audioManager/test.mp4 ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiomanager/haps/entry/files/media"
]
}
]
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCall.test.js
浏览文件 @
0c45de2a
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturer.test.js
浏览文件 @
0c45de2a
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturerChangeInfo.test.js
浏览文件 @
0c45de2a
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioEventManagement.test.js
浏览文件 @
0c45de2a
...
...
@@ -13,13 +13,12 @@
* limitations under the License.
*/
import
audio
from
'
@ohos.multimedia.audio
'
;
import
fileio
from
'
@ohos.fileio
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
describe
(
'
audioE
ventManagement
'
,
function
()
{
describe
(
'
audioE
M
'
,
function
()
{
console
.
info
(
'
AudioFrameworkTest: Create AudioManger Object JS Framework
'
);
const
audioManager
=
audio
.
getAudioManager
();
var
deviceRoleValue
=
null
;
...
...
@@ -802,6 +801,33 @@ describe('audioEventManagement', function () {
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_DeviceChangeType_001
* @tc.name : DeviceChangeType - CONNECT
* @tc.desc : DeviceChangeType - CONNECT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_DeviceChangeType_001
'
,
0
,
async
function
(
done
)
{
expect
(
audio
.
DeviceChangeType
.
CONNECT
).
assertEqual
(
0
);
await
sleep
(
50
);
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_DeviceChangeType_002
* @tc.name : DeviceChangeType - DISCONNECT
* @tc.desc : DeviceChangeType - DISCONNECT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_DeviceChangeType_002
'
,
0
,
async
function
(
done
)
{
expect
(
audio
.
DeviceChangeType
.
DISCONNECT
).
assertEqual
(
1
);
await
sleep
(
50
);
done
();
})
})
\ No newline at end of file
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
浏览文件 @
0c45de2a
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioIndependentInterrupt.test.js
0 → 100644
浏览文件 @
0c45de2a
/*
* 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
audio
from
'
@ohos.multimedia.audio
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
describe
(
'
audioIndependentInterrupt
'
,
function
()
{
console
.
info
(
'
AudioIndependentInterrupt: Create AudioManger Object JS IndependentInterrupt
'
);
const
audioManager
=
audio
.
getAudioManager
();
var
deviceRoleValue
=
null
;
var
deviceTypeValue
=
null
;
var
volErrorMesg
=
'
Error, Operation not supported or Failed
'
;
var
audioMedia
=
3
;
var
audioRingtone
=
2
;
var
minVol
=
0
;
var
maxVol
=
15
;
var
lowVol
=
5
;
var
highVol
=
14
;
var
outOfRangeVol
=
28
;
var
longValue
=
'
28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104801843
'
;
function
sleep
(
ms
)
{
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
}
function
displayDeviceProp
(
value
,
index
,
array
)
{
var
devRoleName
;
var
devTypeName
;
if
(
value
.
deviceRole
==
1
)
{
devRoleName
=
'
INPUT_DEVICE
'
;
}
else
if
(
value
.
deviceRole
==
2
)
{
devRoleName
=
'
OUTPUT_DEVICE
'
;
}
else
{
devRoleName
=
'
ERROR : UNKNOWN :
'
+
value
.
deviceRole
;
}
if
(
value
.
deviceType
==
1
)
{
devTypeName
=
'
EARPIECE
'
;
}
else
if
(
value
.
deviceType
==
2
){
devTypeName
=
'
SPEAKER
'
;
}
else
if
(
value
.
deviceType
==
3
){
devTypeName
=
'
WIRED_HEADSET
'
;
}
else
if
(
value
.
deviceType
==
8
){
devTypeName
=
'
BLUETOOTH_A2DP
'
;
}
else
if
(
value
.
deviceType
==
15
){
devTypeName
=
'
MIC
'
;
}
else
{
devTypeName
=
'
ERROR : UNKNOWN :
'
+
value
.
deviceType
;
}
console
.
info
(
`AudioIndependentInterrupt: device role:
${
devRoleName
}
`
);
deviceRoleValue
=
value
.
deviceRole
;
console
.
info
(
`AudioIndependentInterrupt: device type:
${
devTypeName
}
`
);
deviceTypeValue
=
value
.
deviceType
;
}
beforeAll
(
function
()
{
console
.
info
(
'
AudioIndependentInterrupt: beforeAll: Prerequisites at the test suite level
'
);
})
beforeEach
(
async
function
()
{
console
.
info
(
'
AudioIndependentInterrupt: beforeEach: Prerequisites at the test case level
'
);
await
sleep
(
100
);
})
afterEach
(
async
function
()
{
console
.
info
(
'
AudioIndependentInterrupt: afterEach: Test case-level clearance conditions
'
);
await
sleep
(
100
);
})
afterAll
(
function
()
{
console
.
info
(
'
AudioIndependentInterrupt: afterAll: Test suite-level cleanup condition
'
);
})
/*
* @tc.name:RequestIndependentInterrupt_001
* @tc.desc: requestIndependentInterrupt callback
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it
(
"
RequestIndependentInterrupt_001
"
,
0
,
function
(
done
)
{
audioManager
.
requestIndependentInterrupt
(
audio
.
FocusType
.
FOCUS_TYPE_RECORDING
,(
err
,
data
)
=>
{
if
(
err
){
expect
(
true
).
assertEqual
(
false
);
return
done
();
}
expect
(
data
).
assertEqual
(
true
);
done
();
})
})
/*
* @tc.name:RequestIndependentInterrupt_002
* @tc.desc: requestIndependentInterrupt promise
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it
(
"
RequestIndependentInterrupt_002
"
,
0
,
function
(
done
)
{
audioManager
.
requestIndependentInterrupt
(
audio
.
FocusType
.
FOCUS_TYPE_RECORDING
).
then
(
data
=>
{
expect
(
data
).
assertEqual
(
true
);
done
();
}).
catch
(
err
=>
{
expect
(
true
).
assertEqual
(
false
);
done
();
})
})
/*
* @tc.name:RequestIndependentInterrupt_003
* @tc.desc: requestIndependentInterrupt ,set param as '0',will catch error with type error
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it
(
"
RequestIndependentInterrupt_003
"
,
0
,
async
function
(
done
)
{
let
focusType
=
'
0
'
;
try
{
await
audioManager
.
requestIndependentInterrupt
(
focusType
)
}
catch
(
err
){
expect
(
'
assertion (false) failed: type mismatch
'
).
assertEqual
(
err
.
message
);
}
done
();
})
/*
* @tc.name:RequestIndependentInterrupt_004
* @tc.desc: requestIndependentInterrupt ,set param as 99,will catch error out of border
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it
(
"
RequestIndependentInterrupt_004
"
,
0
,
function
(
done
)
{
let
focusType
=
99
;
audioManager
.
requestIndependentInterrupt
(
focusType
).
then
(
data
=>
{
expect
(
data
).
assertEqual
(
true
);
done
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
undefined
);
done
();
});
})
/*
* @tc.name:AbandonIndependentInterrupt_001
* @tc.desc: abandonIndependentInterrupt callback
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it
(
"
AbandonIndependentInterrupt_001
"
,
0
,
function
(
done
)
{
audioManager
.
abandonIndependentInterrupt
(
audio
.
FocusType
.
FOCUS_TYPE_RECORDING
,(
err
,
data
)
=>
{
if
(
err
){
expect
(
true
).
assertEqual
(
false
);
return
done
();
}
expect
(
data
).
assertEqual
(
true
);
done
();
})
})
/*
* @tc.name:AbandonIndependentInterrupt_002
* @tc.desc: abandonIndependentInterrupt promise
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it
(
"
AbandonIndependentInterrupt_002
"
,
0
,
function
(
done
)
{
audioManager
.
abandonIndependentInterrupt
(
audio
.
FocusType
.
FOCUS_TYPE_RECORDING
).
then
(
data
=>
{
expect
(
data
).
assertEqual
(
true
);
done
();
}).
catch
(
err
=>
{
expect
(
true
).
assertEqual
(
false
);
done
();
})
})
/*
* @tc.name:AbandonIndependentInterrupt_003
* @tc.desc: abandonIndependentInterrupt ,set param as '0',will catch error with type error
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it
(
"
AbandonIndependentInterrupt_003
"
,
0
,
function
(
done
)
{
let
focusType
=
'
0
'
;
try
{
audioManager
.
abandonIndependentInterrupt
(
focusType
).
then
(
data
=>
{
expect
(
false
).
assertTrue
();
});
}
catch
(
err
){
expect
(
'
assertion (false) failed: type mismatch
'
).
assertEqual
(
err
.
message
);
}
done
();
})
/*
* @tc.name:AbandonIndependentInterrupt_004
* @tc.desc: abandonIndependentInterrupt ,set param as 99,will catch error out of border
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it
(
"
AbandonIndependentInterrupt_004
"
,
0
,
function
(
done
)
{
let
focusType
=
99
;
audioManager
.
abandonIndependentInterrupt
(
focusType
).
then
(
data
=>
{
expect
(
data
).
assertEqual
(
true
);
done
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
undefined
);
done
();
})
})
})
\ No newline at end of file
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js
浏览文件 @
0c45de2a
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRendererChangeInfo.test.js
浏览文件 @
0c45de2a
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioVOIP.test.js
浏览文件 @
0c45de2a
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/List.test.js
浏览文件 @
0c45de2a
...
...
@@ -14,12 +14,12 @@
*/
require
(
'
./getPermission.test.js
'
)
require
(
'
./AudioRendererChangeInfo.test.js
'
)
require
(
'
./AudioCapturerChangeInfo.test.js
'
)
require
(
'
./AudioFramework.test.js
'
)
require
(
'
./AudioVOIP.test.js
'
)
require
(
'
./AudioCall.test.js
'
)
require
(
'
./AudioCapturer.test.js
'
)
require
(
'
./AudioEventManagement.test.js
'
)
require
(
'
./AudioRenderer.test.js
'
)
require
(
'
./AudioRendererChangeInfo.test.js
'
)
require
(
'
./AudioCapturerChangeInfo.test.js
'
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录