Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7f5cd752
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看板
提交
7f5cd752
编写于
12月 07, 2022
作者:
华
华华小仙女
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.修改签名文件2.优化displayAndWindowRefactorInterface.test.ets用例
Signed-off-by:
N
华华小仙女
<
zhurong18@h-partners.com
>
上级
78fdecee
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
54 addition
and
12 deletion
+54
-12
graphic/windowStage/entry/src/main/ets/test/displayAndWindowRefactorInterface.test.ets
.../main/ets/test/displayAndWindowRefactorInterface.test.ets
+54
-12
未找到文件。
graphic/windowStage/entry/src/main/ets/test/displayAndWindowRefactorInterface.test.ets
浏览文件 @
7f5cd752
...
...
@@ -200,8 +200,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
let
loopCount
=
systemWindowTypeDicArr
.
length
;
console
.
log
(
msgStr
+
'loopCount: '
+
loopCount
);
let
num
=
0
for (let i = 0; i < loopCount; i++) {
sleep(500)
getData
(
0
,
loopCount
)
async
function
getData
(
i
,
length
)
{
let
tempType
=
Number
(
ohosWindow
.
WindowType
[
systemWindowTypeDicArr
[
i
]])
let
windId
=
'createWindowTest1'
+
i
;
console
.
log
(
msgStr
+
'ohosWindow.createWindow: '
+
tempType
+
' start'
);
...
...
@@ -220,6 +221,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
console
.
log
(
msgStr
+
'ohosWindow.createWindow '
+
tempType
+
'finished, wnd: '
+
JSON
.
stringify
(
tempWnd
));
expect
(
!!
tempWnd
)
.
assertTrue
();
num
++
;
if
(
++
i
<
length
)
{
getData
(
i
,
length
)
console
.
log
(
msgStr
+
'jixuzhixing i: '
+
i
);
}
else
{
console
.
log
(
msgStr
+
'i++<length i: '
+
i
+
' ,length:'
+
length
+
' ,tempType:'
+
tempType
);
}
if
(
num
==
loopCount
)
done
();
}
catch
(
exception
)
{
console
.
error
(
msgStr
+
'Failed to create the window. Cause: '
+
JSON
.
stringify
(
exception
));
...
...
@@ -1199,7 +1206,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
});
console
.
log
(
msgStr
+
'ohosWindow.createWindow '
+
baseWndType
+
' wnd: '
+
tempWnd
);
expect
(
!!
tempWnd
)
.
assertTrue
();
for (var i = 1; i <= 5; i++) {
getData
(
1
,
5
)
function
getData
(
i
,
length
)
{
try
{
tempWnd
.
resize
(
100
,
100
)
.
then
((
data
)
=>
{
console
.
info
(
msgStr
+
'Succeeded in changing the window size. Data:'
+
JSON
.
stringify
(
data
));
...
...
@@ -1207,6 +1216,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
})
.
catch
((
err
)
=>
{
console
.
error
(
msgStr
+
'Failed to change the window size. Cause: '
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
)
.
assertEqual
(
6
);
if
(
++
i
<=
length
)
{
getData
(
i
,
length
)
console
.
log
(
msgStr
+
'jixuzhixing i: '
+
i
);
}
else
{
console
.
log
(
msgStr
+
'i++<length i: '
+
i
+
' ,length:'
+
length
);
}
done
();
tempWnd
.
detroyWindow
();
})
...
...
@@ -1284,7 +1299,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
unexpectedError
(
create_err
,
caseName
,
'ohosWindow.createWindow'
,
done
);
return
;
}
for (let i = 1; i <= 5; i++) {
getData
(
1
,
5
)
function
getData
(
i
,
length
)
{
width
=
width
*
i
;
height
=
height
*
i
;
try
{
...
...
@@ -1295,6 +1312,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
return
;
}
console
.
info
(
msgStr
+
'Succeeded in changing the window size.'
);
if
(
++
i
<=
length
)
{
getData
(
i
,
length
)
console
.
log
(
msgStr
+
'jixuzhixing i: '
+
i
);
}
else
{
console
.
log
(
msgStr
+
'i++<length i: '
+
i
+
' ,length:'
+
length
);
}
done
();
});
}
catch
(
exception
)
{
...
...
@@ -1302,7 +1325,6 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
}
;
}
})
}
catch
(
exception
)
{
console
.
error
(
msgStr
+
'Failed to create the window. Cause: '
+
JSON
.
stringify
(
exception
));
...
...
@@ -1871,7 +1893,6 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
* @tc.desc Test window.setWindowMode API function test.
*/
it
(
'setWindowModeTest1'
,
0
,
function
(
done
)
{
//['UNDEFINED','FULLSCREEN','PRIMARY','SECONDARY','FLOATING']
let
windowModeArr
=
[
'FULLSCREEN'
,
'PRIMARY'
,
'SECONDARY'
,
'FLOATING'
]
let
caseName
=
'setWindowModeTest1'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
...
...
@@ -1881,8 +1902,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
expect
(
!!
tempWnd
)
.
assertTrue
();
let
loopCount
=
windowModeArr
;
console
.
log
(
msgStr
+
'ohosWindow.windowType'
+
JSON
.
stringify
(
loopCount
))
for (let i = 0; i < loopCount.length; i++) {
sleep(500)
getData
(
0
,
loopCount
.
length
)
function
getData
(
i
,
length
)
{
let
tempType
=
ohosWindow
.
WindowMode
[
loopCount
[
i
]];
console
.
log
(
msgStr
+
'tempWnd.setWindowMode '
+
tempType
+
' start'
);
try
{
...
...
@@ -1891,6 +1913,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
console
.
info
(
msgStr
+
'Succeeded in setting the window mode. count: '
+
sumCount
);
console
.
info
(
msgStr
+
'Succeeded in setting the window mode. loopCount.length: '
+
loopCount
.
length
);
if
(
sumCount
==
loopCount
.
length
)
done
();
if
(
++
i
<
length
)
{
getData
(
i
,
length
)
console
.
log
(
msgStr
+
'jixuzhixing i: '
+
i
);
}
else
{
console
.
log
(
msgStr
+
'i++<length i: '
+
i
+
' ,length:'
+
length
+
' ,tempType:'
+
tempType
);
}
})
.
catch
((
err
)
=>
{
console
.
log
(
msgStr
+
'currentType: '
+
tempType
)
console
.
error
(
msgStr
+
'Failed to set the window mode. Cause: '
+
JSON
.
stringify
(
err
));
...
...
@@ -1969,8 +1997,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
expect
(
!!
tempWnd
)
.
assertTrue
();
let
loopCount
=
windowModeArr
;
console
.
log
(
msgStr
+
'ohosWindow.windowType'
+
JSON
.
stringify
(
loopCount
))
for (let i = 0; i < loopCount.length; i++) {
sleep(500)
getData
(
0
,
loopCount
.
length
)
function
getData
(
i
,
length
)
{
let
tempType
=
ohosWindow
.
WindowMode
[
loopCount
[
i
]];
console
.
log
(
msgStr
+
'tempWnd.setWindowMode '
+
tempType
+
' start'
);
try
{
...
...
@@ -1982,6 +2011,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
console
.
log
(
msgStr
+
'currentType: '
+
tempType
)
console
.
error
(
msgStr
+
'Failed to set the window mode. Cause: '
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
==
401
)
.
assertTrue
();
if
(
++
i
<
length
)
{
getData
(
i
,
length
)
console
.
log
(
msgStr
+
'jixuzhixing i: '
+
i
);
}
else
{
console
.
log
(
msgStr
+
'i++<length i: '
+
i
+
' ,length:'
+
length
+
' ,tempType:'
+
tempType
);
}
done
();
});
}
catch
(
exception
)
{
...
...
@@ -2009,8 +2044,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
expect
(
!!
wnd
)
.
assertTrue
();
let
loopCount
=
windowModeArr
;
console
.
log
(
msgStr
+
'ohosWindow.windowType'
+
JSON
.
stringify
(
loopCount
))
for (let i = 0; i < loopCount.length; i++) {
sleep(500)
getData
(
0
,
loopCount
.
length
)
function
getData
(
i
,
length
)
{
let
tempType
=
ohosWindow
.
WindowMode
[
loopCount
[
i
]];
console
.
log
(
msgStr
+
'tempWnd.setWindowMode '
+
tempType
+
' start'
);
try
{
...
...
@@ -2023,6 +2059,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
}
catch
(
error
)
{
console
.
info
(
`ohosWindow.createWindow catch error: ${JSON.stringify(error)}`
)
}
if
(
++
i
<
length
)
{
getData
(
i
,
length
)
console
.
log
(
msgStr
+
'jixuzhixing i: '
+
i
);
}
else
{
console
.
log
(
msgStr
+
'i++<length i: '
+
i
+
' ,length:'
+
length
+
' ,tempType:'
+
tempType
);
}
done
();
}
else
{
sumCount
++
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录