Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
43a69cd5
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看板
提交
43a69cd5
编写于
3月 15, 2022
作者:
Z
zhangxingxia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add permission for xts
Signed-off-by:
N
zhangxingxia
<
zhangxingxia1@huawei.com
>
上级
3f93c7ca
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
90 addition
and
59 deletion
+90
-59
storage/storagefilemanagerjstest/signature/openharmony_sx.p7b
...age/storagefilemanagerjstest/signature/openharmony_sx.p7b
+0
-0
storage/storagefilemanagerjstest/src/main/config.json
storage/storagefilemanagerjstest/src/main/config.json
+75
-51
storage/storagefilemanagerjstest/src/main/js/default/test/filemanager.test.js
...anagerjstest/src/main/js/default/test/filemanager.test.js
+15
-8
未找到文件。
storage/storagefilemanagerjstest/signature/openharmony_sx.p7b
浏览文件 @
43a69cd5
无法预览此类型文件
storage/storagefilemanagerjstest/src/main/config.json
浏览文件 @
43a69cd5
{
{
"app"
:
{
"app"
:
{
"bundleName"
:
"ohos.acts.storage.filemanager"
,
"apiVersion"
:
{
"compatible"
:
6
,
"target"
:
7
},
"vendor"
:
"example"
,
"vendor"
:
"example"
,
"bundleName"
:
"ohos.acts.storage.filemanager"
,
"version"
:
{
"version"
:
{
"code"
:
1000000
,
"code"
:
1000000
,
"name"
:
"1.0.0"
"name"
:
"1.0.0"
}
},
},
"apiVersion
"
:
{
"deviceConfig
"
:
{
"
compatible"
:
4
,
"
default"
:
{
"target"
:
5
"debug"
:
true
}
}
},
},
"deviceConfig"
:
{},
"module"
:
{
"module"
:
{
"package"
:
"ohos.acts.storage.filemanager"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
true
},
"abilities"
:
[
"abilities"
:
[
{
{
"iconId"
:
16777218
,
"skills"
:
[
"skills"
:
[
{
{
"entities"
:
[
"entities"
:
[
...
@@ -36,15 +30,45 @@
...
@@ -36,15 +30,45 @@
]
]
}
}
],
],
"name"
:
"ohos.acts.storage.filemanager.MainAbility"
,
"visible"
:
true
,
"icon"
:
"$media:icon"
,
"icon"
:
"$media:icon"
,
"name"
:
"ohos.acts.storage.filemanager.MainAbility"
,
"description"
:
"$string:mainability_description"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"homeAbility"
:
true
,
"visible"
:
true
"launchType"
:
"standard"
}
}
],
],
"deviceType"
:
[
"phone"
,
"tablet"
,
"tv"
,
"wearable"
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
,
"reason"
:
"use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
,
"reason"
:
"use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.READ_MEDIA"
,
"reason"
:
"use ohos.permission.READ_MEDIA"
}
],
"mainAbility"
:
"ohos.acts.storage.filemanager.MainAbility"
,
"distro"
:
{
"moduleType"
:
"entry"
,
"installationFree"
:
false
,
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
},
"package"
:
"ohos.acts.storage.filemanager"
,
"name"
:
".MyApplication"
,
"js"
:
[
"js"
:
[
{
{
"pages"
:
[
"pages"
:
[
...
@@ -53,7 +77,7 @@
...
@@ -53,7 +77,7 @@
"name"
:
"default"
,
"name"
:
"default"
,
"window"
:
{
"window"
:
{
"designWidth"
:
720
,
"designWidth"
:
720
,
"autoDesignWidth"
:
fals
e
"autoDesignWidth"
:
tru
e
}
}
}
}
]
]
...
...
storage/storagefilemanagerjstest/src/main/js/default/test/filemanager.test.js
浏览文件 @
43a69cd5
...
@@ -14,12 +14,9 @@
...
@@ -14,12 +14,9 @@
*/
*/
import
filemanager
from
'
@ohos.filemanager
'
;
import
filemanager
from
'
@ohos.filemanager
'
;
import
{
import
{
describe
,
it
,
expect
,
beforeAll
}
from
'
deccjsunit/index
'
;
describe
,
import
abilityAccessCtrl
from
'
@ohos.abilityAccessCtrl
'
;
it
,
import
bundle
from
'
@ohos.bundle
'
;
expect
}
from
'
deccjsunit/index
'
// getRoot() interface, when the parameter is "local", the returned data and the data contrast, return the same data is correct
// getRoot() interface, when the parameter is "local", the returned data and the data contrast, return the same data is correct
const
ROOTFILE
=
[
const
ROOTFILE
=
[
...
@@ -36,8 +33,19 @@ let AUDIO_ROOT = "";
...
@@ -36,8 +33,19 @@ let AUDIO_ROOT = "";
let
IMAGE_ALBUM
=
""
;
let
IMAGE_ALBUM
=
""
;
let
LOG_
=
"
FMS_XTS_TEXT:
"
;
let
LOG_
=
"
FMS_XTS_TEXT:
"
;
let
LENGTH
=
0
;
let
LENGTH
=
0
;
let
tokenID
=
null
;
describe
(
"
filemanager_test
"
,
function
()
{
describe
(
"
filemanager_test
"
,
function
()
{
beforeAll
(
async
function
(){
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.storage.filemanager
'
,
0
,
100
);
tokenID
=
appInfo
.
accessTokenId
;
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
let
result
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.READ_MEDIA
"
,
1
);
console
.
log
(
"
tokenID:
"
+
tokenID
+
"
-result:
"
+
result
);
let
result1
=
await
atManager
.
verifyAccessToken
(
tokenID
,
"
ohos.permission.READ_MEDIA
"
);
console
.
log
(
"
tokenID:
"
+
tokenID
+
"
-result:
"
+
result1
);
});
/**
/**
* @tc.number SUB_DF_FILEMANAGER_GET_ROOT_0000
* @tc.number SUB_DF_FILEMANAGER_GET_ROOT_0000
* @tc.name filemanager_test_get_root_async_000
* @tc.name filemanager_test_get_root_async_000
...
@@ -172,7 +180,7 @@ describe("filemanager_test", function () {
...
@@ -172,7 +180,7 @@ describe("filemanager_test", function () {
"
name
"
:
1
"
name
"
:
1
}
}
}
}
await
filemanager
.
getRoot
(
options
)
await
filemanager
.
getRoot
(
options
)
;
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_get_root_async_004 has failed for
"
+
error
);
console
.
log
(
"
filemanager_test_get_root_async_004 has failed for
"
+
error
);
expect
(
error
.
message
==
"
GetRoot func get dev para fails
"
).
assertTrue
();
expect
(
error
.
message
==
"
GetRoot func get dev para fails
"
).
assertTrue
();
...
@@ -194,7 +202,6 @@ describe("filemanager_test", function () {
...
@@ -194,7 +202,6 @@ describe("filemanager_test", function () {
let
path
=
IMAGE_ROOT
;
let
path
=
IMAGE_ROOT
;
let
fileInfos
=
await
filemanager
.
listFile
(
path
,
"
image
"
);
let
fileInfos
=
await
filemanager
.
listFile
(
path
,
"
image
"
);
expect
(
Array
.
isArray
(
fileInfos
)).
assertTrue
();
expect
(
Array
.
isArray
(
fileInfos
)).
assertTrue
();
console
.
log
(
JSON
.
stringify
(
fileInfos
))
for
(
let
i
=
0
;
i
<
fileInfos
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
fileInfos
.
length
;
i
++
)
{
if
(
fileInfos
[
i
].
name
==
"
image
"
)
{
if
(
fileInfos
[
i
].
name
==
"
image
"
)
{
console
.
log
(
JSON
.
stringify
(
fileInfos
[
i
]))
console
.
log
(
JSON
.
stringify
(
fileInfos
[
i
]))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录