Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
93686748
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看板
未验证
提交
93686748
编写于
2月 28, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2009 add filemanager xts
Merge pull request !2009 from zhangxingxia/master
上级
bc5fb69f
6465e8d9
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
724 addition
and
0 deletion
+724
-0
storage/BUILD.gn
storage/BUILD.gn
+1
-0
storage/storagefilemanagerjstest/BUILD.gn
storage/storagefilemanagerjstest/BUILD.gn
+31
-0
storage/storagefilemanagerjstest/Test.json
storage/storagefilemanagerjstest/Test.json
+51
-0
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
+61
-0
storage/storagefilemanagerjstest/src/main/js/default/app.js
storage/storagefilemanagerjstest/src/main/js/default/app.js
+23
-0
storage/storagefilemanagerjstest/src/main/js/default/i18n/en-US.json
...ragefilemanagerjstest/src/main/js/default/i18n/en-US.json
+6
-0
storage/storagefilemanagerjstest/src/main/js/default/i18n/zh-CN.json
...ragefilemanagerjstest/src/main/js/default/i18n/zh-CN.json
+6
-0
storage/storagefilemanagerjstest/src/main/js/default/pages/index/index.css
...lemanagerjstest/src/main/js/default/pages/index/index.css
+9
-0
storage/storagefilemanagerjstest/src/main/js/default/pages/index/index.hml
...lemanagerjstest/src/main/js/default/pages/index/index.hml
+5
-0
storage/storagefilemanagerjstest/src/main/js/default/pages/index/index.js
...ilemanagerjstest/src/main/js/default/pages/index/index.js
+41
-0
storage/storagefilemanagerjstest/src/main/js/default/test/List.test.js
...gefilemanagerjstest/src/main/js/default/test/List.test.js
+16
-0
storage/storagefilemanagerjstest/src/main/js/default/test/filemanager.test.js
...anagerjstest/src/main/js/default/test/filemanager.test.js
+462
-0
storage/storagefilemanagerjstest/src/main/resources/base/element/string.json
...managerjstest/src/main/resources/base/element/string.json
+12
-0
storage/storagefilemanagerjstest/src/main/resources/base/media/icon.png
...efilemanagerjstest/src/main/resources/base/media/icon.png
+0
-0
未找到文件。
storage/BUILD.gn
浏览文件 @
93686748
...
@@ -20,6 +20,7 @@ group("storage") {
...
@@ -20,6 +20,7 @@ group("storage") {
"storagefileioerrorjstest:storagefileioerror_js_test",
"storagefileioerrorjstest:storagefileioerror_js_test",
"storagefileiojstest:storagefileio_js_test",
"storagefileiojstest:storagefileio_js_test",
"storagefilejstest:storagefile_js_test",
"storagefilejstest:storagefile_js_test",
"storagefilemanagerjstest:storagefilemanager_js_test",
"storagesecuritylabeljstest:storagesecuritylabel_js_test",
"storagesecuritylabeljstest:storagesecuritylabel_js_test",
"storagestatfsjstest:storagestatfs_js_test",
"storagestatfsjstest:storagestatfs_js_test",
"storagestatisticsjstest:storagestatistics_js_test",
"storagestatisticsjstest:storagestatistics_js_test",
...
...
storage/storagefilemanagerjstest/BUILD.gn
0 → 100644
浏览文件 @
93686748
# Copyright (C) 2022 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("storagefilemanager_js_test") {
hap_profile = "./src/main/config.json"
deps = [
":storagefilemanager_js_assets",
":storagefilemanager_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsStorageFilemanagerJsTest"
}
ohos_js_assets("storagefilemanager_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("storagefilemanager_js_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
storage/storagefilemanagerjstest/Test.json
0 → 100644
浏览文件 @
93686748
{
"description"
:
"Configuration for filemanager Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"2000000"
,
"package"
:
"ohos.acts.storage.filemanager"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"mkdir /storage/media/100/local/files/photo"
,
"mkdir /storage/media/100/local/files/document"
,
"mkdir /storage/media/100/local/files/video"
,
"mkdir /storage/media/100/local/files/audio"
,
"mkdir /storage/media/100/local/files/photo/weixin"
,
"touch /storage/media/100/local/files/photo/weixin/1.jpg"
,
"touch /storage/media/100/local/files/photo/weixin/2.jpg"
,
"touch /storage/media/100/local/files/photo/weixin/3.jpg"
,
"touch /storage/media/100/local/files/photo/weixin/1.mp3"
,
"touch /storage/media/100/local/files/photo/weixin/1.mp4"
,
"mkdir /storage/media/100/local/files/photo/taobao"
,
"touch /storage/media/100/local/files/photo/taobao/1.mp4"
,
"mkdir /storage/media/100/local/files/taobao"
,
"touch /storage/media/100/local/files/taobao/1.jpg"
,
"mkdir /storage/media/100/local/files/image"
,
"touch /storage/media/100/local/files/image/1.jpg"
,
"touch /storage/media/100/local/files/image/2.jpg"
,
"mkdir /storage/media/100/local/files/alarms"
,
"touch /storage/media/100/local/files/alarms/tree.mp3"
,
"mkdir /storage/media/100/local/files/wps"
,
"touch /storage/media/100/local/files/wps/news.pdf"
,
"touch /storage/media/100/local/files/wps/introduce.doc"
,
"killall com.ohos.medialibrary.MediaScannerAbilityA"
,
"aa start -a MediaScannerAbility -b com.ohos.medialibrary.MediaScannerAbilityA"
,
"sleep 10"
],
"teardown-command"
:[
"rm -rf /storage/media/100/local/files/*"
]
},
{
"test-file-name"
:
[
"ActsStorageFilemanagerJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
storage/storagefilemanagerjstest/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
93686748
文件已添加
storage/storagefilemanagerjstest/src/main/config.json
0 → 100644
浏览文件 @
93686748
{
"app"
:
{
"bundleName"
:
"ohos.acts.storage.filemanager"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"ohos.acts.storage.filemanager"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
true
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"ohos.acts.storage.filemanager.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
storage/storagefilemanagerjstest/src/main/js/default/app.js
0 → 100644
浏览文件 @
93686748
/*
* 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.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
ohos.acts.storage.filemanager onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
ohos.acts.storage.filemanager onDestroy
'
);
}
};
storage/storagefilemanagerjstest/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
93686748
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"Test"
}
}
\ No newline at end of file
storage/storagefilemanagerjstest/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
93686748
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"测试"
}
}
\ No newline at end of file
storage/storagefilemanagerjstest/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
93686748
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
storage/storagefilemanagerjstest/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
93686748
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
storage/storagefilemanagerjstest/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
93686748
/*
* 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
app
from
'
@system.app
'
import
{
Core
}
from
'
deccjsunit/index
'
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
export
default
{
data
:
{
title
:
''
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../test/List.test
'
)
core
.
execute
()
},
onReady
()
{
},
}
\ No newline at end of file
storage/storagefilemanagerjstest/src/main/js/default/test/List.test.js
0 → 100644
浏览文件 @
93686748
/*
* Copyright (C) 2022 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.
*/
require
(
"
./filemanager.test.js
"
);
storage/storagefilemanagerjstest/src/main/js/default/test/filemanager.test.js
0 → 100644
浏览文件 @
93686748
/*
* Copyright (C) 2022 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
filemanager
from
'
@ohos.filemanager
'
;
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
// getRoot() interface, when the parameter is "local", the returned data and the data contrast, return the same data is correct
const
ROOTFILE
=
[
{
"
name
"
:
"
image_album
"
,
"
path
"
:
"
dataability:///album
"
,
"
type
"
:
"
album
"
,
"
size
"
:
0
,
"
added_time
"
:
0
,
"
modified_time
"
:
0
},
{
"
name
"
:
"
video_album
"
,
"
path
"
:
"
dataability:///album
"
,
"
type
"
:
"
album
"
,
"
size
"
:
0
,
"
added_time
"
:
0
,
"
modified_time
"
:
0
},
{
"
name
"
:
"
audio_album
"
,
"
path
"
:
"
dataability:///album
"
,
"
type
"
:
"
album
"
,
"
size
"
:
0
,
"
added_time
"
:
0
,
"
modified_time
"
:
0
},
{
"
name
"
:
"
file_folder
"
,
"
path
"
:
"
dataability:///album
"
,
"
type
"
:
"
album
"
,
"
size
"
:
0
,
"
added_time
"
:
0
,
"
modified_time
"
:
0
}
];
let
IMAGE_ROOT
=
""
;
let
VIDEO_ROOT
=
""
;
let
FILE_ROOT
=
""
;
let
AUDIO_ROOT
=
""
;
let
IMAGE_ALBUM
=
""
;
let
LOG_
=
"
FMS_XTS_TEXT:
"
describe
(
"
filemanager_test
"
,
function
()
{
/**
* @tc.number SUB_DF_FILEMANAGER_GET_ROOT_0000
* @tc.name filemanager_test_get_root_async_000
* @tc.desc Test getRoot() interfaces, the first layer directory album information, promise way back.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_get_root_async_000
"
,
0
,
async
function
(
done
)
{
try
{
let
fileInfos
=
await
filemanager
.
getRoot
();
expect
(
Array
.
isArray
(
fileInfos
)).
assertTrue
();
expect
(
JSON
.
stringify
(
fileInfos
)
==
JSON
.
stringify
(
ROOTFILE
)).
assertTrue
();
console
.
log
(
JSON
.
stringify
(
fileInfos
))
for
(
let
i
=
0
;
i
<
fileInfos
.
length
;
i
++
)
{
if
(
fileInfos
[
i
].
name
==
"
image_album
"
)
{
console
.
log
(
LOG_
+
JSON
.
stringify
(
fileInfos
[
i
]))
IMAGE_ROOT
=
fileInfos
[
i
].
path
;
console
.
log
(
LOG_
+
IMAGE_ROOT
)
}
else
if
(
fileInfos
[
i
].
name
==
"
audio_album
"
)
{
console
.
log
(
LOG_
+
JSON
.
stringify
(
fileInfos
[
i
]))
AUDIO_ROOT
=
fileInfos
[
i
].
path
;
console
.
log
(
LOG_
+
AUDIO_ROOT
)
}
else
if
(
fileInfos
[
i
].
name
==
"
video_album
"
)
{
console
.
log
(
LOG_
+
JSON
.
stringify
(
fileInfos
[
i
]))
VIDEO_ROOT
=
fileInfos
[
i
].
path
;
console
.
log
(
LOG_
+
VIDEO_ROOT
)
}
else
if
(
fileInfos
[
i
].
name
==
"
file_folder
"
)
{
console
.
log
(
LOG_
+
JSON
.
stringify
(
fileInfos
[
i
]))
FILE_ROOT
=
fileInfos
[
i
].
path
;
console
.
log
(
LOG_
+
FILE_ROOT
)
}
}
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_get_root_async_000 has failed for
"
+
error
);
expect
(
null
).
assertFail
();
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_GET_ROOT_0010
* @tc.name filemanager_test_get_root_async_001
* @tc.desc Test getRoot() interfaces, the first layer directory album information, callback way back.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_get_root_async_001
"
,
0
,
async
function
(
done
)
{
try
{
filemanager
.
getRoot
((
error
,
fileInfos
)
=>
{
expect
(
Array
.
isArray
(
fileInfos
)).
assertTrue
();
expect
(
JSON
.
stringify
(
fileInfos
)
==
JSON
.
stringify
(
ROOTFILE
)).
assertTrue
();
});
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_get_root_async_001 has failed for
"
+
error
);
expect
(
null
).
assertFail
();
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_GET_ROOT_0020
* @tc.name filemanager_test_get_root_async_002
* @tc.desc Test getRoot() interfaces, without any parameters, throw an exception.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_get_root_async_002
"
,
0
,
async
function
(
done
)
{
try
{
filemanager
.
getRoot
(
"
1
"
)
.
then
(
file
=>
{
console
.
log
(
"
filemanager_test_get_root_async_002 file
"
+
JSON
.
stringify
(
file
));
expect
(
null
).
assertFail
();
}).
catch
(
e
=>
{
console
.
log
(
"
filemanager_test_get_root_async_002 e
"
+
e
);
})
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_get_root_async_002 has failed for
"
+
error
);
expect
(
error
.
toString
().
indexOf
(
"
Number of argments unmatched
"
)
!=
-
1
).
assertTrue
();
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_LIST_FILE_0000
* @tc.name filemanager_test_list_file_async_000
* @tc.desc Test listFile() interfaces,when the type parameters as the "image", return path of files information accordingly.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_list_file_async_000
"
,
0
,
async
function
(
done
)
{
try
{
let
path
=
IMAGE_ROOT
;
let
fileInfos
=
await
filemanager
.
listFile
(
path
,
"
image
"
);
expect
(
Array
.
isArray
(
fileInfos
)).
assertTrue
();
console
.
log
(
JSON
.
stringify
(
fileInfos
))
for
(
let
i
=
0
;
i
<
fileInfos
.
length
;
i
++
)
{
if
(
fileInfos
[
i
].
name
==
"
image
"
)
{
console
.
log
(
JSON
.
stringify
(
fileInfos
[
i
]))
IMAGE_ALBUM
=
fileInfos
[
i
].
path
;
console
.
log
(
LOG_
+
JSON
.
stringify
(
fileInfos
[
i
]))
console
.
log
(
LOG_
+
IMAGE_ALBUM
)
}
}
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_list_file_async_000 has failed for
"
+
error
);
expect
(
null
).
assertFail
();
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_LIST_FILE_0010
* @tc.name filemanager_test_list_file_async_001
* @tc.desc Test listFile() interfaces, when the type parameters as the "image", return path of files information accordingly.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_list_file_async_001
"
,
0
,
async
function
(
done
)
{
try
{
let
path
=
IMAGE_ALBUM
;
let
fileInfos
=
await
filemanager
.
listFile
(
path
,
"
image
"
);
expect
(
Array
.
isArray
(
fileInfos
)).
assertTrue
();
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_list_file_async_001 has failed for
"
+
error
);
expect
(
null
).
assertFail
();
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_LIST_FILE_0020
* @tc.name filemanager_test_list_file_async_002
* @tc.desc Test listFile() interfaces, when the type parameters as the "file", return path of files information accordingly.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_list_file_async_002
"
,
0
,
async
function
(
done
)
{
try
{
let
path
=
FILE_ROOT
;
filemanager
.
listFile
(
path
,
"
file
"
,
(
error
,
fileInfos
)
=>
{
expect
(
Array
.
isArray
(
fileInfos
)).
assertTrue
();
});
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_list_file_async_002 has failed for
"
+
error
);
expect
(
null
).
assertFail
();
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_LIST_FILE_0030
* @tc.name filemanager_test_list_file_async_003
* @tc.desc Test listFile() interfaces, when the type parameter to an empty string, throw an exception.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_list_file_async_003
"
,
0
,
async
function
(
done
)
{
try
{
let
path
=
FILE_ROOT
;
await
filemanager
.
listFile
(
path
,
"
"
);
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_list_file_async_003 has failed for
"
+
error
);
expect
(
error
.
message
==
"
Not a directory
"
).
assertTrue
();
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_LIST_FILE_0040
* @tc.name filemanager_test_list_file_async_004
* @tc.desc Test listFile() interfaces, when the path parameter to an empty string, throw an exception..
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_list_file_async_004
"
,
0
,
async
function
(
done
)
{
try
{
await
filemanager
.
listFile
(
"
"
,
"
file
"
);
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_list_file_async_004 has failed for
"
+
error
);
expect
(
error
.
message
==
"
No such file or directory
"
).
assertTrue
();
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_CREATEFILE_0000
* @tc.name filemanager_test_createfile_async_000
* @tc.desc Test createFile() interfaces promise way to create a file normally.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_createfile_async_000
"
,
0
,
async
function
(
done
)
{
try
{
let
name
=
"
create00
"
+
new
Date
().
getTime
()
+
"
.jpg
"
;
let
path
=
IMAGE_ROOT
;
let
uri
=
await
filemanager
.
createFile
(
path
,
name
);
console
.
log
(
LOG_
+
name
+
"
"
+
path
)
console
.
log
(
LOG_
+
uri
)
expect
(
uri
!=
undefined
).
assertTrue
();
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_createfile_async_000 has failed for
"
+
error
);
expect
(
null
).
assertFail
();
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_CREATEFILE_0010
* @tc.name filemanager_test_createfile_async_001
* @tc.desc Test createFile() interfaces callback way to create a file normally.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_createfile_async_001
"
,
0
,
async
function
(
done
)
{
let
name
=
"
create00
"
+
new
Date
().
getTime
()
+
"
.txt
"
;
let
path
=
IMAGE_ROOT
;
filemanager
.
createFile
(
path
,
name
,
(
err
,
uri
)
=>
{
expect
(
uri
!=
undefined
).
assertTrue
();
console
.
log
(
LOG_
+
uri
)
});
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_CREATEFILE_0020
* @tc.name filemanager_test_createfile_async_002
* @tc.desc Test createFile() interfaces to create an existing file, throw an exception.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_createfile_async_002
"
,
0
,
async
function
(
done
)
{
try
{
let
name
=
"
1.jpg
"
;
let
path
=
IMAGE_ROOT
;
filemanager
.
createFile
(
path
,
name
)
.
then
(
uri
=>
{
console
.
log
(
"
filemanager_test_createfile_async_002 uri
"
+
uri
);
expect
(
null
).
assertFail
();
}).
catch
(
e
=>
{
console
.
log
(
"
filemanager_test_createfile_async_002 e
"
+
e
);
expect
(
e
.
message
==
"
Operation not permitted
"
).
assertTrue
();
})
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_createfile_async_002 for
"
+
error
);
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_CREATEFILE_0030
* @tc.name filemanager_test_createfile_async_003
* @tc.desc Test createFile() interfaces to create a file, the path error parameters, throw an exception.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_createfile_async_003
"
,
0
,
async
function
(
done
)
{
try
{
let
name
=
"
filemanager_test_createfile_async_003
"
;
filemanager
.
createFile
(
"
123
"
,
name
)
.
then
(
uri
=>
{
console
.
log
(
"
filemanager_test_createfile_async_003 uri
"
+
uri
);
expect
(
null
).
assertFail
();
}).
catch
(
error
=>
{
console
.
log
(
"
filemanager_test_createfile_async_003 e
"
+
error
);
expect
(
error
.
message
==
"
No such file or directory
"
).
assertTrue
();
})
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_createfile_async_003 has failed for
"
+
error
);
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_CREATEFILE_0040
* @tc.name filemanager_test_createfile_async_004
* @tc.desc Test createFile() interfaces to create a file, without any parameters, throw an exception.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_createfile_async_004
"
,
0
,
async
function
(
done
)
{
try
{
filemanager
.
createFile
()
.
then
(
uri
=>
{
console
.
log
(
"
filemanager_test_createfile_async_004 uri
"
+
uri
);
expect
(
null
).
assertFail
();
}).
catch
(
e
=>
{
console
.
log
(
"
filemanager_test_createfile_async_004 e
"
+
e
);
})
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_createfile_async_004 has failed for
"
+
error
);
expect
(
error
.
toString
().
indexOf
(
"
Number of arguments unmatched
"
)
!=-
1
).
assertTrue
();
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_CREATEFILE_0050
* @tc.name filemanager_test_createfile_async_005
* @tc.desc Test createFile() interfaces to create a file, all parameters to an empty string, throw an exception.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_createfile_async_005
"
,
0
,
async
function
(
done
)
{
try
{
filemanager
.
createFile
(
""
,
""
,
""
)
.
then
(
uri
=>
{
console
.
log
(
"
filemanager_test_createfile_async_005 uri
"
+
uri
);
expect
(
null
).
assertFail
();
}).
catch
(
error
=>
{
console
.
log
(
"
filemanager_test_createfile_async_005 e
"
+
error
);
expect
(
error
.
message
==
"
No such file or directory
"
).
assertTrue
();
})
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_createfile_async_005 has failed for
"
+
error
);
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_CREATEFILE_0060
* @tc.name filemanager_test_createfile_async_006
* @tc.desc Test createFile() interfaces create a file, parameter path contains escape characters, throw an exception.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_createfile_async_006
"
,
0
,
async
function
(
done
)
{
try
{
let
name
=
"
filemanager_test_createfile_async_006
"
;
filemanager
.
createFile
(
"
internal://cache%d%sfile
"
,
name
)
.
then
(
uri
=>
{
console
.
log
(
"
filemanager_test_createfile_async_006 uri
"
+
uri
);
expect
(
null
).
assertFail
();
}).
catch
(
error
=>
{
console
.
log
(
"
filemanager_test_createfile_async_006 e
"
+
error
);
expect
(
error
.
message
==
"
No such file or directory
"
).
assertTrue
();
})
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_createfile_async_006 has failed for
"
+
error
);
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_CREATEFILE_0070
* @tc.name filemanager_test_createfile_async_007
* @tc.desc Test createFile() interfaces a file, parameter path contain special characters, throw an exception.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_createfile_async_007
"
,
0
,
async
function
(
done
)
{
try
{
filemanager
.
createFile
(
"
internal://cache/@#$&^
"
,
"
filemanager_test_createfile_async_007
"
)
.
then
(
uri
=>
{
console
.
log
(
"
filemanager_test_createfile_async_007 uri
"
+
uri
);
expect
(
null
).
assertFail
();
}).
catch
(
error
=>
{
console
.
log
(
"
filemanager_test_createfile_async_007 e
"
+
error
);
expect
(
error
.
message
==
"
No such file or directory
"
).
assertTrue
();
})
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_createfile_async_007 has failed for
"
+
error
);
}
done
();
});
/**
* @tc.number SUB_DF_FILEMANAGER_CREATEFILE_0080
* @tc.name filemanager_test_createfile_async_008
* @tc.desc Test createFile() interfaces to create a file, lack of path parameters, throw an exception.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
"
filemanager_test_createfile_async_008
"
,
0
,
async
function
(
done
)
{
let
name
=
"
filemanager_test_createfile_async_008
"
;
try
{
filemanager
.
createFile
(
name
)
.
then
(
uri
=>
{
console
.
log
(
"
filemanager_test_createfile_async_008 uri
"
+
uri
);
expect
(
null
).
assertFail
();
}).
catch
(
e
=>
{
console
.
log
(
"
filemanager_test_createfile_async_008 e
"
+
e
);
})
}
catch
(
error
)
{
console
.
log
(
"
filemanager_test_createfile_async_008 has failed for
"
+
error
);
expect
(
error
.
toString
().
indexOf
(
"
Number of arguments unmatched
"
)
!=-
1
).
assertTrue
();
}
done
();
});
});
\ No newline at end of file
storage/storagefilemanagerjstest/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
93686748
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"Storagefilemanagerjstest"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
storage/storagefilemanagerjstest/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
93686748
6.6 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录