Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e0ad68d5
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看板
未验证
提交
e0ad68d5
编写于
7月 31, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 31, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9612 优化用例
Merge pull request !9612 from 姚翠/master
上级
84b88df5
95bf3554
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
138 addition
and
137 deletion
+138
-137
graphic/effectKit/entry/src/main/ets/test/effectKit.test.ets
graphic/effectKit/entry/src/main/ets/test/effectKit.test.ets
+1
-1
graphic/windowStage/entry/src/main/ets/MainAbility/pages/second/pageTwo.ets
...e/entry/src/main/ets/MainAbility/pages/second/pageTwo.ets
+1
-1
graphic/windowStage/entry/src/main/ets/test/parameterVerificationIsOptional.test.ets
...rc/main/ets/test/parameterVerificationIsOptional.test.ets
+136
-135
未找到文件。
graphic/effectKit/entry/src/main/ets/test/effectKit.test.ets
浏览文件 @
e0ad68d5
...
...
@@ -971,6 +971,6 @@ export default function effectKitTest() {
})
})
})
})
}
graphic/windowStage/entry/src/main/ets/MainAbility/pages/second/pageTwo.ets
浏览文件 @
e0ad68d5
...
...
@@ -19,7 +19,7 @@ struct PageTwo {
build() {
Row(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.
Center
}) {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.
Start
}) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
...
...
graphic/windowStage/entry/src/main/ets/test/parameterVerificationIsOptional.test.ets
浏览文件 @
e0ad68d5
...
...
@@ -336,141 +336,6 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done
();
}
})
/**
* @tc.number SUB_WINDOW_WINDOWOFFKEYBOARDHEIGHTCHANGE_JSAPI_001
* @tc.name Test window_off_keyboardHeightChange_Test_001
* @tc.desc Turn off listening for keyboard height changes
*/
it
(
'window_off_keyboardHeightChange_Test_001'
,
0
,
async
function
(
done
)
{
let
caseName
=
'window_off_keyboardHeightChange_Test_001'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
console
.
log
(
msgStr
+
'begin'
);
let
firstListenFlag
=
false
let
secondListenFlag
=
false
let
windowId
=
'window_off_keyboardHeightChange_Test_001'
;
let
windowConfig
=
{
name
:
windowId
,
windowType
:
ohosWindow
.
WindowType
.
TYPE_SYSTEM_ALERT
,
ctx
:
context
};
let
tempWnd
=
null
;
tempWnd
=
await
ohosWindow
.
createWindow
(
windowConfig
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'ohosWindow.createWindow'
,
done
);
});
expect
(
!!
tempWnd
)
.
assertTrue
();
await
tempWnd
.
loadContent
(
'MainAbility/pages/second/pageTwo'
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.loadContent'
,
done
);
});
await
tempWnd
.
resize
(
800
,
800
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.resetSize'
,
done
);
});
await
tempWnd
.
moveWindowTo
(
100
,
100
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.moveWindowTo '
,
done
);
});
await
tempWnd
.
showWindow
()
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.showWindow'
,
done
);
});
tempWnd
.
on
(
'keyboardHeightChange'
,
(
data
)
=>
{
console
.
info
(
msgStr
+
"first listener trigger"
);
firstListenFlag
=
true
});
tempWnd
.
on
(
'keyboardHeightChange'
,
(
data
)
=>
{
console
.
info
(
msgStr
+
"second listener trigger"
);
secondListenFlag
=
true
});
await
inputClick
(
'pageTwoinput'
,
msgStr
)
.
catch
(
async
err
=>
{
console
.
info
(
msgStr
+
err
);
await
tempWnd
.
destroyWindow
();
expect
(
TRUE_FLAG
)
.
assertFail
();
done
();
})
await
sleep
(
1000
);
tempWnd
.
off
(
'keyboardHeightChange'
);
firstListenFlag
=
false
secondListenFlag
=
false
await
inputClick
(
'pageTwoinputSecond'
,
msgStr
)
.
catch
(
async
err
=>
{
console
.
info
(
msgStr
+
err
);
await
tempWnd
.
destroyWindow
();
expect
(
TRUE_FLAG
)
.
assertFail
();
done
();
})
await
sleep
(
2000
);
if
(
firstListenFlag
===
false
&&
secondListenFlag
===
false
)
{
await
tempWnd
.
destroyWindow
();
done
();
}
})
/**
* @tc.number SUB_WINDOW_WINDOWOFFKEYBOARDHEIGHTCHANGE_JSAPI_002
* @tc.name Test window_off_keyboardHeightChange_Test_002
* @tc.desc Turn off listening for keyboard height changes
*/
it
(
'window_off_keyboardHeightChange_Test_002'
,
0
,
async
function
(
done
)
{
let
caseName
=
'window_off_keyboardHeightChange_Test_002'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
console
.
log
(
msgStr
+
'begin'
);
let
firstListenFlag
=
false
let
secondListenFlag
=
false
function
firstCall
()
{
console
.
log
(
msgStr
+
"first listener trigger"
)
firstListenFlag
=
true
}
function
secondCall
()
{
console
.
log
(
msgStr
+
"second listener trigger"
)
secondListenFlag
=
true
}
let
windowId
=
'window_off_keyboardHeightChange_Test_002'
;
let
windowConfig
=
{
name
:
windowId
,
windowType
:
ohosWindow
.
WindowType
.
TYPE_SYSTEM_ALERT
,
ctx
:
context
};
let
tempWnd
=
null
;
tempWnd
=
await
ohosWindow
.
createWindow
(
windowConfig
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'ohosWindow.createWindow'
,
done
);
});
expect
(
!!
tempWnd
)
.
assertTrue
();
await
tempWnd
.
loadContent
(
'MainAbility/pages/second/pageTwo'
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.loadContent'
,
done
);
});
await
tempWnd
.
resize
(
800
,
800
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.resetSize'
,
done
);
});
await
tempWnd
.
moveWindowTo
(
100
,
100
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.moveWindowTo '
,
done
);
});
await
tempWnd
.
showWindow
()
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.showWindow'
,
done
);
});
tempWnd
.
on
(
'keyboardHeightChange'
,
firstCall
);
tempWnd
.
on
(
'keyboardHeightChange'
,
secondCall
);
await
inputClick
(
'pageTwoinput'
,
msgStr
)
.
catch
(
async
err
=>
{
console
.
info
(
msgStr
+
err
);
await
tempWnd
.
destroyWindow
();
expect
(
TRUE_FLAG
)
.
assertFail
();
done
();
})
await
sleep
(
1000
);
tempWnd
.
off
(
'keyboardHeightChange'
,
firstCall
);
firstListenFlag
=
false
secondListenFlag
=
false
await
inputClick
(
'pageTwoinputSecond'
,
msgStr
)
.
catch
(
async
err
=>
{
console
.
info
(
msgStr
+
err
);
await
tempWnd
.
destroyWindow
();
expect
(
TRUE_FLAG
)
.
assertFail
();
done
();
})
await
sleep
(
2000
);
if
(
!
firstListenFlag
&&
secondListenFlag
)
{
tempWnd
.
off
(
'keyboardHeightChange'
);
await
tempWnd
.
destroyWindow
();
done
();
}
else
{
tempWnd
.
off
(
'keyboardHeightChange'
);
await
tempWnd
.
destroyWindow
();
expect
(
TRUE_FLAG
)
.
assertFail
();
done
();
}
})
/**
* @tc.number SUB_WINDOW_WINDOWOFFSCREENSHOT_JSAPI_001
...
...
@@ -744,6 +609,142 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done
();
}
})
/**
* @tc.number SUB_WINDOW_WINDOWOFFKEYBOARDHEIGHTCHANGE_JSAPI_001
* @tc.name Test window_off_keyboardHeightChange_Test_001
* @tc.desc Turn off listening for keyboard height changes
*/
it
(
'window_off_keyboardHeightChange_Test_001'
,
0
,
async
function
(
done
)
{
let
caseName
=
'window_off_keyboardHeightChange_Test_001'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
console
.
log
(
msgStr
+
'begin'
);
let
firstListenFlag
=
false
let
secondListenFlag
=
false
let
windowId
=
'window_off_keyboardHeightChange_Test_001'
;
let
windowConfig
=
{
name
:
windowId
,
windowType
:
ohosWindow
.
WindowType
.
TYPE_DIALOG
,
ctx
:
context
};
let
tempWnd
=
null
;
tempWnd
=
await
ohosWindow
.
createWindow
(
windowConfig
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'ohosWindow.createWindow'
,
done
);
});
expect
(
!!
tempWnd
)
.
assertTrue
();
await
tempWnd
.
loadContent
(
'MainAbility/pages/second/pageTwo'
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.loadContent'
,
done
);
});
await
tempWnd
.
resize
(
800
,
1000
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.resetSize'
,
done
);
});
await
tempWnd
.
moveWindowTo
(
0
,
0
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.moveWindowTo '
,
done
);
});
await
tempWnd
.
showWindow
()
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.showWindow'
,
done
);
});
tempWnd
.
on
(
'keyboardHeightChange'
,
(
data
)
=>
{
console
.
info
(
msgStr
+
"first listener trigger"
);
firstListenFlag
=
true
});
tempWnd
.
on
(
'keyboardHeightChange'
,
(
data
)
=>
{
console
.
info
(
msgStr
+
"second listener trigger"
);
secondListenFlag
=
true
});
await
inputClick
(
'pageTwoinput'
,
msgStr
)
.
catch
(
async
err
=>
{
console
.
info
(
msgStr
+
err
);
await
tempWnd
.
destroyWindow
();
expect
(
TRUE_FLAG
)
.
assertFail
();
done
();
})
await
sleep
(
1000
);
tempWnd
.
off
(
'keyboardHeightChange'
);
firstListenFlag
=
false
secondListenFlag
=
false
await
inputClick
(
'pageTwoinputSecond'
,
msgStr
)
.
catch
(
async
err
=>
{
console
.
info
(
msgStr
+
err
);
await
tempWnd
.
destroyWindow
();
expect
(
TRUE_FLAG
)
.
assertFail
();
done
();
})
await
sleep
(
2000
);
if
(
firstListenFlag
===
false
&&
secondListenFlag
===
false
)
{
await
tempWnd
.
destroyWindow
();
done
();
}
})
/**
* @tc.number SUB_WINDOW_WINDOWOFFKEYBOARDHEIGHTCHANGE_JSAPI_002
* @tc.name Test window_off_keyboardHeightChange_Test_002
* @tc.desc Turn off listening for keyboard height changes
*/
it
(
'window_off_keyboardHeightChange_Test_002'
,
0
,
async
function
(
done
)
{
let
caseName
=
'window_off_keyboardHeightChange_Test_002'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
console
.
log
(
msgStr
+
'begin'
);
let
firstListenFlag
=
false
let
secondListenFlag
=
false
function
firstCall
()
{
console
.
log
(
msgStr
+
"first listener trigger"
)
firstListenFlag
=
true
}
function
secondCall
()
{
console
.
log
(
msgStr
+
"second listener trigger"
)
secondListenFlag
=
true
}
let
windowId
=
'window_off_keyboardHeightChange_Test_002'
;
let
windowConfig
=
{
name
:
windowId
,
windowType
:
ohosWindow
.
WindowType
.
TYPE_DIALOG
,
ctx
:
context
};
let
tempWnd
=
null
;
tempWnd
=
await
ohosWindow
.
createWindow
(
windowConfig
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'ohosWindow.createWindow'
,
done
);
});
expect
(
!!
tempWnd
)
.
assertTrue
();
await
tempWnd
.
loadContent
(
'MainAbility/pages/second/pageTwo'
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.loadContent'
,
done
);
});
await
tempWnd
.
resize
(
800
,
1000
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.resetSize'
,
done
);
});
await
tempWnd
.
moveWindowTo
(
0
,
0
)
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.moveWindowTo '
,
done
);
});
await
tempWnd
.
showWindow
()
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'tempWnd.showWindow'
,
done
);
});
tempWnd
.
on
(
'keyboardHeightChange'
,
firstCall
);
tempWnd
.
on
(
'keyboardHeightChange'
,
secondCall
);
await
inputClick
(
'pageTwoinput'
,
msgStr
)
.
catch
(
async
err
=>
{
console
.
info
(
msgStr
+
err
);
await
tempWnd
.
destroyWindow
();
expect
(
TRUE_FLAG
)
.
assertFail
();
done
();
})
await
sleep
(
1000
);
tempWnd
.
off
(
'keyboardHeightChange'
,
firstCall
);
firstListenFlag
=
false
secondListenFlag
=
false
await
inputClick
(
'pageTwoinputSecond'
,
msgStr
)
.
catch
(
async
err
=>
{
console
.
info
(
msgStr
+
err
);
await
tempWnd
.
destroyWindow
();
expect
(
TRUE_FLAG
)
.
assertFail
();
done
();
})
await
sleep
(
2000
);
if
(
!
firstListenFlag
&&
secondListenFlag
)
{
tempWnd
.
off
(
'keyboardHeightChange'
);
await
tempWnd
.
destroyWindow
();
done
();
}
else
{
tempWnd
.
off
(
'keyboardHeightChange'
);
await
tempWnd
.
destroyWindow
();
expect
(
TRUE_FLAG
)
.
assertFail
();
done
();
}
})
/**
* @tc.number SUB_WINDOW_WINDOWSTAGEOFFWINDOWSTAGEVENT_JSAPI_001
* @tc.name Test windowStage_off_windowStageEvent_Test_001
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录