Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2ab26d05
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看板
未验证
提交
2ab26d05
编写于
5月 24, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 24, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8724 优化用例listenerTest5
Merge pull request !8724 from 姚翠/master
上级
51afb806
629171db
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
2 addition
and
47 deletion
+2
-47
graphic/windowStage/entry/src/main/ets/test/windowCallback.test.ets
...ndowStage/entry/src/main/ets/test/windowCallback.test.ets
+2
-47
未找到文件。
graphic/windowStage/entry/src/main/ets/test/windowCallback.test.ets
浏览文件 @
2ab26d05
...
@@ -1198,7 +1198,6 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
...
@@ -1198,7 +1198,6 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
}
}
})
})
})
})
/**
/**
* @tc.number SUB_WINDOW_ON_OFF_JSAPI_005
* @tc.number SUB_WINDOW_ON_OFF_JSAPI_005
* @tc.name Test listenerTest5
* @tc.name Test listenerTest5
...
@@ -1209,10 +1208,6 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
...
@@ -1209,10 +1208,6 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
let
listenerOnFlag
=
false
;
let
listenerOnFlag
=
false
;
console
.
log
(
msgStr
+
'begin'
);
console
.
log
(
msgStr
+
'begin'
);
listenerData
.
on
=
true
;
listenerData
.
typeStr
=
'systemAvoidAreaChange'
;
let
setSystemBarEnableType
=
null
;
function
setSystemBarEnable
(
tempWnd
)
{
function
setSystemBarEnable
(
tempWnd
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
tempWnd
.
setSystemBarEnable
([],
(
err
,
data
)
=>
{
tempWnd
.
setSystemBarEnable
([],
(
err
,
data
)
=>
{
...
@@ -1220,8 +1215,6 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
...
@@ -1220,8 +1215,6 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
reject
(
false
)
reject
(
false
)
}
else
{
}
else
{
console
.
log
(
msgStr
+
'tempWnd.setSystemBarEnable([]) success'
);
console
.
log
(
msgStr
+
'tempWnd.setSystemBarEnable([]) success'
);
listenerOnFlag
=
true
;
setSystemBarEnableType
=
0
;
resolve
(
true
)
resolve
(
true
)
}
}
})
})
...
@@ -1235,7 +1228,6 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
...
@@ -1235,7 +1228,6 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
reject
(
false
)
reject
(
false
)
}
else
{
}
else
{
console
.
log
(
msgStr
+
'tempWnd.setSystemBarEnable([status, navigation]) success'
);
console
.
log
(
msgStr
+
'tempWnd.setSystemBarEnable([status, navigation]) success'
);
setSystemBarEnableType
=
2
;
resolve
(
true
)
resolve
(
true
)
}
}
})
})
...
@@ -1248,23 +1240,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
...
@@ -1248,23 +1240,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
expect
()
.
assertFail
()
expect
()
.
assertFail
()
});
});
expect
(
!!
tempWnd
)
.
assertTrue
();
expect
(
!!
tempWnd
)
.
assertTrue
();
await
tempWnd
.
show
()
.
then
((
data
)
=>
{
console
.
info
(
msgStr
+
'Success to show the window. data: '
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
console
.
error
(
msgStr
+
'Failed to show the window. Cause: '
+
JSON
.
stringify
(
err
));
expect
()
.
assertFail
()
});
await
tempWnd
.
setFullScreen
(
true
)
.
then
((
data
)
=>
{
console
.
info
(
msgStr
+
'Success to enable the full-screen mode. data: '
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
console
.
error
(
msgStr
+
'Failed to enable the full-screen mode. Cause: '
+
JSON
.
stringify
(
err
));
expect
()
.
assertFail
()
});
tempWnd
.
on
(
'systemAvoidAreaChange'
,
avoidAreaData
=>
{
tempWnd
.
on
(
'systemAvoidAreaChange'
,
avoidAreaData
=>
{
console
.
log
(
msgStr
+
'tempWnd.on systemAvoidAreaChange, avoidAreaData : '
+
JSON
.
stringify
(
avoidAreaData
));
console
.
log
(
msgStr
+
'tempWnd.on systemAvoidAreaChange, setSystemBarEnableType : '
+
setSystemBarEnableType
);
if
(
listenerOnFlag
===
true
)
{
if
(
listenerOnFlag
===
true
)
{
console
.
log
(
msgStr
+
'tempWnd.on systemAvoidAreaChange, listenerOnFlag : '
+
listenerOnFlag
);
console
.
log
(
msgStr
+
'tempWnd.on systemAvoidAreaChange, listenerOnFlag : '
+
listenerOnFlag
);
try
{
try
{
...
@@ -1274,35 +1250,14 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
...
@@ -1274,35 +1250,14 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
}
}
tempWnd
.
off
(
'systemAvoidAreaChange'
)
tempWnd
.
off
(
'systemAvoidAreaChange'
)
done
();
done
();
}
else
{
console
.
log
(
msgStr
+
'tempWnd.on systemAvoidAreaChange, listenerOnFlag : '
+
listenerOnFlag
);
if
(
setSystemBarEnableType
===
0
)
{
console
.
log
(
msgStr
+
'tempWnd.on systemAvoidAreaChange, setSystemBarEnableType === 0'
);
try
{
expect
()
.
assertTrue
();
}
catch
(
error
)
{
console
.
info
(
msgStr
+
`tempWnd.on catch error: ${JSON.stringify(error)}`
)
}
tempWnd
.
off
(
'systemAvoidAreaChange'
)
done
();
}
else
if
(
setSystemBarEnableType
===
2
)
{
console
.
log
(
msgStr
+
'tempWnd.on systemAvoidAreaChange, setSystemBarEnableType === 2'
);
try
{
expect
()
.
assertTrue
();
}
catch
(
error
)
{
console
.
info
(
msgStr
+
`tempWnd.on catch error: ${JSON.stringify(error)}`
)
}
tempWnd
.
off
(
'systemAvoidAreaChange'
)
done
();
}
else
{
console
.
log
(
msgStr
+
'tempWnd.on systemAvoidAreaChange, setSystemBarEnableType null:'
+
setSystemBarEnableType
);
}
}
}
})
})
listenerOnFlag
=
true
;
await
setSystemBarEnable
(
tempWnd
)
.
catch
((
err
)
=>
{
await
setSystemBarEnable
(
tempWnd
)
.
catch
((
err
)
=>
{
console
.
info
(
msgStr
+
'setWindowSystemBarEnable error : '
+
JSON
.
stringify
(
err
));
console
.
info
(
msgStr
+
'setWindowSystemBarEnable error : '
+
JSON
.
stringify
(
err
));
expect
()
.
assertFail
();
expect
()
.
assertFail
();
});
});
await
sleep
(
1000
)
await
setSystemBarEnableT
(
tempWnd
)
.
catch
((
err
)
=>
{
await
setSystemBarEnableT
(
tempWnd
)
.
catch
((
err
)
=>
{
console
.
info
(
msgStr
+
'setWindowSystemBarEnable error : '
+
JSON
.
stringify
(
err
));
console
.
info
(
msgStr
+
'setWindowSystemBarEnable error : '
+
JSON
.
stringify
(
err
));
expect
()
.
assertFail
();
expect
()
.
assertFail
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录