Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
21e490ad
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,发现更多精彩内容 >>
提交
21e490ad
编写于
2月 18, 2022
作者:
R
raoxian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改引入命名跟d.ts一致
Signed-off-by:
N
raoxian
<
raoxian@huawei.com
>
上级
a06b3953
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
26 deletion
+26
-26
storage/storagesecuritylabeljstest/src/main/js/default/test/Common.js
...agesecuritylabeljstest/src/main/js/default/test/Common.js
+2
-2
storage/storagesecuritylabeljstest/src/main/js/default/test/securitylabel.test.js
...abeljstest/src/main/js/default/test/securitylabel.test.js
+24
-24
未找到文件。
storage/storagesecuritylabeljstest/src/main/js/default/test/Common.js
浏览文件 @
21e490ad
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
security
l
abel
from
'
@ohos.securitylabel
'
;
import
security
L
abel
from
'
@ohos.securitylabel
'
;
import
fileio
from
'
@ohos.fileio
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
...
...
@@ -37,6 +37,6 @@ export {
afterAll
,
it
,
expect
,
security
l
abel
,
security
L
abel
,
fileio
};
\ No newline at end of file
storage/storagesecuritylabeljstest/src/main/js/default/test/securitylabel.test.js
浏览文件 @
21e490ad
...
...
@@ -14,7 +14,7 @@
*/
import
{
describe
,
it
,
expect
,
security
l
abel
,
nextFileName
,
fileio
describe
,
it
,
expect
,
security
L
abel
,
nextFileName
,
fileio
}
from
'
./Common
'
;
describe
(
'
securitylabel
'
,
function
()
{
...
...
@@ -33,8 +33,8 @@ describe('securitylabel', function () {
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
try
{
security
l
abel
.
setSecurityLabel
(
fpath
,
'
s0
'
,
function
(
err
)
{
security
l
abel
.
getSecurityLabel
(
fpath
,
function
(
err
,
dataLevel
)
{
security
L
abel
.
setSecurityLabel
(
fpath
,
'
s0
'
,
function
(
err
)
{
security
L
abel
.
getSecurityLabel
(
fpath
,
function
(
err
,
dataLevel
)
{
expect
(
dataLevel
==
'
s0
'
).
assertTrue
();
expect
(
fileio
.
unlinkSync
(
fpath
)
==
null
).
assertTrue
();
done
();
...
...
@@ -60,8 +60,8 @@ describe('securitylabel', function () {
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
try
{
security
l
abel
.
setSecurityLabel
(
fpath
,
'
s1
'
,
async
function
(
err
)
{
let
dataLevel
=
await
security
l
abel
.
getSecurityLabel
(
fpath
);
security
L
abel
.
setSecurityLabel
(
fpath
,
'
s1
'
,
async
function
(
err
)
{
let
dataLevel
=
await
security
L
abel
.
getSecurityLabel
(
fpath
);
expect
(
dataLevel
==
'
s1
'
).
assertTrue
();
expect
(
fileio
.
unlinkSync
(
fpath
)
==
null
).
assertTrue
();
done
();
...
...
@@ -86,8 +86,8 @@ describe('securitylabel', function () {
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
try
{
await
security
l
abel
.
setSecurityLabel
(
fpath
,
'
s2
'
);
security
l
abel
.
getSecurityLabel
(
fpath
,
function
(
err
,
dataLevel
)
{
await
security
L
abel
.
setSecurityLabel
(
fpath
,
'
s2
'
);
security
L
abel
.
getSecurityLabel
(
fpath
,
function
(
err
,
dataLevel
)
{
expect
(
dataLevel
==
'
s2
'
).
assertTrue
();
expect
(
fileio
.
unlinkSync
(
fpath
)
==
null
).
assertTrue
();
done
();
...
...
@@ -112,8 +112,8 @@ describe('securitylabel', function () {
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
try
{
await
security
l
abel
.
setSecurityLabel
(
fpath
,
'
s3
'
);
let
dataLevel
=
await
security
l
abel
.
getSecurityLabel
(
fpath
);
await
security
L
abel
.
setSecurityLabel
(
fpath
,
'
s3
'
);
let
dataLevel
=
await
security
L
abel
.
getSecurityLabel
(
fpath
);
expect
(
dataLevel
==
'
s3
'
).
assertTrue
();
expect
(
fileio
.
unlinkSync
(
fpath
)
==
null
).
assertTrue
();
done
();
...
...
@@ -137,8 +137,8 @@ describe('securitylabel', function () {
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
try
{
await
security
l
abel
.
setSecurityLabel
(
fpath
,
'
s4
'
);
let
dataLevel
=
await
security
l
abel
.
getSecurityLabel
(
fpath
);
await
security
L
abel
.
setSecurityLabel
(
fpath
,
'
s4
'
);
let
dataLevel
=
await
security
L
abel
.
getSecurityLabel
(
fpath
);
expect
(
dataLevel
==
'
s4
'
).
assertTrue
();
expect
(
fileio
.
unlinkSync
(
fpath
)
==
null
).
assertTrue
();
done
();
...
...
@@ -159,7 +159,7 @@ describe('securitylabel', function () {
*/
it
(
'
securitylabel_test_set_security_label_async_005
'
,
0
,
async
function
(
done
)
{
try
{
security
l
abel
.
setSecurityLabel
(
''
,
'
s0
'
,
function
(
err
)
{
security
L
abel
.
setSecurityLabel
(
''
,
'
s0
'
,
function
(
err
)
{
expect
(
err
.
code
==
'
-1
'
).
assertTrue
();
done
();
});
...
...
@@ -181,7 +181,7 @@ describe('securitylabel', function () {
*/
it
(
'
securitylabel_test_set_security_label_async_006
'
,
0
,
async
function
(
done
)
{
try
{
security
l
abel
.
setSecurityLabel
(
'
/data/test.txt
'
,
'
s0
'
,
function
(
err
)
{
security
L
abel
.
setSecurityLabel
(
'
/data/test.txt
'
,
'
s0
'
,
function
(
err
)
{
expect
(
err
.
code
==
'
-1
'
).
assertTrue
();
done
();
});
...
...
@@ -203,7 +203,7 @@ describe('securitylabel', function () {
*/
it
(
'
securitylabel_test_set_security_label_async_007
'
,
0
,
async
function
(
done
)
{
try
{
await
security
l
abel
.
setSecurityLabel
(
'
s0
'
);
await
security
L
abel
.
setSecurityLabel
(
'
s0
'
);
expect
(
null
).
assertFail
();
done
();
}
catch
(
e
)
{
...
...
@@ -227,9 +227,9 @@ describe('securitylabel', function () {
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
try
{
security
l
abel
.
setSecurityLabel
(
fpath
,
''
,
async
function
(
err
)
{
security
L
abel
.
setSecurityLabel
(
fpath
,
''
,
async
function
(
err
)
{
expect
(
err
.
code
==
'
-1
'
).
assertTrue
();
let
dataLevel
=
await
security
l
abel
.
getSecurityLabel
(
fpath
);
let
dataLevel
=
await
security
L
abel
.
getSecurityLabel
(
fpath
);
expect
(
dataLevel
==
''
).
assertTrue
();
expect
(
fileio
.
unlinkSync
(
fpath
)
==
null
).
assertTrue
();
done
();
...
...
@@ -255,9 +255,9 @@ describe('securitylabel', function () {
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
try
{
security
l
abel
.
setSecurityLabel
(
fpath
,
'
ss
'
,
async
function
(
err
)
{
security
L
abel
.
setSecurityLabel
(
fpath
,
'
ss
'
,
async
function
(
err
)
{
expect
(
err
.
code
==
'
-1
'
).
assertTrue
();
let
dataLevel
=
await
security
l
abel
.
getSecurityLabel
(
fpath
);
let
dataLevel
=
await
security
L
abel
.
getSecurityLabel
(
fpath
);
expect
(
dataLevel
==
''
).
assertTrue
();
expect
(
fileio
.
unlinkSync
(
fpath
)
==
null
).
assertTrue
();
done
();
...
...
@@ -283,7 +283,7 @@ describe('securitylabel', function () {
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
try
{
await
security
l
abel
.
setSecurityLabel
(
fpath
);
await
security
L
abel
.
setSecurityLabel
(
fpath
);
expect
(
null
).
assertFail
();
done
();
}
catch
(
e
)
{
...
...
@@ -308,7 +308,7 @@ describe('securitylabel', function () {
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
try
{
security
l
abel
.
setSecurityLabel
(
fpath
,
'
s0
'
,
''
,
function
(
err
)
{
security
L
abel
.
setSecurityLabel
(
fpath
,
'
s0
'
,
''
,
function
(
err
)
{
done
();
})
}
catch
(
e
)
{
...
...
@@ -330,7 +330,7 @@ describe('securitylabel', function () {
*/
it
(
'
securitylabel_test_get_security_label_async_000
'
,
0
,
async
function
(
done
)
{
try
{
let
dataLevel
=
await
security
l
abel
.
getSecurityLabel
(
''
);
let
dataLevel
=
await
security
L
abel
.
getSecurityLabel
(
''
);
expect
(
dataLevel
==
''
).
assertTrue
();
done
();
}
catch
(
e
)
{
...
...
@@ -351,7 +351,7 @@ describe('securitylabel', function () {
*/
it
(
'
securitylabel_test_get_security_label_async_001
'
,
0
,
async
function
(
done
)
{
try
{
let
dataLevel
=
await
security
l
abel
.
getSecurityLabel
(
'
/data/test.txt
'
);
let
dataLevel
=
await
security
L
abel
.
getSecurityLabel
(
'
/data/test.txt
'
);
expect
(
dataLevel
==
''
).
assertTrue
();
done
();
}
catch
(
e
)
{
...
...
@@ -372,7 +372,7 @@ describe('securitylabel', function () {
*/
it
(
'
securitylabel_test_get_security_label_async_002
'
,
0
,
async
function
(
done
)
{
try
{
await
security
l
abel
.
getSecurityLabel
();
await
security
L
abel
.
getSecurityLabel
();
expect
(
null
).
assertFail
();
done
();
}
catch
(
e
)
{
...
...
@@ -396,7 +396,7 @@ describe('securitylabel', function () {
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
try
{
security
l
abel
.
getSecurityLabel
(
fpath
,
''
,
function
(
err
,
dataLevel
)
{
security
L
abel
.
getSecurityLabel
(
fpath
,
''
,
function
(
err
,
dataLevel
)
{
done
();
});
}
catch
(
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录