Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f7bf57ef
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看板
提交
f7bf57ef
编写于
7月 05, 2022
作者:
L
lanyill
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
差值曲线XTS用例
Signed-off-by:
N
lanyill
<
lanyi3@huawei.com
>
Change-Id: I99d14322073f55823d38c2d9ff46ad8352ce577f
上级
d52873fc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
108 deletion
+30
-108
arkui/ace_ets_curves/entry/src/main/ets/test/CurveJsunit.test.ets
...e_ets_curves/entry/src/main/ets/test/CurveJsunit.test.ets
+30
-108
未找到文件。
arkui/ace_ets_curves/entry/src/main/ets/test/CurveJsunit.test.ets
浏览文件 @
f7bf57ef
...
...
@@ -16,87 +16,9 @@
//import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"
////import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index";
//import events_emitter from '@ohos.events.emitter';
//
//
//export default function CurveJsunit() {
// describe('CurveTest', function () {
//// beforeEach(async function (done) {
//// console.info("curve beforeEach start");
//// let options = {
//// uri: 'pages/curve',
//// }
//// try {
//// router.clear();
//// let pages = router.getState();
//// console.info("get curve state pages:" + JSON.stringify(pages));
//// if (!("curve" == pages.name)) {
//// console.info("get curve state pages.name:" + JSON.stringify(pages.name));
//// let result = await router.push(options);
//// await Utils.sleep(2000);
//// console.info("push curve page result:" + JSON.stringify(result));
//// }
//// } catch (err) {
//// console.error("push curve page error:" + err);
//// }
//// done()
//// });
////
//// afterEach(async function () {
//// await Utils.sleep(1000);
//// console.info("curve after each called");
//// });
//
// it('testcurve01', 0, async function (done) {
// console.info('LANYI [testcurve01] START');
// try {
// var eventData = {
// data: {
// heightSize:88.88888955116272,
// widthSize: 88.88888955116272,
// }
// }
// var innerEvent = {
// eventId: 8,
// priority: events_emitter.EventPriority.LOW
// }
// console.info("LANYI [testcurve01] start to publish emit");
// events_emitter.emit(innerEvent, eventData);
// } catch (err) {
// console.log("LANYI [testcurve01] change component data error: " + err.message);
// }
// await Utils.sleep(1000);
//// // let strJson = getInspectorByKey('curve');
//// let obj = JSON.parse(strJson);
// console.info("LANYI [testcurve01] sendEventByKey result is: " + JSON.stringify(sendEventByKey('curve', 10, "")));
// expect(globalThis.widthSize).assertEqual(88.88888955116272);
// expect(globalThis.heightSize).assertEqual(88.88888955116272);
// console.info('LANYI testcurve01 END');
// done();
// });
//
// })
//}
import router from '@ohos.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"
//export default function CurveJsunit() {
// describe('CurveTest', function () {
// async function sleep(time) {
// return new Promise((resolve, reject) => {
// setTimeout(() => {
// resolve()
// console.info('curve ***** setTime ');
//
// }, time)
// }).then(() => {
// console.info( `sleep ${time} over...`)
// console.info('curve ***** then ');
// })
// }
export default function CurveJsunit() {
describe('CurveTest', function () {
beforeEach(async function (done) {
...
...
@@ -127,37 +49,37 @@ export default function CurveJsunit() {
it
(
'testcurve01'
,
0
,
async
function
(
done
)
{
console
.
info
(
'curve testcurve01 START'
);
var
result_height
;
var
result_width
;
var
control
;
it('testcurve01', 0, async function (done) {
console.info('curve testcurve01 START');
var result_height;
var result_width;
var control;
control
=
JSON
.
stringify
(
sendEventByKey
(
'curve'
,
10
,
""
));
console
.
info
(
"curve sendEventByKey result is: "
+
control
);
setTimeout
(()
=>
{
if
(
control
)
{
result_height
=
globalThis
.
widthSize
;
console
.
info
(
'curve ***** globalThis widthSize is '
+
globalThis
.
widthSize
);
result_width
=
globalThis
.
heightSize
;
console
.
info
(
'curve ***** globalThis heightSize is '
+
globalThis
.
heightSize
);
}
else
{
console
.
error
(
'control failed'
);
}
console
.
info
(
'curve ***** result_height is '
+
result_height
);
console
.
info
(
'curve ***** result_width is '
+
result_width
);
var
finalRes
;
if
((
result_height
==
44.44444477558136
)
&&
(
result_width
==
44.44444477558136
)){
finalRes
=
true
;
console
.
info
(
'curve SurfaceChangedTest success'
);
}
else
{
finalRes
=
false
;
console
.
error
(
'curve SurfaceChangedTest fail'
);
}
expect
(
finalRes
)
.
assertEqual
(
true
);
done
();
},
3000
)
});
control =JSON.stringify(sendEventByKey('curve', 10, ""));
console.info("curve sendEventByKey result is: " + control);
setTimeout(() => {
if (control) {
result_height = globalThis.widthSize;
console.info('curve ***** globalThis widthSize is ' + globalThis.widthSize);
result_width = globalThis.heightSize;
console.info('curve ***** globalThis heightSize is ' + globalThis.heightSize);
} else {
console.error('control failed');
}
console.info('curve ***** result_height is ' + result_height);
console.info('curve ***** result_width is ' + result_width);
var finalRes;
if ((result_height == 44.44444477558136) && (result_width == 44.44444477558136)){
finalRes = true;
console.info('curve SurfaceChangedTest success');
} else {
finalRes = false;
console.error('curve SurfaceChangedTest fail');
}
expect(finalRes).assertEqual(true);
done();
}, 3000)
});
it('testcurve02', 0, async function (done) {
console.info('curve testcurve02 START');
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录