Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
49dc4c90
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
49dc4c90
编写于
3月 19, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 19, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2680 【窗口子系统】修改xts用例
Merge pull request !2680 from liziqiang/cherry-pick-1647702082
上级
cdacdffb
e375fabf
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
1965 addition
and
2550 deletion
+1965
-2550
graphic/windowstandard/Test.json
graphic/windowstandard/Test.json
+1
-1
graphic/windowstandard/src/main/js/default/test/List.test.js
graphic/windowstandard/src/main/js/default/test/List.test.js
+1
-4
graphic/windowstandard/src/main/js/default/test/display.test.js
...c/windowstandard/src/main/js/default/test/display.test.js
+118
-0
graphic/windowstandard/src/main/js/default/test/screenshot.test.js
...indowstandard/src/main/js/default/test/screenshot.test.js
+1
-1
graphic/windowstandard/src/main/js/default/test/window.api.part1.js
...ndowstandard/src/main/js/default/test/window.api.part1.js
+0
-564
graphic/windowstandard/src/main/js/default/test/window.api.part2.js
...ndowstandard/src/main/js/default/test/window.api.part2.js
+0
-1077
graphic/windowstandard/src/main/js/default/test/window.parameter.js
...ndowstandard/src/main/js/default/test/window.parameter.js
+0
-258
graphic/windowstandard/src/main/js/default/test/window.promise.js
...windowstandard/src/main/js/default/test/window.promise.js
+0
-501
graphic/windowstandard/src/main/js/default/test/window.test.js
...ic/windowstandard/src/main/js/default/test/window.test.js
+1844
-144
未找到文件。
graphic/windowstandard/Test.json
浏览文件 @
49dc4c90
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for hjunit demo Tests"
,
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
6
00000"
,
"test-timeout"
:
"
8
00000"
,
"package"
:
"com.test.window"
,
"package"
:
"com.test.window"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
...
...
graphic/windowstandard/src/main/js/default/test/List.test.js
浏览文件 @
49dc4c90
...
@@ -12,10 +12,7 @@
...
@@ -12,10 +12,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
require
(
'
./window.api.part1.js
'
)
require
(
'
./window.api.part2.js
'
)
require
(
'
./window.test.js
'
)
require
(
'
./window.test.js
'
)
require
(
'
./window.parameter.js
'
)
require
(
'
./display.test.js
'
)
require
(
'
./window.promise.js
'
)
require
(
'
./screenshot.test.js
'
)
require
(
'
./screenshot.test.js
'
)
graphic/windowstandard/src/main/js/default/test/display.test.js
0 → 100644
浏览文件 @
49dc4c90
/*
* 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.
*/
import
app
from
'
@system.app
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
window
from
'
@ohos.window
'
import
display
from
'
@ohos.display
'
describe
(
'
display_test
'
,
function
()
{
beforeAll
(
function
()
{
})
beforeEach
(
function
()
{
})
afterEach
(
function
()
{
})
afterAll
(
function
()
{
})
/**
* @tc.number SUB_WMS_GETDEFALUTDISPLAY_JSAPI_001
* @tc.name Test getDefaultDisplay_Test_001
* @tc.desc To test the function of obtaining the default screen
*/
it
(
'
getDefaultDisplay_Test_001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
displayTest getDefaultDisplayTest1 begin
'
)
display
.
getDefaultDisplay
().
then
(
dsp
=>
{
console
.
log
(
'
displayTest getDefaultDisplayTest1 getDefaultDisplay id :
'
+
JSON
.
stringify
(
dsp
))
expect
(
dsp
.
id
!=
null
).
assertTrue
();
expect
(
dsp
.
refreshRate
!=
null
).
assertTrue
();
expect
(
dsp
.
width
!=
null
).
assertTrue
();
expect
(
dsp
.
height
!=
null
).
assertTrue
();
done
();
},
(
err
)
=>
{
console
.
log
(
'
displayTest getDefaultDisplayTest1 getDefaultDisplay failed, err :
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
})
})
/**
* @tc.number SUB_WMS_GETDEFALUTDISPLAY_JSAPI_001
* @tc.name Test getDefaultDisplay_Test_002.
* @tc.desc To test the function if obtaining the default screen.
*/
it
(
'
getDefaultDisplay_Test_002
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
displayTest getDefaultDisplayTest2 begin
'
);
display
.
getDefaultDisplay
((
err
,
data
)
=>
{
if
(
err
.
code
!=
0
)
{
console
.
log
(
'
displayTest getDefaultDisplayTest2 getDefaultDisplay callback fail
'
+
JSON
.
stringify
(
err
.
code
));
expect
().
assertFail
();
done
();
}
else
{
console
.
log
(
'
displayTest getDefaultDisplayTest2 getDefaultDisplay id :
'
+
JSON
.
stringify
(
data
));
expect
(
data
.
id
!=
null
).
assertTrue
();
expect
(
data
.
refreshRate
!=
null
).
assertTrue
();
expect
(
data
.
width
!=
null
).
assertTrue
();
expect
(
data
.
height
!=
null
).
assertTrue
();
done
();
}
})
})
/**
* @tc.number SUB_WMS_GETALLDISPLAY_JSAPI_001
* @tc.name Test getAllDisplay_Test_001.
* @tc.desc To verify the function of obtaining all screens.
*/
it
(
'
getAllDisplay_Test_001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
displayTest getAllDisplayTest1 begin
'
)
display
.
getAllDisplay
().
then
(
dsp
=>
{
console
.
log
(
'
displayTest getAllDisplayTest1 getAllDisplay id :
'
+
JSON
.
stringify
(
dsp
))
expect
(
dsp
[
0
].
id
!=
null
).
assertTrue
();
expect
(
dsp
[
0
].
refreshRate
!=
null
).
assertTrue
();
expect
(
dsp
[
0
].
width
!=
null
).
assertTrue
();
expect
(
dsp
[
0
].
height
!=
null
).
assertTrue
();
done
();
},
(
err
)
=>
{
console
.
log
(
'
displayTest getAllDisplayTest1 getAllDisplay failed, err :
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
})
})
/**
* @tc.number SUB_WMS_GETALLDISPLAY_JSAPI_002
* @tc.name Test getAllDisplay_Test_002
* @tc.desc To test the function if obtaining the default screen
*/
it
(
'
getAllDisplay_Test_002
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
displayTest getAllDisplayTest2 begin
'
);
display
.
getAllDisplay
((
err
,
data
)
=>
{
if
(
err
.
code
!=
0
)
{
console
.
log
(
'
displayTest getAllDisplayTest2 getAllDisplay callback fail
'
);
expect
().
assertFail
();
done
();
}
else
{
console
.
log
(
'
displayTest getAllDisplayTest2 getDefaultDisplay id :
'
+
JSON
.
stringify
(
data
));
expect
(
data
[
0
].
refreshRate
!=
null
).
assertTrue
();
expect
(
data
[
0
].
width
!=
null
).
assertTrue
();
expect
(
data
[
0
].
height
!=
null
).
assertTrue
();
done
();
}
})
})
})
graphic/windowstandard/src/main/js/default/test/screenshot.test.js
浏览文件 @
49dc4c90
...
@@ -405,7 +405,7 @@ describe('screenshot_test', function () {
...
@@ -405,7 +405,7 @@ describe('screenshot_test', function () {
done
();
done
();
},
(
err
)
=>
{
},
(
err
)
=>
{
console
.
log
(
'
screenshotTest screenShotSaveTest10 screenshot.save failed, err :
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
screenshotTest screenShotSaveTest10 screenshot.save failed, err :
'
+
JSON
.
stringify
(
err
));
expect
(
TRUE_FLAG
).
assertFail
();
expect
().
assertFail
();
done
();
done
();
})
})
})
})
...
...
graphic/windowstandard/src/main/js/default/test/window.api.part1.js
已删除
100644 → 0
浏览文件 @
cdacdffb
此差异已折叠。
点击以展开。
graphic/windowstandard/src/main/js/default/test/window.api.part2.js
已删除
100644 → 0
浏览文件 @
cdacdffb
此差异已折叠。
点击以展开。
graphic/windowstandard/src/main/js/default/test/window.parameter.js
已删除
100644 → 0
浏览文件 @
cdacdffb
/*
* 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.
*/
import
app
from
'
@system.app
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
window
from
'
@ohos.window
'
describe
(
'
window_test
'
,
function
(){
var
wnd
;
beforeAll
(
function
(){
})
beforeEach
(
function
(){
})
afterEach
(
function
(){
})
afterAll
(
function
(){
})
/**
* @tc.number SUB_WINDOW_MOVETO_JSAPI_007
* @tc.name Test moveTestNegative.
* @tc.desc Test window.moveTo API function test7.
*/
it
(
'
moveTestNegative
'
,
0
,
function
(){
console
.
log
(
'
jsunittest moveTestNegative begin
'
)
window
.
getTopWindow
().
then
(
wnd
=>
{
console
.
log
(
'
jsunittest moveTestNegative getTopWindow wnd:
'
+
wnd
)
wnd
.
moveTo
(
-
200
,
-
200
).
then
(()
=>
{
console
.
log
(
'
moveTo(-200,-200) success
'
)
})
wnd
.
moveTo
(
0
,
0
).
then
(()
=>
{
console
.
log
(
'
moveTo(0,0) success
'
)
})
})
})
/**
* @tc.number SUB_WINDOW_RESETSIZE_JSAPI_006
* @tc.name Test resetSizeTestLoop.
* @tc.desc Test window.resetSize API function test6.
*/
it
(
'
resetSizeLoop
'
,
0
,
function
(){
var
width
=
100
;
var
height
=
100
;
console
.
log
(
'
jsunittest resetSizeLoop begin
'
)
window
.
getTopWindow
().
then
(
wnd
=>
{
console
.
log
(
'
jsunittest resetSizeLoop getTopWindow wnd:
'
+
wnd
)
for
(
let
i
=
1
;
i
<=
5
;
i
++
){
width
=
width
*
i
;
height
=
height
*
i
;
wnd
.
resetSize
(
width
,
height
).
then
(()
=>
{
console
.
log
(
'
jsunittest resetSizeTestLoop success
'
)
})
}
wnd
.
resetSize
(
0
,
0
).
then
(()
=>
{
console
.
log
(
'
jsunittest resetSizeTsetLoop wnd.resetSize(0,0) success
'
)
})
})
})
/**
* @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_008
* @tc.name Test setWindowTypeTestZero.
* @tc.desc Test window.setWindowType API function test8.
*/
it
(
'
setWindowTypeTestZero
'
,
0
,
function
(){
console
.
log
(
'
jsunittest setWindowTypeTestZero begin
'
)
window
.
getTopWindow
().
then
(
wnd
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestZero getTopWindow wnd:
'
+
wnd
)
wnd
.
setWindowType
(
window
.
WindowType
.
TYPE_APP
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestZero wnd.setWindowType(0) success
'
)
})
wnd
.
moveTo
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestZero wnd.moveTo(200,200) success
'
)
})
wnd
.
resetSize
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestZero wnd.resetSize(200,200) success
'
)
})
})
})
/**
* @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_009
* @tc.name Test setWindowTypeTestThirty.
* @tc.desc Test window.setWindowType API function test9.
*/
it
(
'
setWindowTypeTestThirty
'
,
0
,
function
(){
console
.
log
(
'
jsunittest setWindowTypeTestThirty begin
'
)
window
.
getTopWindow
().
then
(
wnd
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestThirty getTopWindow wnd:
'
+
wnd
)
wnd
.
setWindowType
(
window
.
WindowType
.
TYPE_SYSTEM_ALTER
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestThirty wnd.setWindowType(30) success
'
)
})
wnd
.
moveTo
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestThirty wnd.moveTo(200, 200) success
'
)
})
wnd
.
resetSize
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestThirty wnd.resetSize(200, 200) success
'
)
})
})
})
/**
* @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_010
* @tc.name Test setWindowTypeTestSeventy.
* @tc.desc Test window.setWindowType API function test10.
*/
it
(
'
setWindowTypeTestSeventy
'
,
0
,
function
(){
console
.
log
(
'
jsunittest setWindowTypeTestSeventy begin
'
)
window
.
getTopWindow
().
then
(
wnd
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestSeventy getTopWindow wnd:
'
+
wnd
)
wnd
.
setWindowType
(
window
.
WindowType
.
TYPE_SYSTEM_VOLUME
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestSeventy wnd.setWindowType(70) success
'
)
})
wnd
.
moveTo
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestSeventy wnd.moveTo(200, 200) success
'
)
})
wnd
.
resetSize
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestSeventy wnd.resetSize(200, 200) success
'
)
})
})
})
/**
* @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_012
* @tc.name Test setWindowTypeTestNinety.
* @tc.desc Test window.setWindowType API function test12.
*/
it
(
'
setWindowTypeTestNinety
'
,
0
,
function
(){
console
.
log
(
'
jsunittest setWindowTypeTestNinety begin
'
)
window
.
getTopWindow
().
then
(
wnd
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestNinety getTopWindow wnd:
'
+
wnd
)
wnd
.
setWindowType
(
window
.
WindowType
.
TYPE_SYSTEM_PANEL
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestNinety wnd.setWindowType(90) success
'
)
})
wnd
.
moveTo
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestNinety wnd.moveTo(200, 200) success
'
)
})
wnd
.
resetSize
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestNinety wnd.resetSize(200, 200) success
'
)
})
})
})
/**
* @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_011
* @tc.name Test setWindowTypeTestOrderChange.
* @tc.desc Test window.setWindowType API function test11.
*/
it
(
'
setWindowTypeTestOrderChange
'
,
0
,
function
(){
console
.
log
(
'
jsunittest setWindowTypeTestOrderChange begin
'
)
window
.
getTopWindow
().
then
(
wnd
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestOrderChange getTopWindow wnd:
'
+
wnd
)
wnd
.
setWindowType
(
window
.
WindowType
.
TYPE_APP
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestOrderChange wnd.setWindowType(0) success
'
)
})
wnd
.
resetSize
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestOrderChange wnd.resetSize(200, 200) success
'
)
})
wnd
.
moveTo
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTestOrderChange wnd.moveTo(200, 200) success
'
)
})
})
})
/**
* @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_013
* @tc.name Test setWindowTypeTest15.
* @tc.desc Test window.setWindowType API function test13.
*/
it
(
'
setWindowTypeTest15
'
,
0
,
function
(){
console
.
log
(
'
jsunittest setWindowTypeTest15 begin
'
)
window
.
getTopWindow
().
then
(
wnd
=>
{
console
.
log
(
'
jsunittest setWindowTypeTest15 getTopWindow wnd:
'
+
wnd
)
wnd
.
setWindowType
(
window
.
WindowType
.
TYPE_SYSTEM_ALTER
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTest15 wnd.setWindowType(30) success
'
)
})
wnd
.
resetSize
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTest15 wnd.resetSize(200, 200) success
'
)
})
wnd
.
moveTo
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTest15 wnd.moveTo(200, 200) success
'
)
})
})
})
/**
* @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_014
* @tc.name Test setWindowTypeTest16.
* @tc.desc Test window.setWindowType API function test14.
*/
it
(
'
setWindowTypeTest16
'
,
0
,
function
(){
console
.
log
(
'
jsunittest setWindowTypeTest16 begin
'
)
window
.
getTopWindow
().
then
(
wnd
=>
{
console
.
log
(
'
jsunittest setWindowTypeTest16 getTopWindow wnd:
'
+
wnd
)
wnd
.
setWindowType
(
window
.
WindowType
.
TYPE_SYSTEM_VOLUME
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTest16 wnd.setWindowType(70) success
'
)
})
wnd
.
resetSize
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTest16 wnd.resetSize(200, 200) success
'
)
})
wnd
.
moveTo
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTest16 wnd.moveTo(200, 200) success
'
)
})
})
})
/**
* @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_015
* @tc.name Test setWindowTypeTest17.
* @tc.desc Test window.setWindowType API function test15.
*/
it
(
'
setWindowTypeTest17
'
,
0
,
function
(){
console
.
log
(
'
jsunittest setWindowTypeTest17 begin
'
)
window
.
getTopWindow
().
then
(
wnd
=>
{
console
.
log
(
'
jsunittest setWindowTypeTest17 getTopWindow wnd:
'
+
wnd
)
wnd
.
setWindowType
(
window
.
WindowType
.
TYPE_SYSTEM_PANEL
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTest17 wnd.setWindowType(90) success
'
)
})
wnd
.
resetSize
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTest17 wnd.resetSize(200, 200) success
'
)
})
wnd
.
moveTo
(
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest setWindowTypeTest17 wnd.moveTo(200, 200) success
'
)
})
})
})
/**
* @tc.number SUB_WINDOW_MOVETO_JSAPI_006
* @tc.name Test moveTest6.
* @tc.desc Test window.moveTo API function test6.
*/
it
(
'
moveTest6
'
,
0
,
function
(){
console
.
log
(
'
jsunittest moveTest6 begin
'
)
window
.
getTopWindow
().
then
(
wnd
=>
{
console
.
log
(
'
jsunittest moveTest6 getTopWindow wnd:
'
+
wnd
)
wnd
.
moveTo
(
-
200
,
200
).
then
(()
=>
{
console
.
log
(
'
jsunittest moveTest6 wnd.moveTo(-200, 300) success
'
)
})
wnd
.
moveTo
(
200
,
-
300
).
then
(()
=>
{
console
.
log
(
'
jsunittest moveTest6 wnd.moveTo(200, -300) success
'
)
})
})
})
})
\ No newline at end of file
graphic/windowstandard/src/main/js/default/test/window.promise.js
已删除
100644 → 0
浏览文件 @
cdacdffb
此差异已折叠。
点击以展开。
graphic/windowstandard/src/main/js/default/test/window.test.js
浏览文件 @
49dc4c90
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录