Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9a0774ae
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,发现更多精彩内容 >>
提交
9a0774ae
编写于
5月 23, 2022
作者:
Z
zhurong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add 3.1.6.1 xts
Signed-off-by:
N
zhurong
<
zhurong18@h-partners.com
>
上级
2331d88b
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
120 addition
and
1 deletion
+120
-1
graphic/windowstandard/src/main/js/default/test/window.test.js
...ic/windowstandard/src/main/js/default/test/window.test.js
+120
-1
未找到文件。
graphic/windowstandard/src/main/js/default/test/window.test.js
浏览文件 @
9a0774ae
...
...
@@ -2853,5 +2853,124 @@ describe('window_test', function () {
done
();
}
})
/**
* @tc.number SUB_WINDOW_SETPRIVACYMODE_JSAPI_002
* @tc.name Test setPrivacyModeTest2
* @tc.desc Verify the scene where the application sub window is set as a security layer
*/
it
(
'
setPrivacyModeTest2
'
,
0
,
async
function
(
done
)
{
let
caseName
=
'
setPrivacyModeTest2
'
;
let
msgStr
=
'
jsunittest
'
+
caseName
+
'
'
;
console
.
log
(
msgStr
+
'
begin window =
'
+
JSON
.
stringify
(
window
));
let
mainWnd
=
null
;
window
.
create
(
'
setPrivacyModeTest2
'
,
window
.
WindowType
.
TYPE_APP
,
(
err
,
data
)
=>
{
if
(
err
.
code
!=
0
)
{
console
.
log
(
msgStr
+
'
windowTest CreateTest2 create callback fail err:
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
else
{
expect
(
data
!=
null
).
assertTrue
();
console
.
log
(
msgStr
+
'
windowTest CreateTest2 callback create success data
'
+
data
);
mainWnd
=
data
;
mainWnd
.
getProperties
((
err
,
data
)
=>
{
if
(
err
.
code
!=
0
)
{
console
.
log
(
msgStr
+
'
mainWnd.getProperties first data.isPrivacyMode=false err:
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
else
{
console
.
log
(
msgStr
+
'
mainWnd.getProperties first data.isPrivacyMode=fasle data:
'
+
JSON
.
stringify
(
data
));
expect
(
!
data
.
isPrivacyMode
).
assertTrue
();
mainWnd
.
setPrivacyMode
(
true
,
(
err
,
data
)
=>
{
if
(
err
&&
err
.
code
)
{
unexpectedError
(
err
,
caseName
,
'
mainWnd.setPrivacyMode
'
,
done
);
console
.
log
(
msgStr
+
'
mainWnd.setPrivacyMode(true) err=
'
+
JSON
.
stringify
(
err
));
}
else
{
expect
(
!
data
).
assertTrue
();
console
.
log
(
msgStr
+
'
mainWnd.setPrivacyMode true data=
'
+
JSON
.
stringify
(
data
));
mainWnd
.
getProperties
((
err
,
data
)
=>
{
if
(
err
.
code
!=
0
)
{
console
.
log
(
msgStr
+
'
mainWnd.getProperties second isPrivacyMode=true fail err:
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
else
{
console
.
log
(
msgStr
+
'
mainWnd.getProperties second isPrivacyMode=true callback data:
'
+
JSON
.
stringify
(
data
));
expect
(
data
.
isPrivacyMode
).
assertTrue
();
mainWnd
.
setPrivacyMode
(
false
,
(
err
,
data
)
=>
{
if
(
err
&&
err
.
code
)
{
unexpectedError
(
err
,
caseName
,
'
mainWnd.setPrivacyMode
'
,
done
);
console
.
log
(
msgStr
+
'
mainWnd.setPrivacyMode(false) err=
'
+
JSON
.
stringify
(
err
));
}
else
{
expect
(
!
data
).
assertTrue
();
console
.
log
(
msgStr
+
'
mainWnd.setPrivacyMode(false) end data=
'
+
JSON
.
stringify
(
data
));
mainWnd
.
getProperties
((
err
,
data
)
=>
{
if
(
err
.
code
!=
0
)
{
console
.
log
(
msgStr
+
'
mainWnd.getProperties data.isPrivacyMode=fasle callback fail err:
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
else
{
console
.
log
(
msgStr
+
'
mainWnd.getProperties data.isPrivacyMode=fasle callback data:
'
+
JSON
.
stringify
(
data
));
expect
(
!
data
.
isPrivacyMode
).
assertTrue
();
}
done
();
})
}
});
}
})
}
});
}
})
}
})
})
/**
* @tc.number SUB_WINDOW_SETPRIVACYMODE_JSAPI_001
* @tc.name Test setPrivacyModeTest1
* @tc.desc Verify the scene where the application sub window is set as a security layer
*/
it
(
'
setPrivacyModeTest1
'
,
0
,
async
function
(
done
)
{
let
caseName
=
'
setPrivacyModeTest1
'
;
let
msgStr
=
'
jsunittest
'
+
caseName
+
'
'
;
console
.
log
(
msgStr
+
'
begin
'
);
let
mainWnd
=
null
;
let
windowData
=
await
window
.
create
(
'
setPrivacyModeTest1
'
,
window
.
WindowType
.
TYPE_APP
).
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'
window.create
'
,
done
);
done
();
})
expect
(
!!
windowData
).
assertTrue
();
console
.
log
(
msgStr
+
'
window.create success windowData
'
+
windowData
);
mainWnd
=
windowData
;
let
firstPro
=
await
mainWnd
.
getProperties
().
catch
((
err
,
data
)
=>
{
unexpectedError
(
err
,
caseName
,
'
mainWnd.getProperties
'
,
done
);
done
();
})
expect
(
!
firstPro
.
isPrivacyMode
).
assertTrue
();
console
.
log
(
msgStr
+
'
mainWnd.getProperties firstPro=
'
+
JSON
.
stringify
(
firstPro
));
let
firstPrivacyMode
=
await
mainWnd
.
setPrivacyMode
(
true
).
catch
((
err
,
data
)
=>
{
unexpectedError
(
err
,
caseName
,
'
mainWnd.setPrivacyMode
'
,
done
);
console
.
log
(
msgStr
+
'
mainWnd.setPrivacyMode(true) err=
'
+
JSON
.
stringify
(
err
));
})
expect
(
!
firstPrivacyMode
).
assertTrue
();
console
.
log
(
msgStr
+
'
mainWnd.setPrivacyMode true firstPrivacyMode=
'
+
JSON
.
stringify
(
firstPrivacyMode
));
let
secondPro
=
await
mainWnd
.
getProperties
().
catch
((
err
,
data
)
=>
{
unexpectedError
(
err
,
caseName
,
'
mainWnd.getProperties
'
,
done
);
done
();
})
console
.
log
(
msgStr
+
'
mainWnd.getProperties secondPro:
'
+
JSON
.
stringify
(
secondPro
.
isPrivacyMode
));
expect
(
secondPro
.
isPrivacyMode
).
assertTrue
();
let
secondPrivacyMode
=
await
mainWnd
.
setPrivacyMode
(
false
).
catch
((
err
,
data
)
=>
{
unexpectedError
(
err
,
caseName
,
'
mainWnd.setPrivacyMode
'
,
done
);
console
.
log
(
msgStr
+
'
mainWnd.setPrivacyMode(false) err=
'
+
JSON
.
stringify
(
err
));
})
expect
(
!
secondPrivacyMode
).
assertTrue
();
console
.
log
(
msgStr
+
'
mainWnd.setPrivacyMode(false) secondPrivacyMode=
'
+
JSON
.
stringify
(
secondPrivacyMode
));
let
lastPro
=
await
mainWnd
.
getProperties
().
catch
((
err
,
data
)
=>
{
unexpectedError
(
err
,
caseName
,
'
mainWnd.getProperties
'
,
done
);
done
();
})
console
.
log
(
msgStr
+
'
mainWnd.getProperties lastPro:
'
+
JSON
.
stringify
(
lastPro
.
isPrivacyMode
));
expect
(
!
lastPro
.
isPrivacyMode
).
assertTrue
();
done
();
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录