未验证 提交 479640ff 编写于 作者: O openharmony_ci 提交者: Gitee

!5374 多模子系统新增api覆盖属性pointer接口用例

Merge pull request !5374 from 岳鑫瑶/master
......@@ -31,20 +31,20 @@ describe('MultimodalInput_Pointer_test', function () {
console.info(`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 enter`);
var callback = function (err, data) {
if (err) {
this.log(`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 failed, err=${JSON.stringify(err)}`);
console.info(`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 failed, err=${JSON.stringify(err)}`);
expect(false).assertTrue();
} else {
this.log(`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 success`);
console.info(`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 success`);
expect(true).assertTure();
}
};
pointer.setPointerVisible(false, callback);
pointer.isPointerVisible().then(data => {
this.log(`MultimodalInput_Pointer_test::PointerVisibleTest_001 success, data=${JSON.stringify(data)}`);
console.info(`MultimodalInput_Pointer_test::PointerVisibleTest_001 success, data=${JSON.stringify(data)}`);
expect(data == false).assertTrue();
}, data => {
this.log(`MultimodalInput_Pointer_test::PointerVisibleTest_001 failed, err=${JSON.stringify(data)}`);
console.info(`MultimodalInput_Pointer_test::PointerVisibleTest_001 failed, err=${JSON.stringify(data)}`);
expect(false).assertTrue();
});
console.info(`MultimodalInput_Pointer_test::PointerVisibleTest_001 exit`);
......@@ -53,19 +53,19 @@ describe('MultimodalInput_Pointer_test', function () {
it('MultimodalInput_Pointer_test::PointerVisibleTest_002', 0, function () {
console.info(`MultimodalInput_Pointer_test::PointerVisibleTest_002 enter`);
pointer.setPointerVisible(true).then(data => {
this.log(`MultimodalInput_Pointer_test::PointerVisibleTest_002 success, data=${JSON.stringify(data)}`);
console.info(`MultimodalInput_Pointer_test::PointerVisibleTest_002 success, data=${JSON.stringify(data)}`);
expect(true).assertTrue();
}, data => {
this.log(`MultimodalInput_Pointer_test::PointerVisibleTest_002 failed, err=${JSON.stringify(data)}`);
console.info(`MultimodalInput_Pointer_test::PointerVisibleTest_002 failed, err=${JSON.stringify(data)}`);
expect(false).assertTure();
});
var callback = function (err, data) {
if (err) {
this.log(`MultimodalInput_Pointer_test::PointerVisibleTest_002 failed, err=${JSON.stringify(err)}`);
console.info(`MultimodalInput_Pointer_test::PointerVisibleTest_002 failed, err=${JSON.stringify(err)}`);
expect(false).assertTrue();
} else {
this.log(`MultimodalInput_Pointer_test::PointerVisibleTest_002 success, data=${JSON.stringify(data)}`);
console.info(`MultimodalInput_Pointer_test::PointerVisibleTest_002 success, data=${JSON.stringify(data)}`);
expect(data == true).assertTrue();
}
};
......@@ -77,19 +77,19 @@ describe('MultimodalInput_Pointer_test', function () {
console.info(`SetPointerStyle_001 enter`);
window.getTopWindow((err, data) => {
if (err) {
this.log(`SetPointerStyle_001 failed, err=${JSON.stringify(err)}`);
console.info(`SetPointerStyle_001 failed, err=${JSON.stringify(err)}`);
expect(false).assertTrue();
}
var windowClass = data;
windowClass.getProperties((err, data) => {
if (err) {
this.log(`SetPointerStyle_001 failed, err=${JSON.stringify(err)}`);
console.info(`SetPointerStyle_001 failed, err=${JSON.stringify(err)}`);
expect(false).assertTrue();
}
var windowId = data.id;
pointer.setPointerStyle(windowId, 4).then(() => {
expect(true).assertTrue();
this.log(`SetPointerStyle_001 success`);
console.info(`SetPointerStyle_001 success`);
}).catch((err) => {
expect(false).assertTure();
console.info("promise::catch", err);
......@@ -103,21 +103,21 @@ describe('MultimodalInput_Pointer_test', function () {
window.getTopWindow((err, data) => {
var windowClass = data;
if (err) {
this.log(`SetPointerStyle_002 failed, err=${JSON.stringify(err)}`);
console.info(`SetPointerStyle_002 failed, err=${JSON.stringify(err)}`);
expect(false).assertTrue();
}
windowClass.getProperties((err, data) => {
if (err) {
this.log(`SetPointerStyle_002 failed, err=${JSON.stringify(err)}`);
console.info(`SetPointerStyle_002 failed, err=${JSON.stringify(err)}`);
expect(false).assertTrue();
}
var windowId = data.id;
pointer.setPointerStyle(windowId, 4, (err) => {
if (err) {
this.log(`SetPointerStyle_002 failed, err=${JSON.stringify(err)}`);
console.info(`SetPointerStyle_002 failed, err=${JSON.stringify(err)}`);
expect(false).assertTrue();
} else {
this.log(`SetPointerStyle_002 success`);
console.info(`SetPointerStyle_002 success`);
expect(true).assertTrue();
}
});
......@@ -129,18 +129,18 @@ describe('MultimodalInput_Pointer_test', function () {
console.info(`GetPointerStyle_001 enter`);
window.getTopWindow((err, data) => {
if (err) {
this.log(`GetPointerStyle_001 failed, err=${JSON.stringify(err)}`);
console.info(`GetPointerStyle_001 failed, err=${JSON.stringify(err)}`);
expect(false).assertTrue();
}
var windowClass = data;
windowClass.getProperties((err, data) => {
if (err) {
this.log(`GetPointerStyle_001 failed, err=${JSON.stringify(err)}`);
console.info(`GetPointerStyle_001 failed, err=${JSON.stringify(err)}`);
expect(false).assertTrue();
}
var windowId = data.id;
pointer.getPointerStyle(windowId).then((data) => {
this.log(`GetPointerStyle_001 success, data=${JSON.stringify(data)}`);
console.info(`GetPointerStyle_001 success, data=${JSON.stringify(data)}`);
expect(data).assertTrue('Number');
}).catch((err) => {
console.info("promise::catch", err);
......@@ -154,26 +154,143 @@ describe('MultimodalInput_Pointer_test', function () {
console.info(`GetPointerStyle_002 enter`);
window.getTopWindow((err, data) => {
if (err) {
this.log(`GetPointerStyle_002 failed, err=${JSON.stringify(err)}`);
console.info(`GetPointerStyle_002 failed, err=${JSON.stringify(err)}`);
expect(false).assertTrue();
}
var windowClass = data;
windowClass.getProperties((err, data) => {
if (err) {
this.log(`GetPointerStyle_002 failed, err=${JSON.stringify(err)}`);
console.info(`GetPointerStyle_002 failed, err=${JSON.stringify(err)}`);
expect(false).assertTrue();
}
var windowId = data.id;
pointer.getPointerStyle(windowId, (err, data) => {
if (err) {
this.log(`GetPointerStyle_002 failed, err=${JSON.stringify(err)}`);
console.info(`GetPointerStyle_002 failed, err=${JSON.stringify(err)}`);
expect(false).assertTrue();
} else {
this.log(`GetPointerStyle_002 success, data=${JSON.stringify(data)}`);
console.info(`GetPointerStyle_002 success, data=${JSON.stringify(data)}`);
expect(data).assertTrue('Number');
}
});
})
})
})
it('MultimodalInput_Pointer_test::Pointer_PointerStyle_test', 0, function () {
console.info('MultimodalInput_Pointer_test::Pointer_PointerStyle_test = ' + pointer.PointerStyle.DEFAULT);
expect(pointer.PointerStyle.DEFAULT == 0).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_EAST_test = ' + pointer.PointerStyle.EAST);
expect(pointer.PointerStyle.EAST == 1).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_WEST_test = ' + pointer.PointerStyle.WEST);
expect(pointer.PointerStyle.WEST == 2).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_SOUTH_test = ' + pointer.PointerStyle.SOUTH);
expect(pointer.PointerStyle.SOUTH == 3).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_NORTH_test = ' + pointer.PointerStyle.NORTH);
expect(pointer.PointerStyle.NORTH == 4).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_WEST_EAST_test = ' + pointer.PointerStyle.WEST_EAST);
expect(pointer.PointerStyle.WEST_EAST == 5).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_NORTH_SOUTH_test = ' + pointer.PointerStyle.NORTH_SOUTH);
expect(pointer.PointerStyle.NORTH_SOUTH == 6).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_NORTH_EAST_test = ' + pointer.PointerStyle.NORTH_EAST);
expect(pointer.PointerStyle.NORTH_EAST == 7).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_NORTH_WEST_test = ' + pointer.PointerStyle.NORTH_WEST);
expect(pointer.PointerStyle.NORTH_WEST == 8).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_SOUTH_EAST_test = ' + pointer.PointerStyle.SOUTH_EAST);
expect(pointer.PointerStyle.SOUTH_EAST == 9).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_SOUTH_WEST_test = ' + pointer.PointerStyle.SOUTH_WEST);
expect(pointer.PointerStyle.SOUTH_WEST == 10).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_NORTH_EAST_SOUTH_WEST_test = ' + pointer.PointerStyle.NORTH_EAST_SOUTH_WEST);
expect(pointer.PointerStyle.NORTH_EAST_SOUTH_WEST == 11).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_NORTH_WEST_SOUTH_EAST_test = ' + pointer.PointerStyle.NORTH_WEST_SOUTH_EAST);
expect(pointer.PointerStyle.NORTH_WEST_SOUTH_EAST == 12).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_CROSS_test = ' + pointer.PointerStyle.CROSS);
expect(pointer.PointerStyle.CROSS == 13).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_CURSOR_COPY_test = ' + pointer.PointerStyle.CURSOR_COPY);
expect(pointer.PointerStyle.CURSOR_COPY == 14).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_CURSOR_FORBID_test = ' + pointer.PointerStyle.CURSOR_FORBID);
expect(pointer.PointerStyle.CURSOR_FORBID == 15).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_COLOR_SUCKER_test = ' + pointer.PointerStyle.COLOR_SUCKER);
expect(pointer.PointerStyle.COLOR_SUCKER == 16).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_HAND_GRABBING_test = ' + pointer.PointerStyle.HAND_GRABBING);
expect(pointer.PointerStyle.HAND_GRABBING == 17).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_HAND_OPEN_test = ' + pointer.PointerStyle.HAND_OPEN);
expect(pointer.PointerStyle.HAND_OPEN == 18).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_HAND_POINTING_test = ' + pointer.PointerStyle.HAND_POINTING);
expect(pointer.PointerStyle.HAND_POINTING == 19).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_HELP_test = ' + pointer.PointerStyle.HELP);
expect(pointer.PointerStyle.HELP == 20).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_RESIZE_UP_DOWN_test = ' + pointer.PointerStyle.RESIZE_UP_DOWN);
expect(pointer.PointerStyle.RESIZE_UP_DOWN == 22).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_RESIZE_LEFT_RIGHT_test = ' + pointer.PointerStyle.RESIZE_LEFT_RIGHT);
expect(pointer.PointerStyle.RESIZE_LEFT_RIGHT == 23).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_SCREENSHOT_CHOOSE_test = ' + pointer.PointerStyle.SCREENSHOT_CHOOSE);
expect(pointer.PointerStyle.SCREENSHOT_CHOOSE == 24).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_SCREENSHOT_CURSOR_test = ' + pointer.PointerStyle.SCREENSHOT_CURSOR);
expect(pointer.PointerStyle.SCREENSHOT_CURSOR == 25).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_TEXT_CURSOR_test = ' + pointer.PointerStyle.TEXT_CURSOR);
expect(pointer.PointerStyle.TEXT_CURSOR == 26).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_ZOOM_IN_test = ' + pointer.PointerStyle.ZOOM_IN);
expect(pointer.PointerStyle.ZOOM_IN == 27).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_ZOOM_OUT_test = ' + pointer.PointerStyle.ZOOM_OUT);
expect(pointer.PointerStyle.ZOOM_OUT == 28).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_EAST_test = ' + pointer.PointerStyle.MIDDLE_BTN_EAST);
expect(pointer.PointerStyle.MIDDLE_BTN_EAST == 29).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_WEST_test = ' + pointer.PointerStyle.MIDDLE_BTN_WEST);
expect(pointer.PointerStyle.MIDDLE_BTN_WEST == 30).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_SOUTH_test = ' + pointer.PointerStyle.MIDDLE_BTN_SOUTH);
expect(pointer.PointerStyle.MIDDLE_BTN_SOUTH == 31).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_NORTH_test = ' + pointer.PointerStyle.MIDDLE_BTN_NORTH);
expect(pointer.PointerStyle.MIDDLE_BTN_NORTH == 32).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_NORTH_SOUTH_test = ' + pointer.PointerStyle.MIDDLE_BTN_NORTH_SOUTH);
expect(pointer.PointerStyle.MIDDLE_BTN_NORTH_SOUTH == 33).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_NORTH_EAST_test = ' + pointer.PointerStyle.MIDDLE_BTN_NORTH_EAST);
expect(pointer.PointerStyle.MIDDLE_BTN_NORTH_EAST == 34).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_NORTH_WEST_test = ' + pointer.PointerStyle.MIDDLE_BTN_NORTH_WEST);
expect(pointer.PointerStyle.MIDDLE_BTN_NORTH_WEST == 35).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_SOUTH_EAST_test = ' + pointer.PointerStyle.MIDDLE_BTN_SOUTH_EAST);
expect(pointer.PointerStyle.MIDDLE_BTN_SOUTH_EAST == 36).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_SOUTH_WEST_test = ' + pointer.PointerStyle.MIDDLE_BTN_SOUTH_WEST);
expect(pointer.PointerStyle.MIDDLE_BTN_SOUTH_WEST == 37).assertTrue();
console.info('MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_NORTH_SOUTH_WEST_EAST_test = ' + pointer.PointerStyle.MIDDLE_BTN_NORTH_SOUTH_WEST_EAST);
expect(pointer.PointerStyle.MIDDLE_BTN_NORTH_SOUTH_WEST_EAST == 38).assertTrue();
})
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册