Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
fd1684b6
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
fd1684b6
编写于
7月 13, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 13, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4135 媒体XTS与HMOS对齐整改
Merge pull request !4135 from liuxueqi/OpenHarmony-3.1-Release
上级
e27815f2
eb02706e
变更
19
展开全部
隐藏空白更改
内联
并排
Showing
19 changed file
with
271 addition
and
258 deletion
+271
-258
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCall.test.js
..._standard/audioManager/src/main/js/test/AudioCall.test.js
+7
-5
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js
...ndard/audioManager/src/main/js/test/AudioRenderer.test.js
+165
-163
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioVOIP.test.js
..._standard/audioManager/src/main/js/test/AudioVOIP.test.js
+7
-5
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/getPermission.test.js
...ndard/audioManager/src/main/js/test/getPermission.test.js
+52
-51
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
...order/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
+5
-3
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js
...er/src/main/js/test/VideoRecorderFuncCallbackTest.test.js
+5
-3
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/FileAssetGetThumbnailPromise.test.js
...ard/src/main/js/test/FileAssetGetThumbnailPromise.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumGetFileAssetsPromise.test.js
...andard/src/main/js/test/albumGetFileAssetsPromise.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumTestPromise.test.js
...ary_js_standard/src/main/js/test/albumTestPromise.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestPromise.test.js
..._js_standard/src/main/js/test/favoriteTestPromise.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favtrashTestPromise.test.js
..._js_standard/src/main/js/test/favtrashTestPromise.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultPromise.test.js
..._standard/src/main/js/test/fetchFileResultPromise.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetCallBack2.test.js
...y_js_standard/src/main/js/test/fileAssetCallBack2.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestCallback.test.js
...s_standard/src/main/js/test/fileAssetTestCallback.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestCallBack.test.js
...tandard/src/main/js/test/fileAssetUriTestCallBack.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestCallBack.test.js
...ary_js_standard/src/main/js/test/fileTestCallBack.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/filekeyTestCallBack.test.js
..._js_standard/src/main/js/test/filekeyTestCallBack.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/getPermission.test.js
...ibrary_js_standard/src/main/js/test/getPermission.test.js
+18
-16
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestCallBack.test.js
...tandard/src/main/js/test/mediaLibraryTestCallBack.test.js
+1
-1
未找到文件。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCall.test.js
浏览文件 @
fd1684b6
...
...
@@ -22,10 +22,11 @@ import bundle from '@ohos.bundle';
import
abilityAccessCtrl
from
'
@ohos.abilityAccessCtrl
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
import
resourceManager
from
'
@ohos.resourceManager
'
;
import
account
from
'
@ohos.account.osAccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
describe
(
'
audioCall
'
,
function
()
{
describe
(
'
audioCall
'
,
async
function
()
{
var
mediaDir
;
let
fdRead
;
let
readpath
;
...
...
@@ -38,7 +39,8 @@ describe('audioCall', function () {
const
audioManagerRec
=
audio
.
getAudioManager
();
console
.
info
(
'
AudioFrameworkRecLog: Create AudioManger Object JS Framework
'
);
let
userId
=
await
account
.
getAccountManager
().
getOsAccountLocalldFromProcess
();
console
.
info
(
'
userId :
'
+
userId
);
/*async function getPathName(){
var path1 = '/data/accounts/account_0/appdata/';
var packageName;
...
...
@@ -135,7 +137,7 @@ describe('audioCall', function () {
});
}
async
function
applyPermission
()
{
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.multimedia.audio.audiomanager
'
,
0
,
100
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.multimedia.audio.audiomanager
'
,
0
,
userId
);
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
if
(
atManager
!=
null
)
{
let
tokenID
=
appInfo
.
accessTokenId
;
...
...
@@ -436,7 +438,7 @@ describe('audioCall', function () {
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
rendererFlags
:
0
}
var
AudioRendererOptions
=
{
...
...
@@ -526,7 +528,7 @@ describe('audioCall', function () {
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
rendererFlags
:
0
}
var
AudioRendererOptions
=
{
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js
浏览文件 @
fd1684b6
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioVOIP.test.js
浏览文件 @
fd1684b6
...
...
@@ -23,8 +23,9 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
import
featureAbility
from
'
@ohos.ability.featureAbility
'
import
resourceManager
from
'
@ohos.resourceManager
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
account
from
'
@ohos.account.osAccount
'
describe
(
'
audioRenderer_audo2
'
,
function
()
{
describe
(
'
audioRenderer_audo2
'
,
async
function
()
{
var
mediaDir
;
let
fdRead
;
let
readpath
;
...
...
@@ -53,7 +54,8 @@ describe('audioRenderer_audo2', function () {
const
audioManagerRec
=
audio
.
getAudioManager
();
console
.
info
(
'
AudioFrameworkRecLog: Create AudioManger Object JS Framework
'
);
let
userId
=
await
account
.
getAccountManager
().
getOsAccountLocalldFromProcess
();
console
.
info
(
'
userId :
'
+
userId
);
beforeAll
(
async
function
()
{
await
applyPermission
();
console
.
info
(
'
AudioFrameworkTest: beforeAll: Prerequisites at the test suite level
'
);
...
...
@@ -131,7 +133,7 @@ describe('audioRenderer_audo2', function () {
}
async
function
applyPermission
()
{
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.multimedia.audio.audiomanager
'
,
0
,
100
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.multimedia.audio.audiomanager
'
,
0
,
userId
);
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
if
(
atManager
!=
null
)
{
let
tokenID
=
appInfo
.
accessTokenId
;
...
...
@@ -447,7 +449,7 @@ describe('audioRenderer_audo2', function () {
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
rendererFlags
:
0
}
var
AudioRendererOptions
=
{
...
...
@@ -537,7 +539,7 @@ describe('audioRenderer_audo2', function () {
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
rendererFlags
:
0
}
var
AudioRendererOptions
=
{
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/getPermission.test.js
浏览文件 @
fd1684b6
...
...
@@ -13,57 +13,58 @@
* 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
bundle
from
'
@ohos.bundle
'
;
describe
(
"
get_permission
"
,
function
()
{
/**
* @tc.number SUB_DF_GRANT_USER_GRANTED_PERMISSION_0000
* @tc.name grant_user_granted_permission_async_000
* @tc.desc Test grantUserGrantedPermission() interfaces, grant permission.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
grant_user_granted_permission_async_000
"
,
0
,
async
function
(
done
)
{
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.multimedia.audio.audiomanager
'
,
0
,
100
);
let
tokenID
=
appInfo
.
accessTokenId
;
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
let
result1
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.MEDIA_LOCATION
"
,
1
);
let
result2
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.READ_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
result5
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.REVOKE_SENSITIVE_PERMISSIONS
"
,
1
);
let
result6
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.MICROPHONE
"
,
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
isGranted1
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.MEDIA_LOCATION
"
);
let
isGranted2
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.READ_MEDIA
"
);
let
isGranted3
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.WRITE_MEDIA
"
);
let
isGranted4
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.GRANT_SENSITIVE_PERMISSIONS
"
);
let
isGranted5
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.REVOKE_SENSITIVE_PERMISSIONS
"
);
let
isGranted6
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.MICROPHONE
"
);
let
isGranted7
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.ACCESS_NOTIFICATION_POLICY
"
);
let
isGranted8
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.MODIFY_AUDIO_SETTINGS
"
);
console
.
info
(
"
AudioManagerLog: Perm1:
"
+
result1
);
console
.
info
(
"
AudioManagerLog: Perm2:
"
+
result2
);
console
.
info
(
"
AudioManagerLog: Perm3:
"
+
result3
);
console
.
info
(
"
AudioManagerLog: Perm1G:
"
+
isGranted1
);
console
.
info
(
"
AudioManagerLog: Perm2G:
"
+
isGranted2
);
console
.
info
(
"
AudioManagerLog: Perm3G:
"
+
isGranted3
);
console
.
info
(
"
AudioManagerLog: Perm4:
"
+
result4
);
console
.
info
(
"
AudioManagerLog: Perm5:
"
+
result5
);
console
.
info
(
"
AudioManagerLog: Perm6:
"
+
result6
);
console
.
info
(
"
AudioManagerLog: Perm4G:
"
+
isGranted4
);
console
.
info
(
"
AudioManagerLog: Perm5G:
"
+
isGranted5
);
console
.
info
(
"
AudioManagerLog: Perm6G:
"
+
isGranted6
);
console
.
info
(
"
AudioManagerLog: Perm7:
"
+
result7
);
console
.
info
(
"
AudioManagerLog: Perm8:
"
+
result8
);
console
.
info
(
"
AudioManagerLog: Perm7G:
"
+
isGranted7
);
console
.
info
(
"
AudioManagerLog: Perm8G:
"
+
isGranted8
);
done
();
});
import
account
from
'
@ohos.account.osAccount
'
describe
(
"
get_permission
"
,
async
function
()
{
let
userId
=
await
account
.
getAccountManager
().
getOsAccountLocalldFromProcess
();
console
.
info
(
'
userId :
'
+
userId
);
/**
* @tc.number SUB_DF_GRANT_USER_GRANTED_PERMISSION_0000
* @tc.name grant_user_granted_permission_async_000
* @tc.desc Test grantUserGrantedPermission() interfaces, grant permission.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
grant_user_granted_permission_async_000
"
,
0
,
async
function
(
done
)
{
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.multimedia.audio.audiomanager
'
,
0
,
userId
);
let
tokenID
=
appInfo
.
accessTokenId
;
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
let
result1
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.MEDIA_LOCATION
"
,
1
);
let
result2
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.READ_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
result5
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.REVOKE_SENSITIVE_PERMISSIONS
"
,
1
);
let
result6
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.MICROPHONE
"
,
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
isGranted1
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.MEDIA_LOCATION
"
);
let
isGranted2
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.READ_MEDIA
"
);
let
isGranted3
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.WRITE_MEDIA
"
);
let
isGranted4
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.GRANT_SENSITIVE_PERMISSIONS
"
);
let
isGranted5
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.REVOKE_SENSITIVE_PERMISSIONS
"
);
let
isGranted6
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.MICROPHONE
"
);
let
isGranted7
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.ACCESS_NOTIFICATION_POLICY
"
);
let
isGranted8
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.MODIFY_AUDIO_SETTINGS
"
);
console
.
info
(
"
AudioManagerLog: Perm1:
"
+
result1
);
console
.
info
(
"
AudioManagerLog: Perm2:
"
+
result2
);
console
.
info
(
"
AudioManagerLog: Perm3:
"
+
result3
);
console
.
info
(
"
AudioManagerLog: Perm1G:
"
+
isGranted1
);
console
.
info
(
"
AudioManagerLog: Perm2G:
"
+
isGranted2
);
console
.
info
(
"
AudioManagerLog: Perm3G:
"
+
isGranted3
);
console
.
info
(
"
AudioManagerLog: Perm4:
"
+
result4
);
console
.
info
(
"
AudioManagerLog: Perm5:
"
+
result5
);
console
.
info
(
"
AudioManagerLog: Perm6:
"
+
result6
);
console
.
info
(
"
AudioManagerLog: Perm4G:
"
+
isGranted4
);
console
.
info
(
"
AudioManagerLog: Perm5G:
"
+
isGranted5
);
console
.
info
(
"
AudioManagerLog: Perm6G:
"
+
isGranted6
);
console
.
info
(
"
AudioManagerLog: Perm7:
"
+
result7
);
console
.
info
(
"
AudioManagerLog: Perm8:
"
+
result8
);
console
.
info
(
"
AudioManagerLog: Perm7G:
"
+
isGranted7
);
console
.
info
(
"
AudioManagerLog: Perm8G:
"
+
isGranted8
);
done
();
});
});
\ No newline at end of file
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
浏览文件 @
fd1684b6
...
...
@@ -18,8 +18,9 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
import
bundle
from
'
@ohos.bundle
'
import
mediaLibrary
from
'
@ohos.multimedia.mediaLibrary
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
account
from
'
@ohos.account.osAccount
'
describe
(
'
RecorderLocalTestAudioFUNC
'
,
function
()
{
describe
(
'
RecorderLocalTestAudioFUNC
'
,
async
function
()
{
let
audioRecorder
=
media
.
createAudioRecorder
();
const
END_STATE
=
0
;
const
PRE_STATE
=
1
;
...
...
@@ -48,7 +49,8 @@ describe('RecorderLocalTestAudioFUNC', function () {
uri
:
'
file:///data/accounts/account_0/appdata/appdata/recorder/test.m4a
'
,
location
:
{
latitude
:
1
,
longitude
:
1
},
}
let
userId
=
await
account
.
getAccountManager
().
getOsAccountLocalldFromProcess
();
console
.
info
(
'
userId :
'
+
userId
);
function
sleep
(
time
)
{
for
(
let
t
=
Date
.
now
();
Date
.
now
()
-
t
<=
time
;);
}
...
...
@@ -80,7 +82,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
})
async
function
applyPermission
()
{
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.multimedia.audio.audiorecorder
'
,
0
,
100
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.multimedia.audio.audiorecorder
'
,
0
,
userId
);
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
if
(
atManager
!=
null
)
{
let
tokenID
=
appInfo
.
accessTokenId
;
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js
浏览文件 @
fd1684b6
...
...
@@ -19,8 +19,9 @@ import mediaLibrary from '@ohos.multimedia.mediaLibrary'
import
abilityAccessCtrl
from
'
@ohos.abilityAccessCtrl
'
import
bundle
from
'
@ohos.bundle
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
account
from
'
@ohos.account.osAccount
'
describe
(
'
VideoRecorderFuncCallbackTest
'
,
function
()
{
describe
(
'
VideoRecorderFuncCallbackTest
'
,
async
function
()
{
const
RECORDER_TIME
=
3000
;
const
PAUSE_TIME
=
1000
;
const
END_EVENT
=
'
end
'
;
...
...
@@ -90,7 +91,8 @@ describe('VideoRecorderFuncCallbackTest', function () {
function
sleep
(
time
)
{
for
(
let
t
=
Date
.
now
();
Date
.
now
()
-
t
<=
time
;);
}
let
userId
=
await
account
.
getAccountManager
().
getOsAccountLocalldFromProcess
();
console
.
info
(
'
userId :
'
+
userId
);
beforeAll
(
async
function
()
{
await
initCamera
();
await
applyPermission
();
...
...
@@ -112,7 +114,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
})
async
function
applyPermission
()
{
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.multimedia.video.videorecorder
'
,
0
,
100
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.multimedia.video.videorecorder
'
,
0
,
userId
);
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
if
(
atManager
!=
null
)
{
let
tokenID
=
appInfo
.
accessTokenId
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/FileAssetGetThumbnailPromise.test.js
浏览文件 @
fd1684b6
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
image
from
'
@ohos.multimedia.image
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumGetFileAssetsPromise.test.js
浏览文件 @
fd1684b6
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumTestPromise.test.js
浏览文件 @
fd1684b6
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestPromise.test.js
浏览文件 @
fd1684b6
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favtrashTestPromise.test.js
浏览文件 @
fd1684b6
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultPromise.test.js
浏览文件 @
fd1684b6
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetCallBack2.test.js
浏览文件 @
fd1684b6
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestCallback.test.js
浏览文件 @
fd1684b6
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
fileio
from
'
@ohos.fileio
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestCallBack.test.js
浏览文件 @
fd1684b6
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
import
fileio
from
'
@ohos.fileio
'
;
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestCallBack.test.js
浏览文件 @
fd1684b6
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
fileio
from
'
@ohos.fileio
'
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/filekeyTestCallBack.test.js
浏览文件 @
fd1684b6
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/getPermission.test.js
浏览文件 @
fd1684b6
...
...
@@ -13,28 +13,30 @@
* 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
bundle
from
'
@ohos.bundle
'
;
import
account
from
'
@ohos.account.osAccount
'
describe
(
"
get_permission
"
,
function
()
{
/**
* @tc.number SUB_DF_GRANT_USER_GRANTED_PERMISSION_0000
* @tc.name grant_user_granted_permission_async_000
* @tc.desc Test grantUserGrantedPermission() interfaces, grant permission.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
describe
(
"
get_permission
"
,
async
function
()
{
let
userId
=
await
account
.
getAccountManager
().
getOsAccountLocalldFromProcess
();
console
.
info
(
'
userId :
'
+
userId
);
/**
* @tc.number SUB_DF_GRANT_USER_GRANTED_PERMISSION_0000
* @tc.name grant_user_granted_permission_async_000
* @tc.desc Test grantUserGrantedPermission() interfaces, grant permission.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
grant_user_granted_permission_async_000
"
,
0
,
async
function
(
done
)
{
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.multimedia.mediaLibrary
'
,
0
,
100
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.multimedia.mediaLibrary
'
,
0
,
userId
);
let
tokenID
=
appInfo
.
accessTokenId
;
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
let
result1
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.MEDIA_LOCATION
"
,
1
);
let
result2
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.READ_MEDIA
"
,
1
);
let
result3
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.WRITE_MEDIA
"
,
1
);
let
result1
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.MEDIA_LOCATION
"
,
1
);
let
result2
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.READ_MEDIA
"
,
1
);
let
result3
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.WRITE_MEDIA
"
,
1
);
let
isGranted1
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.MEDIA_LOCATION
"
);
let
isGranted2
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.READ_MEDIA
"
);
let
isGranted3
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.WRITE_MEDIA
"
);
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestCallBack.test.js
浏览文件 @
fd1684b6
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
fileio
from
'
@ohos.fileio
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录