Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
03141208
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看板
未验证
提交
03141208
编写于
8月 21, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5062 【窗口子系统】add interface case
Merge pull request !5062 from hekun/master
上级
815ffeb6
9e7320cb
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
659 addition
and
1 deletion
+659
-1
graphic/windowstandard/src/main/js/test/display.test.js
graphic/windowstandard/src/main/js/test/display.test.js
+184
-0
graphic/windowstandard/src/main/js/test/window.test.js
graphic/windowstandard/src/main/js/test/window.test.js
+475
-1
未找到文件。
graphic/windowstandard/src/main/js/test/display.test.js
浏览文件 @
03141208
...
...
@@ -206,5 +206,189 @@ describe('display_test', function () {
}
})
/**
* @tc.number SUB_WMS_WATERFALLDISPLAYAREARECTS_JSAPI_001
* @tc.name Test waterfallDisplayAreaRects_Test_001.
* @tc.desc To test value of waterfallDisplayAreaRects.
*/
it
(
'
waterfallDisplayAreaRects_Test_001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
test the value of waterfallDisplayAreaRects begin
'
);
try
{
var
waterfallDisplayAreaRects
=
{
left
:
{
left
:
20
,
top
:
20
,
width
:
20
,
height
:
20
},
right
:
{
left
:
800
,
top
:
0
,
width
:
600
,
height
:
600
},
top
:
{
left
:
20
,
top
:
20
,
width
:
20
,
height
:
20
},
bottom
:
{
left
:
20
,
top
:
20
,
width
:
600
,
height
:
600
},
}
expect
(
waterfallDisplayAreaRects
.
left
!=
null
).
assertTrue
();
expect
(
waterfallDisplayAreaRects
.
right
!=
null
).
assertTrue
();
expect
(
waterfallDisplayAreaRects
.
top
!=
null
).
assertTrue
();
expect
(
waterfallDisplayAreaRects
.
bottom
!=
null
).
assertTrue
();
done
();
}
catch
(
err
)
{
console
.
error
(
'
test value of waterfallDisplayAreaRects error
'
+
JSON
.
stringify
(
err
));
expect
.
assertFail
();
done
();
}
})
/**
* @tc.number SUB_WMS_RECT_JSAPI_001
* @tc.name Test RECT_Test_001.
* @tc.desc To test value of RECT.
*/
it
(
'
displayAreaRects_Test_001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
test the value of aRect begin
'
);
try
{
var
rect
=
{
left
:
20
,
right
:
40
,
width
:
100
,
height
:
200
}
expect
(
20
).
assertEqual
(
rect
.
left
);
expect
(
40
).
assertEqual
(
rect
.
right
);
expect
(
100
).
assertEqual
(
rect
.
width
);
expect
(
200
).
assertEqual
(
rect
.
height
);
done
();
}
catch
(
err
)
{
console
.
error
(
'
test value of rect error
'
+
JSON
.
stringify
(
err
));
expect
.
assertFail
();
done
();
}
})
/**
* @tc.number SUB_WMS_CutoutInfo_JSAPI_001
* @tc.name Test CutoutInfo_Test_001.
* @tc.desc To test value of CutoutInfo.
*/
it
(
'
CutoutInfo_Test_001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
test the CutoutInfo of aRect begin
'
);
try
{
var
cutoutInfo
=
{
boudingRects
:
[{
left
:
20
,
right
:
40
,
width
:
100
,
height
:
200
}],
waterfallDisplayAreaRects
:
{
left
:
{
left
:
20
,
top
:
20
,
width
:
20
,
height
:
20
},
right
:
{
left
:
800
,
top
:
0
,
width
:
600
,
height
:
600
},
top
:
{
left
:
20
,
top
:
20
,
width
:
20
,
height
:
20
},
bottom
:
{
left
:
20
,
top
:
20
,
width
:
600
,
height
:
600
},
}
}
expect
(
1
).
assertEqual
(
cutoutInfo
.
boudingRects
.
length
);
expect
(
cutoutInfo
.
waterfallDisplayAreaRects
.
left
!=
null
).
assertTrue
();
expect
(
cutoutInfo
.
waterfallDisplayAreaRects
.
right
!=
null
).
assertTrue
();
expect
(
cutoutInfo
.
waterfallDisplayAreaRects
.
top
!=
null
).
assertTrue
();
expect
(
cutoutInfo
.
waterfallDisplayAreaRects
.
bottom
!=
null
).
assertTrue
();
done
();
}
catch
(
err
)
{
console
.
error
(
'
test value of CutoutInfo error
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
})
/**
* @tc.number SUB_WMS_GETDISPLAYCUtOUTINFO_JSAPI_001
* @tc.name Test getDisplayCutoutInfo_Test_001
* @tc.desc To test the function of getCutoutInfo
*/
it
(
'
getDisplayCutoutInfo_Test_001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
getCutoutInfo begin
'
);
display
.
getDefaultDisplay
().
then
(
dsp
=>
{
console
.
info
(
'
displayTest getCutoutInfo getDefaultDisplay id :
'
+
JSON
.
stringify
(
dsp
));
expect
(
dsp
!=
null
).
assertTrue
();
dsp
.
getCutoutInfo
((
err
,
data
)
=>
{
console
.
info
(
'
Succeeded in getting cutoutInfo. data:
'
+
JSON
.
stringify
(
data
));
if
(
err
.
code
)
{
console
.
error
(
'
Failed to get cutoutInfo. Cause:
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
else
{
console
.
error
(
'
success to get cutoutInfo. Cause:
'
+
JSON
.
stringify
(
err
));
expect
(
data
!=
null
).
assertTrue
();
done
();
}
})
},
(
err
)
=>
{
console
.
log
(
'
displayTest getgetCutoutInfo getDefaultDisplay failed, err :
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
})
})
/**
* @tc.number SUB_WMS_GETDISPLAYCUtOUTINFO_JSAPI_002
* @tc.name Test getDisplayCutoutInfo_Test_002
* @tc.desc To test the function of getCutoutInfo
*/
it
(
'
getDisplayCutoutInfo_Test_002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
getCutoutInfo begin
'
);
display
.
getDefaultDisplay
().
then
(
dsp
=>
{
console
.
info
(
'
displayTest getCutoutInfo getDefaultDisplay id2 :
'
+
JSON
.
stringify
(
dsp
));
expect
(
dsp
!=
null
).
assertTrue
();
dsp
.
getCutoutInfo
().
then
(
data
=>
{
console
.
info
(
'
Succeeded in getting cutoutInfo2. data:
'
+
JSON
.
stringify
(
data
));
expect
(
data
!=
null
).
assertTrue
();
done
();
}
,
err
=>
{
console
.
log
(
'
displayTest getCutoutInfo getDefaultDisplay id2 failed, err :
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
})
},
(
err
)
=>
{
console
.
log
(
'
displayTest getgetCutoutInfo getDefaultDisplay failed, err :
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
})
})
})
}
graphic/windowstandard/src/main/js/test/window.test.js
浏览文件 @
03141208
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录