Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2674bf63
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看板
未验证
提交
2674bf63
编写于
5月 19, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 19, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8671 新增用例,优化用例
Merge pull request !8671 from 姚翠/OpenHarmony-3.2-Release
上级
d7fdc34d
0b367809
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
1395 addition
and
193 deletion
+1395
-193
graphic/windowStage/Test.json
graphic/windowStage/Test.json
+18
-7
graphic/windowStage/entry/src/main/ets/MainAbility/pages/second/pageOne.ets
...e/entry/src/main/ets/MainAbility/pages/second/pageOne.ets
+46
-0
graphic/windowStage/entry/src/main/ets/MainAbility/pages/second/pageTwo.ets
...e/entry/src/main/ets/MainAbility/pages/second/pageTwo.ets
+60
-0
graphic/windowStage/entry/src/main/ets/MainAbility/pages/second/second.ets
...ge/entry/src/main/ets/MainAbility/pages/second/second.ets
+3
-2
graphic/windowStage/entry/src/main/ets/test/List.test.ets
graphic/windowStage/entry/src/main/ets/test/List.test.ets
+2
-0
graphic/windowStage/entry/src/main/ets/test/parameterVerificationIsOptional.test.ets
...rc/main/ets/test/parameterVerificationIsOptional.test.ets
+1263
-0
graphic/windowStage/entry/src/main/ets/test/windowCallback.test.ets
...ndowStage/entry/src/main/ets/test/windowCallback.test.ets
+0
-101
graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets
...indowStage/entry/src/main/ets/test/windowPromise.test.ets
+0
-82
graphic/windowStage/entry/src/main/resources/base/profile/main_pages.json
...age/entry/src/main/resources/base/profile/main_pages.json
+3
-1
未找到文件。
graphic/windowStage/Test.json
浏览文件 @
2674bf63
...
...
@@ -8,11 +8,22 @@
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
"kits"
:
[{
"test-file-name"
:
[
"ActsWindowStageTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}]
"kits"
:
[
{
"test-file-name"
:
[
"ActsWindowStageTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"param set persist.ace.testmode.enabled 1"
,
"reboot"
,
"uinput -T -d 300 600 -m 300 600 300 100 -u 300 100"
,
"power-shell setmode 602"
]
}
]
}
\ No newline at end of file
graphic/windowStage/entry/src/main/ets/MainAbility/pages/second/pageOne.ets
0 → 100644
浏览文件 @
2674bf63
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct PageOne {
private content: string = "Page one"
build() {
Row(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('点击pageOne')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
console.log("click the button")
})
}
.width('100%')
.height('100%')
}.width('100%')
.height('100%')
.backgroundColor("#69b594")
}
}
\ No newline at end of file
graphic/windowStage/entry/src/main/ets/MainAbility/pages/second/pageTwo.ets
0 → 100644
浏览文件 @
2674bf63
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct PageTwo {
private content: string = "Page two"
build() {
Row(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
TextInput({ placeholder: '请点击' })
.key('pageTwoinput')
.width(400)
.height(50)
.margin(10)
.borderRadius(0)
.style(TextInputStyle.Inline)
TextInput({ placeholder: '请点击' })
.key('pageTwoinputSecond')
.width(400)
.height(50)
.margin(10)
.borderRadius(0)
.style(TextInputStyle.Inline)
Button() {
Text('点击pageTwo')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
console.log("click the button")
})
}
.width('100%')
.height('100%')
}.width('100%')
.height('100%')
.backgroundColor("#ff82b37e")
}
}
\ No newline at end of file
graphic/windowStage/entry/src/main/ets/MainAbility/pages/second/second.ets
浏览文件 @
2674bf63
...
...
@@ -20,12 +20,12 @@ struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Flex({ direction: FlexDirection.Column,
alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('
back to i
ndex')
Text('
secondPage_BackToI
ndex')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
...
...
@@ -39,5 +39,6 @@ struct Second {
}
.width('100%')
.height('100%')
.backgroundColor('#ccc')
}
}
\ No newline at end of file
graphic/windowStage/entry/src/main/ets/test/List.test.ets
浏览文件 @
2674bf63
...
...
@@ -16,10 +16,12 @@ import windowPromiseTest from './windowPromise.test'
import windowCallbackTest from './windowCallback.test'
import windowRefactorInterfaceTest from './windowRefactorInterface.test'
import displayAndWindowRefactorInterfaceTest from './displayAndWindowRefactorInterface.test'
import parameterVerificationIsOptional from './parameterVerificationIsOptional.test'
export default function testsuite() {
windowCallbackTest(globalThis.abilityContext,globalThis.windowStage,globalThis.abilityStorage)
windowPromiseTest(globalThis.abilityContext,globalThis.windowStage,globalThis.abilityStorage)
windowRefactorInterfaceTest(globalThis.abilityContext,globalThis.windowStage,globalThis.abilityStorage)
displayAndWindowRefactorInterfaceTest(globalThis.abilityContext,globalThis.windowStage,globalThis.abilityStorage)
parameterVerificationIsOptional(globalThis.abilityContext,globalThis.windowStage,globalThis.abilityStorage)
}
\ No newline at end of file
graphic/windowStage/entry/src/main/ets/test/parameterVerificationIsOptional.test.ets
0 → 100644
浏览文件 @
2674bf63
此差异已折叠。
点击以展开。
graphic/windowStage/entry/src/main/ets/test/windowCallback.test.ets
浏览文件 @
2674bf63
...
...
@@ -2212,106 +2212,5 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
}
})
})
/**
* @tc.number SUB_WINDOW_SHOWWITHANIMATION_JSAPI_002
* @tc.name Test showWithAnimationTest2
* @tc.desc Displays the current window, playing an animation in the process
*/
it
(
'showWithAnimationTest2'
,
0
,
async
function
(
done
)
{
let
caseName
=
'showWithAnimationTest2'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
console
.
log
(
msgStr
+
'begin context=='
+
JSON
.
stringify
(
context
));
let
wndId
=
'showWithAnimationTest2'
;
let
baseType
=
ohosWindow
.
WindowType
.
TYPE_FLOAT
;
let
tempWnd
=
null
;
function
createWin
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
ohosWindow
.
create
(
context
,
wndId
,
baseType
,
(
err
,
data
)
=>
{
if
(
err
&&
err
.
code
)
{
reject
(
null
)
}
else
{
resolve
(
data
)
}
})
})
}
tempWnd
=
await
createWin
()
.
catch
(
err
=>
{
console
.
info
(
msgStr
+
`ohosWindow.create failed error: ${JSON.stringify(err)}`
)
expect
()
.
assertFail
();
done
();
})
expect
(
!!
tempWnd
)
.
assertTrue
();
tempWnd
.
showWithAnimation
(
async
(
error
,
animationData
)
=>
{
if
(
error
&&
error
.
code
)
{
unexpectedError
(
error
,
caseName
,
'Failed to show the window with animation'
,
done
);
}
else
{
console
.
info
(
'Succeeded in showing the window with animation. Data: '
+
JSON
.
stringify
(
animationData
));
await
tempWnd
.
destroy
()
done
()
}
})
})
/**
* @tc.number SUB_WINDOW_HIDEWITHANIMATION_JSAPI_002
* @tc.name Test hideWithAnimationTest2
* @tc.desc Hide the current window and play an animation in the process
*/
it
(
'hideWithAnimationTest2'
,
0
,
async
function
(
done
)
{
let
caseName
=
'hideWithAnimationTest2'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
console
.
log
(
msgStr
+
'begin context=='
+
JSON
.
stringify
(
context
));
let
wndId
=
'hideWithAnimationTest2'
;
let
baseType
=
ohosWindow
.
WindowType
.
TYPE_FLOAT
;
let
tempWnd
=
null
function
createWin
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
ohosWindow
.
create
(
context
,
wndId
,
baseType
,
(
creare_err
,
data
)
=>
{
if
(
creare_err
&&
creare_err
.
code
)
{
reject
(
null
)
}
else
{
resolve
(
data
)
}
})
})
}
function
findWin
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
ohosWindow
.
find
(
wndId
,
(
findErr
,
findWnd
)
=>
{
if
(
findErr
&&
findErr
.
code
)
{
reject
(
null
)
}
else
{
resolve
(
findWnd
)
}
})
})
}
tempWnd
=
await
createWin
()
.
catch
(
err
=>
{
console
.
info
(
msgStr
+
`ohosWindow.create failed error: ${JSON.stringify(err)}`
)
expect
()
.
assertFail
();
done
();
})
expect
(
!!
tempWnd
)
.
assertTrue
();
let
findWnd
;
findWnd
=
await
findWin
()
.
catch
(
err
=>
{
console
.
info
(
msgStr
+
`ohosWindow.find failed error: ${JSON.stringify(err)}`
)
expect
()
.
assertFail
();
done
();
})
expect
(
!!
findWnd
)
.
assertTrue
();
findWnd
.
hideWithAnimation
(
async
(
err
,
data
)
=>
{
if
(
err
&&
err
.
code
)
{
unexpectedError
(
err
,
caseName
,
'Failed to hide the window with animation'
,
done
);
}
else
{
console
.
info
(
'Succeeded in hiding the window with animation. Data: '
+
JSON
.
stringify
(
data
));
await
tempWnd
.
destroy
();
done
();
}
})
})
})
}
graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets
浏览文件 @
2674bf63
...
...
@@ -1574,87 +1574,5 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
unexpectedError
(
err
,
caseName
,
'displayClass.getCutoutInfo'
,
done
);
});
})
/**
* @tc.number SUB_WINDOW_SHOWWITHANIMATION_JSAPI_001
* @tc.name Test showWithAnimationTest1
* @tc.desc Displays the current window, playing an animation in the process
*/
it
(
'showWithAnimationTest1'
,
0
,
async
function
(
done
)
{
let
caseName
=
'showWithAnimationTest1'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
console
.
log
(
msgStr
+
'begin context=='
+
JSON
.
stringify
(
context
));
let
wndId
=
'showWithAnimationTest1'
;
let
baseType
=
ohosWindow
.
WindowType
.
TYPE_FLOAT
;
let
createWindowObj
=
{
name
:
wndId
,
windowType
:
baseType
,
ctx
:
context
}
let
tempWnd
=
null
;
try
{
await
ohosWindow
.
createWindow
(
createWindowObj
)
.
then
((
data
)
=>
{
tempWnd
=
data
console
.
log
(
msgStr
+
'ohosWindow.create '
+
baseType
+
', tempWnd: '
+
JSON
.
stringify
(
tempWnd
));
expect
(
!!
tempWnd
)
.
assertTrue
();
console
.
info
(
'showWithAnimationTest1 ****'
+
Reflect
.
has
(
tempWnd
,
'showWithAnimation'
))
})
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'ohosWindow.create '
+
baseType
,
done
);
});
}
catch
(
err
)
{
console
.
log
(
msgStr
+
'ohosWindow.create catch err:'
+
JSON
.
stringify
(
err
));
}
await
tempWnd
.
showWithAnimation
()
.
then
((
data
)
=>
{
console
.
info
(
'Succeeded in showing the window with animation. Data: '
+
JSON
.
stringify
(
data
));
tempWnd
.
destroy
();
done
();
})
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'Failed to show the window with animation'
,
done
);
})
})
/**
* @tc.number SUB_WINDOW_HIDEWITHANIMATION_JSAPI_001
* @tc.name Test hideWithAnimationTest1
* @tc.desc Hide the current window and play an animation in the process
*/
it
(
'hideWithAnimationTest1'
,
0
,
async
function
(
done
)
{
let
caseName
=
'hideWithAnimationTest1'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
console
.
log
(
msgStr
+
'begin context=='
+
JSON
.
stringify
(
context
));
let
wndId
=
'hideWithAnimationTest1'
;
let
baseType
=
ohosWindow
.
WindowType
.
TYPE_FLOAT
;
let
createWindowObj
=
{
name
:
wndId
,
windowType
:
baseType
,
ctx
:
context
}
let
tempWnd
=
null
;
try
{
await
ohosWindow
.
createWindow
(
createWindowObj
)
.
then
((
data
)
=>
{
tempWnd
=
data
console
.
log
(
msgStr
+
'ohosWindow.create '
+
baseType
+
', tempWnd: '
+
JSON
.
stringify
(
tempWnd
));
expect
(
!!
tempWnd
)
.
assertTrue
();
})
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'ohosWindow.create '
+
baseType
,
done
);
});
}
catch
(
err
)
{
console
.
log
(
msgStr
+
'ohosWindow.create catch err:'
+
JSON
.
stringify
(
err
));
}
let
findWnd
=
null
;
await
ohosWindow
.
find
(
wndId
)
.
then
((
data
)
=>
{
findWnd
=
data
})
.
catch
((
err
)
=>
{
unexpectedError
(
err
,
caseName
,
'ohosWindow.find'
,
done
);
});
console
.
log
(
msgStr
+
'find findWnd: '
+
JSON
.
stringify
(
findWnd
));
expect
(
!!
findWnd
)
.
assertTrue
();
let
promise
=
findWnd
.
hideWithAnimation
();
promise
.
then
((
data
)
=>
{
console
.
info
(
'Succeeded in hiding the window with animation. Data: '
+
JSON
.
stringify
(
data
));
tempWnd
.
destroy
();
done
();
})
.
catch
((
err
)
=>
{
console
.
error
(
'Failed to hide the window with animation. Cause: '
+
JSON
.
stringify
(
err
));
})
})
})
}
graphic/windowStage/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
2674bf63
{
"src"
:
[
"MainAbility/pages/index/index"
,
"MainAbility/pages/second/second"
"MainAbility/pages/second/second"
,
"MainAbility/pages/second/pageOne"
,
"MainAbility/pages/second/pageTwo"
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录