Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
41d6fc06
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看板
提交
41d6fc06
编写于
8月 12, 2022
作者:
R
raoxian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增rmdir path为../的用例
Signed-off-by:
N
raoxian
<
raoxian@huawei.com
>
上级
00bc799e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
134 addition
and
97 deletion
+134
-97
storage/storagefileiojstest/Test.json
storage/storagefileiojstest/Test.json
+2
-2
storage/storagefileiojstest/src/main/js/test/module_fileio/members/rmdir.test.js
...test/src/main/js/test/module_fileio/members/rmdir.test.js
+73
-31
storage/storagefilejstest/Test.json
storage/storagefilejstest/Test.json
+2
-2
storage/storagefilejstest/src/main/js/test/File.test.js
storage/storagefilejstest/src/main/js/test/File.test.js
+57
-62
未找到文件。
storage/storagefileiojstest/Test.json
浏览文件 @
41d6fc06
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
"description"
:
"Configuration for storage fileio Tests"
,
"description"
:
"Configuration for storage fileio Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"
18
00000"
,
"test-timeout"
:
"
6
00000"
,
"shell-timeout"
:
"
18
00000"
,
"shell-timeout"
:
"
6
00000"
,
"bundle-name"
:
"ohos.acts.storage.fileio"
,
"bundle-name"
:
"ohos.acts.storage.fileio"
,
"package-name"
:
"ohos.acts.storage.fileio"
"package-name"
:
"ohos.acts.storage.fileio"
},
},
...
...
storage/storagefileiojstest/src/main/js/test/module_fileio/members/rmdir.test.js
浏览文件 @
41d6fc06
...
@@ -108,45 +108,48 @@ describe('fileio_rmdir', function () {
...
@@ -108,45 +108,48 @@ describe('fileio_rmdir', function () {
/**
/**
* @tc.number SUB_STORAGE_FileIO_RMDIR_SYNC_0300
* @tc.number SUB_STORAGE_FileIO_RMDIR_SYNC_0300
* @tc.name fileio_test_rmdir_sync_003
* @tc.name fileio_test_rmdir_sync_003
* @tc.desc Test rmdirSync() interface.
Invalid path
.
* @tc.desc Test rmdirSync() interface.
The path contains ../, normal call
.
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 0
* @tc.level Level 0
* @tc.require
* @tc.require
*/
*/
it
(
'
fileio_test_rmdir_sync_003
'
,
0
,
async
function
()
{
it
(
'
fileio_test_rmdir_sync_003
'
,
0
,
async
function
()
{
let
dpath
=
await
nextFileName
(
'
fileio_test_rmdir_sync_003
'
)
+
'
d
'
;
let
dpath
=
await
nextFileName
(
'
../cache/
fileio_test_rmdir_sync_003
'
)
+
'
d
'
;
try
{
try
{
fileio
.
mkdirSync
(
dpath
);
fileio
.
rmdirSync
(
dpath
);
fileio
.
rmdirSync
(
dpath
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_rmdir_sync_003 has failed for
'
+
err
);
console
.
info
(
'
fileio_test_rmdir_sync_003 has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
No such file or directory
'
)).
assertTrue
();
expect
(
null
).
assertFail
();
}
}
});
});
/**
/**
* @tc.number SUB_STORAGE_FileIO_RMDIR_SYNC_0400
* @tc.number SUB_STORAGE_FileIO_RMDIR_SYNC_0400
* @tc.name fileio_test_rmdir_sync_004
* @tc.name fileio_test_rmdir_sync_004
* @tc.desc Test rmdirSync() interface.
No parameters
.
* @tc.desc Test rmdirSync() interface.
Invalid path
.
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 0
* @tc.level Level 0
* @tc.require
* @tc.require
*/
*/
it
(
'
fileio_test_rmdir_sync_004
'
,
0
,
async
function
()
{
it
(
'
fileio_test_rmdir_sync_004
'
,
0
,
async
function
()
{
let
dpath
=
await
nextFileName
(
'
fileio_test_rmdir_sync_004
'
)
+
'
d
'
;
try
{
try
{
fileio
.
rmdirSync
();
fileio
.
rmdirSync
(
dpath
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_rmdir_sync_004 has failed for
'
+
err
);
console
.
info
(
'
fileio_test_rmdir_sync_004 has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
N
umber of arguments unmatched
'
)).
assertTrue
();
expect
(
isInclude
(
err
.
message
,
'
N
o such file or directory
'
)).
assertTrue
();
}
}
});
});
/**
/**
* @tc.number SUB_STORAGE_FileIO_RMDIR_SYNC_0500
* @tc.number SUB_STORAGE_FileIO_RMDIR_SYNC_0500
* @tc.name fileio_test_rmdir_sync_005
* @tc.name fileio_test_rmdir_sync_005
* @tc.desc Test rmdirSync() interface.
Invalid path
.
* @tc.desc Test rmdirSync() interface.
No parameters
.
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 0
* @tc.level Level 0
...
@@ -154,29 +157,47 @@ describe('fileio_rmdir', function () {
...
@@ -154,29 +157,47 @@ describe('fileio_rmdir', function () {
*/
*/
it
(
'
fileio_test_rmdir_sync_005
'
,
0
,
async
function
()
{
it
(
'
fileio_test_rmdir_sync_005
'
,
0
,
async
function
()
{
try
{
try
{
fileio
.
rmdirSync
(
''
);
fileio
.
rmdirSync
();
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_rmdir_sync_005 has failed for
'
+
err
);
console
.
info
(
'
fileio_test_rmdir_sync_005 has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
N
o such file or directory
'
)).
assertTrue
();
expect
(
isInclude
(
err
.
message
,
'
N
umber of arguments unmatched
'
)).
assertTrue
();
}
}
});
});
/**
/**
* @tc.number SUB_STORAGE_FileIO_RMDIR_SYNC_0600
* @tc.number SUB_STORAGE_FileIO_RMDIR_SYNC_0600
* @tc.name fileio_test_rmdir_sync_006
* @tc.name fileio_test_rmdir_sync_006
* @tc.desc Test rmdirSync() interface.
Not a directory
.
* @tc.desc Test rmdirSync() interface.
Invalid path
.
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 0
* @tc.level Level 0
* @tc.require
* @tc.require
*/
*/
it
(
'
fileio_test_rmdir_sync_006
'
,
0
,
async
function
()
{
it
(
'
fileio_test_rmdir_sync_006
'
,
0
,
async
function
()
{
let
fpath
=
await
nextFileName
(
'
fileio_test_rmdir_sync_006
'
);
try
{
fileio
.
rmdirSync
(
''
);
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_rmdir_sync_006 has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
No such file or directory
'
)).
assertTrue
();
}
});
/**
* @tc.number SUB_STORAGE_FileIO_RMDIR_SYNC_0700
* @tc.name fileio_test_rmdir_sync_007
* @tc.desc Test rmdirSync() interface. Not a directory.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_test_rmdir_sync_007
'
,
0
,
async
function
()
{
let
fpath
=
await
nextFileName
(
'
fileio_test_rmdir_sync_007
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
try
{
fileio
.
rmdirSync
(
fpath
);
fileio
.
rmdirSync
(
fpath
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_rmdir_sync_00
6
has failed for
'
+
err
);
console
.
info
(
'
fileio_test_rmdir_sync_00
7
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
Not a directory
'
)).
assertTrue
();
expect
(
isInclude
(
err
.
message
,
'
Not a directory
'
)).
assertTrue
();
fileio
.
unlinkSync
(
fpath
);
fileio
.
unlinkSync
(
fpath
);
}
}
...
@@ -282,10 +303,10 @@ describe('fileio_rmdir', function () {
...
@@ -282,10 +303,10 @@ describe('fileio_rmdir', function () {
*/
*/
it
(
'
fileio_test_rmdir_async_003
'
,
0
,
async
function
(
done
)
{
it
(
'
fileio_test_rmdir_async_003
'
,
0
,
async
function
(
done
)
{
let
dpath
=
await
nextFileName
(
'
fileio_test_rmdir_async_003
'
)
+
'
d
'
;
let
dpath
=
await
nextFileName
(
'
fileio_test_rmdir_async_003
'
)
+
'
d
'
;
let
fpath
=
dpath
+
'
/rmdir_async_00
1
'
;
let
fpath
=
dpath
+
'
/rmdir_async_00
3
'
;
let
ffpath
=
dpath
+
'
/rmdir_async_00
1
_1
'
;
let
ffpath
=
dpath
+
'
/rmdir_async_00
3
_1
'
;
let
ddpath
=
dpath
+
'
/rmdir_async_00
1
_1d
'
;
let
ddpath
=
dpath
+
'
/rmdir_async_00
3
_1d
'
;
let
fffpath
=
ddpath
+
'
/rmdir_async_002
'
;
let
fffpath
=
ddpath
+
'
/rmdir_async_00
3_
2
'
;
fileio
.
mkdirSync
(
dpath
);
fileio
.
mkdirSync
(
dpath
);
fileio
.
mkdirSync
(
ddpath
);
fileio
.
mkdirSync
(
ddpath
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
...
@@ -305,28 +326,28 @@ describe('fileio_rmdir', function () {
...
@@ -305,28 +326,28 @@ describe('fileio_rmdir', function () {
/**
/**
* @tc.number SUB_STORAGE_FileIO_RMDIR_ASYNC_0400
* @tc.number SUB_STORAGE_FileIO_RMDIR_ASYNC_0400
* @tc.name fileio_test_rmdir_async_004
* @tc.name fileio_test_rmdir_async_004
* @tc.desc Test rmdir
() interface. Invalid path
.
* @tc.desc Test rmdir
Sync() interface. The path contains ../, normal call
.
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 0
* @tc.level Level 0
* @tc.require
* @tc.require
*/
*/
it
(
'
fileio_test_rmdir_async_004
'
,
0
,
async
function
(
done
)
{
it
(
'
fileio_test_rmdir_async_004
'
,
0
,
async
function
()
{
let
dpath
=
await
nextFileName
(
'
fileio_test_rmdir_async_004
'
)
+
'
d
'
;
let
dpath
=
await
nextFileName
(
'
../cache/
fileio_test_rmdir_async_004
'
)
+
'
d
'
;
try
{
try
{
fileio
.
mkdirSync
(
dpath
);
await
fileio
.
rmdir
(
dpath
);
await
fileio
.
rmdir
(
dpath
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_rmdir_async_004 has failed for
'
+
err
);
console
.
info
(
'
fileio_test_rmdir_async_004 has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
No such file or directory
'
)).
assertTrue
();
expect
(
null
).
assertFail
();
done
();
}
}
});
});
/**
/**
* @tc.number SUB_STORAGE_FileIO_RMDIR_ASYNC_0500
* @tc.number SUB_STORAGE_FileIO_RMDIR_ASYNC_0500
* @tc.name fileio_test_rmdir_async_005
* @tc.name fileio_test_rmdir_async_005
* @tc.desc Test rmdir() interface.
Parameter mismatc
h.
* @tc.desc Test rmdir() interface.
Invalid pat
h.
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 0
* @tc.level Level 0
...
@@ -334,12 +355,12 @@ describe('fileio_rmdir', function () {
...
@@ -334,12 +355,12 @@ describe('fileio_rmdir', function () {
*/
*/
it
(
'
fileio_test_rmdir_async_005
'
,
0
,
async
function
(
done
)
{
it
(
'
fileio_test_rmdir_async_005
'
,
0
,
async
function
(
done
)
{
let
dpath
=
await
nextFileName
(
'
fileio_test_rmdir_async_005
'
)
+
'
d
'
;
let
dpath
=
await
nextFileName
(
'
fileio_test_rmdir_async_005
'
)
+
'
d
'
;
try
{
try
{
fileio
.
rmdir
(
dpath
,
''
,
function
()
{
await
fileio
.
rmdir
(
dpath
);
});
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_rmdir_async_005 has failed for
'
+
err
);
console
.
info
(
'
fileio_test_rmdir_async_005 has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
N
umber of arguments unmatched
'
)).
assertTrue
();
expect
(
isInclude
(
err
.
message
,
'
N
o such file or directory
'
)).
assertTrue
();
done
();
done
();
}
}
});
});
...
@@ -347,18 +368,20 @@ describe('fileio_rmdir', function () {
...
@@ -347,18 +368,20 @@ describe('fileio_rmdir', function () {
/**
/**
* @tc.number SUB_STORAGE_FileIO_RMDIR_ASYNC_0600
* @tc.number SUB_STORAGE_FileIO_RMDIR_ASYNC_0600
* @tc.name fileio_test_rmdir_async_006
* @tc.name fileio_test_rmdir_async_006
* @tc.desc Test rmdir() interface.
Invalid pat
h.
* @tc.desc Test rmdir() interface.
Parameter mismatc
h.
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 0
* @tc.level Level 0
* @tc.require
* @tc.require
*/
*/
it
(
'
fileio_test_rmdir_async_006
'
,
0
,
async
function
(
done
)
{
it
(
'
fileio_test_rmdir_async_006
'
,
0
,
async
function
(
done
)
{
let
dpath
=
await
nextFileName
(
'
fileio_test_rmdir_async_006
'
)
+
'
d
'
;
try
{
try
{
await
fileio
.
rmdir
(
''
);
fileio
.
rmdir
(
dpath
,
''
,
function
()
{
});
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_rmdir_async_006 has failed for
'
+
err
);
console
.
info
(
'
fileio_test_rmdir_async_006 has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
N
o such file or directory
'
)).
assertTrue
();
expect
(
isInclude
(
err
.
message
,
'
N
umber of arguments unmatched
'
)).
assertTrue
();
done
();
done
();
}
}
});
});
...
@@ -366,19 +389,38 @@ describe('fileio_rmdir', function () {
...
@@ -366,19 +389,38 @@ describe('fileio_rmdir', function () {
/**
/**
* @tc.number SUB_STORAGE_FileIO_RMDIR_ASYNC_0700
* @tc.number SUB_STORAGE_FileIO_RMDIR_ASYNC_0700
* @tc.name fileio_test_rmdir_async_007
* @tc.name fileio_test_rmdir_async_007
* @tc.desc Test rmdir() interface.
Not a directory
.
* @tc.desc Test rmdir() interface.
Invalid path
.
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 0
* @tc.level Level 0
* @tc.require
* @tc.require
*/
*/
it
(
'
fileio_test_rmdir_async_007
'
,
0
,
async
function
(
done
)
{
it
(
'
fileio_test_rmdir_async_007
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_test_rmdir_async_007
'
);
try
{
await
fileio
.
rmdir
(
''
);
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_rmdir_async_007 has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
No such file or directory
'
)).
assertTrue
();
done
();
}
});
/**
* @tc.number SUB_STORAGE_FileIO_RMDIR_ASYNC_0800
* @tc.name fileio_test_rmdir_async_008
* @tc.desc Test rmdir() interface. Not a directory.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_test_rmdir_async_008
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_test_rmdir_async_008
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
try
{
await
fileio
.
rmdir
(
fpath
);
await
fileio
.
rmdir
(
fpath
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_rmdir_async_00
7
has failed for
'
+
err
);
console
.
info
(
'
fileio_test_rmdir_async_00
8
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
Not a directory
'
)).
assertTrue
();
expect
(
isInclude
(
err
.
message
,
'
Not a directory
'
)).
assertTrue
();
fileio
.
unlinkSync
(
fpath
);
fileio
.
unlinkSync
(
fpath
);
done
();
done
();
...
...
storage/storagefilejstest/Test.json
浏览文件 @
41d6fc06
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
"description"
:
"Configuration for storage file Tests"
,
"description"
:
"Configuration for storage file Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"
60
0000"
,
"test-timeout"
:
"
12
0000"
,
"shell-timeout"
:
"
60
0000"
,
"shell-timeout"
:
"
12
0000"
,
"bundle-name"
:
"ohos.acts.storage.file"
,
"bundle-name"
:
"ohos.acts.storage.file"
,
"package-name"
:
"ohos.acts.storage.file"
"package-name"
:
"ohos.acts.storage.file"
},
},
...
...
storage/storagefilejstest/src/main/js/test/File.test.js
浏览文件 @
41d6fc06
...
@@ -433,48 +433,45 @@ describe('fileTest', function () {
...
@@ -433,48 +433,45 @@ describe('fileTest', function () {
text
:
'
hello,world
'
,
text
:
'
hello,world
'
,
success
:
function
()
{
success
:
function
()
{
console
.
info
(
'
File_writeText_005 call writeText success.
'
);
console
.
info
(
'
File_writeText_005 call writeText success.
'
);
done
();
file
.
writeText
({
},
uri
:
'
internal://cache/File_writeText_005
'
,
fail
:
function
(
data
,
code
)
{
text
:
'
hello
'
,
console
.
info
(
'
File_writeText_005 call writeText fail, code:
'
+
code
+
'
, data:
'
+
data
);
append
:
true
,
expect
(
null
).
assertFail
();
success
:
function
()
{
},
console
.
info
(
'
File_writeText_005 call writeText success.
'
);
});
file
.
readText
({
file
.
writeText
({
uri
:
'
internal://cache/File_writeText_005
'
,
uri
:
'
internal://cache/File_writeText_005
'
,
success
:
function
(
data
)
{
text
:
'
hello
'
,
console
.
info
(
'
File_writeText_005 call read success
'
);
append
:
true
,
file
.
delete
({
success
:
function
()
{
uri
:
'
internal://cache/File_writeText_005
'
,
console
.
info
(
'
File_writeText_005 call writeText success.
'
);
success
:
function
()
{
done
();
console
.
info
(
'
File_writeText_005 call delete success
'
);
done
();
},
fail
:
function
(
data
,
code
)
{
console
.
info
(
'
File_writeText_005 call delete fail, code:
'
+
code
+
'
, data:
'
+
data
);
expect
(
null
).
assertFail
();
},
});
},
fail
:
function
(
data
,
code
)
{
console
.
info
(
'
File_writeText_005 call readText fail , code:
'
+
code
+
'
, data:
'
+
data
);
expect
(
null
).
assertFail
();
},
});
},
fail
:
function
(
data
,
code
)
{
console
.
info
(
'
File_writeText_005 call writeText fail, code:
'
+
code
+
'
, data:
'
+
data
);
expect
(
null
).
assertFail
();
},
});
},
},
fail
:
function
(
data
,
code
)
{
fail
:
function
(
data
,
code
)
{
console
.
info
(
'
File_writeText_005 call writeText fail, code:
'
+
code
+
'
, data:
'
+
data
);
console
.
info
(
'
File_writeText_005 call writeText fail, code:
'
+
code
+
'
, data:
'
+
data
);
expect
(
null
).
assertFail
();
expect
(
null
).
assertFail
();
},
},
});
});
file
.
readText
({
uri
:
'
internal://cache/File_writeText_005
'
,
success
:
function
(
data
)
{
console
.
info
(
'
File_writeText_005 call read success
'
);
done
();
},
fail
:
function
(
data
,
code
)
{
console
.
info
(
'
File_writeText_005 call readText fail , code:
'
+
code
+
'
, data:
'
+
data
);
expect
(
null
).
assertFail
();
},
});
file
.
delete
({
uri
:
'
internal://cache/File_writeText_005
'
,
success
:
function
()
{
console
.
info
(
'
File_writeText_005 call delete success
'
);
done
();
},
fail
:
function
(
data
,
code
)
{
console
.
info
(
'
File_writeText_005 call delete fail, code:
'
+
code
+
'
, data:
'
+
data
);
expect
(
null
).
assertFail
();
},
});
});
});
/**
/**
...
@@ -916,33 +913,31 @@ describe('fileTest', function () {
...
@@ -916,33 +913,31 @@ describe('fileTest', function () {
buffer
:
buf
,
buffer
:
buf
,
success
:
function
()
{
success
:
function
()
{
console
.
info
(
'
File_writeArrayBuffer_006 call writeText success.
'
);
console
.
info
(
'
File_writeArrayBuffer_006 call writeText success.
'
);
done
();
file
.
writeArrayBuffer
({
},
uri
:
'
internal://cache/File_writeArrayBuffer_006
'
,
fail
:
function
(
data
,
code
)
{
buffer
:
buf
,
console
.
info
(
'
File_writeArrayBuffer_006 , code:
'
+
code
+
'
, data:
'
+
data
);
success
:
function
()
{
expect
(
null
).
assertFail
();
console
.
info
(
'
File_writeArrayBuffer_006 call writeArrayBuffer success.
'
);
},
file
.
readArrayBuffer
({
});
uri
:
'
internal://cache/File_writeArrayBuffer_006
'
,
file
.
writeArrayBuffer
({
success
:
function
()
{
uri
:
'
internal://cache/File_writeArrayBuffer_006
'
,
console
.
info
(
'
File_writeArrayBuffer_006 call readArrayBuffer pass
'
);
buffer
:
buf
,
done
();
success
:
function
()
{
},
console
.
info
(
'
File_writeArrayBuffer_006 call writeArrayBuffer success.
'
);
fail
:
function
(
data
,
code
)
{
done
();
console
.
info
(
'
File_writeArrayBuffer_006 readArrayBuffer fail, code:
'
+
code
+
'
, data:
'
+
data
);
},
expect
(
null
).
assertFail
();
fail
:
function
(
data
,
code
)
{
},
console
.
info
(
'
File_writeArrayBuffer_006 , code:
'
+
code
+
'
, data:
'
+
data
);
});
expect
(
null
).
assertFail
();
},
},
fail
:
function
(
data
,
code
)
{
});
console
.
info
(
'
File_writeArrayBuffer_006 writeArrayBuffer fail, code:
'
+
code
+
'
, data:
'
+
data
);
file
.
readArrayBuffer
({
expect
(
null
).
assertFail
();
uri
:
'
internal://cache/File_writeArrayBuffer_006
'
,
},
success
:
function
()
{
});
console
.
info
(
'
File_writeArrayBuffer_006 pass
'
);
done
();
},
},
fail
:
function
(
data
,
code
)
{
fail
:
function
(
data
,
code
)
{
console
.
info
(
'
File_writeArrayBuffer_006 , code:
'
+
code
+
'
, data:
'
+
data
);
console
.
info
(
'
File_writeArrayBuffer_006
writeText fail
, code:
'
+
code
+
'
, data:
'
+
data
);
expect
(
null
).
assertFail
();
expect
(
null
).
assertFail
();
},
},
});
});
...
@@ -2213,7 +2208,7 @@ describe('fileTest', function () {
...
@@ -2213,7 +2208,7 @@ describe('fileTest', function () {
*/
*/
it
(
'
File_rmdir_005
'
,
0
,
async
function
(
done
)
{
it
(
'
File_rmdir_005
'
,
0
,
async
function
(
done
)
{
file
.
rmdir
({
file
.
rmdir
({
uri
:
'
internal://app/
test
/123
'
,
uri
:
'
internal://app/
notdir
/123
'
,
success
:
function
()
{
success
:
function
()
{
console
.
info
(
'
File_rmdir_005 call rmdir success.
'
);
console
.
info
(
'
File_rmdir_005 call rmdir success.
'
);
expect
(
null
).
assertFail
();
expect
(
null
).
assertFail
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录