Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4a8a85b0
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,发现更多精彩内容 >>
未验证
提交
4a8a85b0
编写于
8月 17, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 17, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9761 Add XTS for the properties of File object which named name and path.
Merge pull request !9761 from 冯俊青/fileObject
上级
5b2e803e
e8ac8913
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
85 addition
and
1 deletion
+85
-1
storage/storagefileiov9jstest/src/main/js/test/List.test.js
storage/storagefileiov9jstest/src/main/js/test/List.test.js
+3
-1
storage/storagefileiov9jstest/src/main/js/test/class_file/file.test.js
...gefileiov9jstest/src/main/js/test/class_file/file.test.js
+82
-0
storage/storagefileiov9jstest/src/main/js/test/class_file/fileLock.test.js
...leiov9jstest/src/main/js/test/class_file/fileLock.test.js
+0
-0
未找到文件。
storage/storagefileiov9jstest/src/main/js/test/List.test.js
浏览文件 @
4a8a85b0
...
@@ -21,7 +21,6 @@ import fileIOCreateRandomAccessFile from './members/createRandomAccessFile.test.
...
@@ -21,7 +21,6 @@ import fileIOCreateRandomAccessFile from './members/createRandomAccessFile.test.
import
fileIOCreateStream
from
'
./members/createStream.test.js
'
import
fileIOCreateStream
from
'
./members/createStream.test.js
'
import
fileIOFdatasync
from
'
./members/fdatasync.test.js
'
import
fileIOFdatasync
from
'
./members/fdatasync.test.js
'
import
fileIOFdOpenStream
from
'
./members/fdopenStream.test.js
'
import
fileIOFdOpenStream
from
'
./members/fdopenStream.test.js
'
import
fileIOFileLock
from
'
./members/fileLock.test.js
'
import
fileIOFsync
from
'
./members/fsync.test.js
'
import
fileIOFsync
from
'
./members/fsync.test.js
'
import
fileIOHash
from
'
./members/hash.test.js
'
import
fileIOHash
from
'
./members/hash.test.js
'
import
fileIOListfile
from
'
./members/listFile.test.js
'
import
fileIOListfile
from
'
./members/listFile.test.js
'
...
@@ -40,6 +39,8 @@ import fileIOReadtext from './members/readtext.test.js'
...
@@ -40,6 +39,8 @@ import fileIOReadtext from './members/readtext.test.js'
import
fileIORename
from
'
./members/rename.test.js
'
import
fileIORename
from
'
./members/rename.test.js
'
import
fileIORmdir
from
'
./members/rmdir.test
'
import
fileIORmdir
from
'
./members/rmdir.test
'
import
fileIOStat
from
'
./members/stat.test.js
'
import
fileIOStat
from
'
./members/stat.test.js
'
import
fileIOFileLock
from
'
./class_file/fileLock.test.js
'
import
fileIOFileProperties
from
'
./class_file/file.test.js
'
import
fileIOStreamClose
from
'
./class_stream/close.test.js
'
import
fileIOStreamClose
from
'
./class_stream/close.test.js
'
import
fileIOStreamFlush
from
'
./class_stream/flush.test.js
'
import
fileIOStreamFlush
from
'
./class_stream/flush.test.js
'
import
fileIOStreamRead
from
'
./class_stream/read.test.js
'
import
fileIOStreamRead
from
'
./class_stream/read.test.js
'
...
@@ -60,6 +61,7 @@ export default function testsuite() {
...
@@ -60,6 +61,7 @@ export default function testsuite() {
fileIOFdatasync
()
fileIOFdatasync
()
fileIOFdOpenStream
()
fileIOFdOpenStream
()
fileIOFileLock
()
fileIOFileLock
()
fileIOFileProperties
()
fileIOFsync
()
fileIOFsync
()
fileIOHash
()
fileIOHash
()
fileIOListfile
()
fileIOListfile
()
...
...
storage/storagefileiov9jstest/src/main/js/test/class_file/file.test.js
0 → 100644
浏览文件 @
4a8a85b0
/*
* Copyright (C) 2023 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
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
fileIO
,
FILE_CONTENT
,
prepareFile
,
isIntNum
,
describe
,
it
,
expect
,
}
from
'
../Common
'
;
export
default
function
fileIOFileProperties
()
{
describe
(
'
fileIO_file_properties
'
,
function
()
{
/**
* @tc.number SUB_DF_FILEIO_FILE_0000
* @tc.name fileIO_test_open_file_000
* @tc.desc Test the properties of the File object.
* The File object is obtained through the open interface.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_open_file_000
'
,
0
,
async
function
()
{
let
filesDir
=
await
featureAbility
.
getContext
().
getFilesDir
();
let
fpath
=
filesDir
+
'
/fileIO_test_open_file_000
'
;
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
let
file
=
fileIO
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
READ_ONLY
);
expect
(
isIntNum
(
file
.
fd
)).
assertTrue
();
expect
(
file
.
path
===
fpath
).
assertTrue
();
expect
(
file
.
name
===
'
fileIO_test_open_file_000
'
).
assertTrue
();
fileIO
.
closeSync
(
file
);
fileIO
.
unlinkSync
(
fpath
);
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_open_file_000 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FILE_0100
* @tc.name fileIO_test_dup_file_001
* @tc.desc Test the properties of the File object.
* The File object is obtained through the dup interface.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_dup_file_001
'
,
0
,
async
function
()
{
let
filesDir
=
await
featureAbility
.
getContext
().
getFilesDir
();
let
fpath
=
filesDir
+
'
/fileIO_test_dup_file_001
'
;
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
let
file
=
fileIO
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
READ_ONLY
);
let
newFile
=
fileIO
.
dup
(
file
.
fd
);
expect
(
isIntNum
(
newFile
.
fd
)).
assertTrue
();
expect
(
newFile
.
path
==
fpath
).
assertTrue
();
expect
(
file
.
name
===
'
fileIO_test_dup_file_001
'
).
assertTrue
();
fileIO
.
closeSync
(
file
);
fileIO
.
closeSync
(
newFile
);
fileIO
.
unlinkSync
(
fpath
);
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_dup_file_001 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
});
}
storage/storagefileiov9jstest/src/main/js/test/
members
/fileLock.test.js
→
storage/storagefileiov9jstest/src/main/js/test/
class_file
/fileLock.test.js
浏览文件 @
4a8a85b0
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录