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
...
@@ -200,8 +200,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
let
loopCount
=
systemWindowTypeDicArr
.
length
;
let
loopCount
=
systemWindowTypeDicArr
.
length
;
console
.
log
(
msgStr
+
'loopCount: '
+
loopCount
);
console
.
log
(
msgStr
+
'loopCount: '
+
loopCount
);
let
num
=
0
let
num
=
0
for (let i = 0; i < loopCount; i++) {
getData
(
0
,
loopCount
)
sleep(500)
async
function
getData
(
i
,
length
)
{
let
tempType
=
Number
(
ohosWindow
.
WindowType
[
systemWindowTypeDicArr
[
i
]])
let
tempType
=
Number
(
ohosWindow
.
WindowType
[
systemWindowTypeDicArr
[
i
]])
let
windId
=
'createWindowTest1'
+
i
;
let
windId
=
'createWindowTest1'
+
i
;
console
.
log
(
msgStr
+
'ohosWindow.createWindow: '
+
tempType
+
' start'
);
console
.
log
(
msgStr
+
'ohosWindow.createWindow: '
+
tempType
+
' start'
);
...
@@ -220,6 +221,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -220,6 +221,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
console
.
log
(
msgStr
+
'ohosWindow.createWindow '
+
tempType
+
'finished, wnd: '
+
JSON
.
stringify
(
tempWnd
));
console
.
log
(
msgStr
+
'ohosWindow.createWindow '
+
tempType
+
'finished, wnd: '
+
JSON
.
stringify
(
tempWnd
));
expect
(
!!
tempWnd
)
.
assertTrue
();
expect
(
!!
tempWnd
)
.
assertTrue
();
num
++
;
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
();
if
(
num
==
loopCount
)
done
();
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
msgStr
+
'Failed to create the window. Cause: '
+
JSON
.
stringify
(
exception
));
console
.
error
(
msgStr
+
'Failed to create the window. Cause: '
+
JSON
.
stringify
(
exception
));
...
@@ -1199,7 +1206,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -1199,7 +1206,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
});
});
console
.
log
(
msgStr
+
'ohosWindow.createWindow '
+
baseWndType
+
' wnd: '
+
tempWnd
);
console
.
log
(
msgStr
+
'ohosWindow.createWindow '
+
baseWndType
+
' wnd: '
+
tempWnd
);
expect
(
!!
tempWnd
)
.
assertTrue
();
expect
(
!!
tempWnd
)
.
assertTrue
();
for (var i = 1; i <= 5; i++) {
getData
(
1
,
5
)
function
getData
(
i
,
length
)
{
try
{
try
{
tempWnd
.
resize
(
100
,
100
)
.
then
((
data
)
=>
{
tempWnd
.
resize
(
100
,
100
)
.
then
((
data
)
=>
{
console
.
info
(
msgStr
+
'Succeeded in changing the window size. Data:'
+
JSON
.
stringify
(
data
));
console
.
info
(
msgStr
+
'Succeeded in changing the window size. Data:'
+
JSON
.
stringify
(
data
));
...
@@ -1207,6 +1216,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -1207,6 +1216,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
error
(
msgStr
+
'Failed to change the window size. Cause: '
+
JSON
.
stringify
(
err
));
console
.
error
(
msgStr
+
'Failed to change the window size. Cause: '
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
)
.
assertEqual
(
6
);
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
();
done
();
tempWnd
.
detroyWindow
();
tempWnd
.
detroyWindow
();
})
})
...
@@ -1284,7 +1299,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -1284,7 +1299,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
unexpectedError
(
create_err
,
caseName
,
'ohosWindow.createWindow'
,
done
);
unexpectedError
(
create_err
,
caseName
,
'ohosWindow.createWindow'
,
done
);
return
;
return
;
}
}
for (let i = 1; i <= 5; i++) {
getData
(
1
,
5
)
function
getData
(
i
,
length
)
{
width
=
width
*
i
;
width
=
width
*
i
;
height
=
height
*
i
;
height
=
height
*
i
;
try
{
try
{
...
@@ -1295,6 +1312,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -1295,6 +1312,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
return
;
return
;
}
}
console
.
info
(
msgStr
+
'Succeeded in changing the window size.'
);
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
();
done
();
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
...
@@ -1302,7 +1325,6 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -1302,7 +1325,6 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
}
}
;
;
}
}
})
})
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
msgStr
+
'Failed to create the window. Cause: '
+
JSON
.
stringify
(
exception
));
console
.
error
(
msgStr
+
'Failed to create the window. Cause: '
+
JSON
.
stringify
(
exception
));
...
@@ -1871,7 +1893,6 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -1871,7 +1893,6 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
* @tc.desc Test window.setWindowMode API function test.
* @tc.desc Test window.setWindowMode API function test.
*/
*/
it
(
'setWindowModeTest1'
,
0
,
function
(
done
)
{
it
(
'setWindowModeTest1'
,
0
,
function
(
done
)
{
//['UNDEFINED','FULLSCREEN','PRIMARY','SECONDARY','FLOATING']
let
windowModeArr
=
[
'FULLSCREEN'
,
'PRIMARY'
,
'SECONDARY'
,
'FLOATING'
]
let
windowModeArr
=
[
'FULLSCREEN'
,
'PRIMARY'
,
'SECONDARY'
,
'FLOATING'
]
let
caseName
=
'setWindowModeTest1'
;
let
caseName
=
'setWindowModeTest1'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
...
@@ -1881,8 +1902,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -1881,8 +1902,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
expect
(
!!
tempWnd
)
.
assertTrue
();
expect
(
!!
tempWnd
)
.
assertTrue
();
let
loopCount
=
windowModeArr
;
let
loopCount
=
windowModeArr
;
console
.
log
(
msgStr
+
'ohosWindow.windowType'
+
JSON
.
stringify
(
loopCount
))
console
.
log
(
msgStr
+
'ohosWindow.windowType'
+
JSON
.
stringify
(
loopCount
))
for (let i = 0; i < loopCount.length; i++) {
getData
(
0
,
loopCount
.
length
)
sleep(500)
function
getData
(
i
,
length
)
{
let
tempType
=
ohosWindow
.
WindowMode
[
loopCount
[
i
]];
let
tempType
=
ohosWindow
.
WindowMode
[
loopCount
[
i
]];
console
.
log
(
msgStr
+
'tempWnd.setWindowMode '
+
tempType
+
' start'
);
console
.
log
(
msgStr
+
'tempWnd.setWindowMode '
+
tempType
+
' start'
);
try
{
try
{
...
@@ -1891,6 +1913,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -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. count: '
+
sumCount
);
console
.
info
(
msgStr
+
'Succeeded in setting the window mode. loopCount.length: '
+
loopCount
.
length
);
console
.
info
(
msgStr
+
'Succeeded in setting the window mode. loopCount.length: '
+
loopCount
.
length
);
if
(
sumCount
==
loopCount
.
length
)
done
();
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
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
log
(
msgStr
+
'currentType: '
+
tempType
)
console
.
log
(
msgStr
+
'currentType: '
+
tempType
)
console
.
error
(
msgStr
+
'Failed to set the window mode. Cause: '
+
JSON
.
stringify
(
err
));
console
.
error
(
msgStr
+
'Failed to set the window mode. Cause: '
+
JSON
.
stringify
(
err
));
...
@@ -1969,8 +1997,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -1969,8 +1997,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
expect
(
!!
tempWnd
)
.
assertTrue
();
expect
(
!!
tempWnd
)
.
assertTrue
();
let
loopCount
=
windowModeArr
;
let
loopCount
=
windowModeArr
;
console
.
log
(
msgStr
+
'ohosWindow.windowType'
+
JSON
.
stringify
(
loopCount
))
console
.
log
(
msgStr
+
'ohosWindow.windowType'
+
JSON
.
stringify
(
loopCount
))
for (let i = 0; i < loopCount.length; i++) {
getData
(
0
,
loopCount
.
length
)
sleep(500)
function
getData
(
i
,
length
)
{
let
tempType
=
ohosWindow
.
WindowMode
[
loopCount
[
i
]];
let
tempType
=
ohosWindow
.
WindowMode
[
loopCount
[
i
]];
console
.
log
(
msgStr
+
'tempWnd.setWindowMode '
+
tempType
+
' start'
);
console
.
log
(
msgStr
+
'tempWnd.setWindowMode '
+
tempType
+
' start'
);
try
{
try
{
...
@@ -1982,6 +2011,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -1982,6 +2011,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
console
.
log
(
msgStr
+
'currentType: '
+
tempType
)
console
.
log
(
msgStr
+
'currentType: '
+
tempType
)
console
.
error
(
msgStr
+
'Failed to set the window mode. Cause: '
+
JSON
.
stringify
(
err
));
console
.
error
(
msgStr
+
'Failed to set the window mode. Cause: '
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
==
401
)
.
assertTrue
();
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
();
done
();
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
...
@@ -2009,8 +2044,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -2009,8 +2044,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
expect
(
!!
wnd
)
.
assertTrue
();
expect
(
!!
wnd
)
.
assertTrue
();
let
loopCount
=
windowModeArr
;
let
loopCount
=
windowModeArr
;
console
.
log
(
msgStr
+
'ohosWindow.windowType'
+
JSON
.
stringify
(
loopCount
))
console
.
log
(
msgStr
+
'ohosWindow.windowType'
+
JSON
.
stringify
(
loopCount
))
for (let i = 0; i < loopCount.length; i++) {
getData
(
0
,
loopCount
.
length
)
sleep(500)
function
getData
(
i
,
length
)
{
let
tempType
=
ohosWindow
.
WindowMode
[
loopCount
[
i
]];
let
tempType
=
ohosWindow
.
WindowMode
[
loopCount
[
i
]];
console
.
log
(
msgStr
+
'tempWnd.setWindowMode '
+
tempType
+
' start'
);
console
.
log
(
msgStr
+
'tempWnd.setWindowMode '
+
tempType
+
' start'
);
try
{
try
{
...
@@ -2023,6 +2059,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
...
@@ -2023,6 +2059,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
`ohosWindow.createWindow catch error: ${JSON.stringify(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
();
done
();
}
else
{
}
else
{
sumCount
++
sumCount
++
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录