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

!7697 多模子系统pointer 5条case添加canIUse判断调用

Merge pull request !7697 from 岳鑫瑶/monthly_20221018
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* 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.
*/ */
import pointer from '@ohos.multimodalInput.pointer' import pointer from '@ohos.multimodalInput.pointer'
import window from '@ohos.window' import window from '@ohos.window'
...@@ -65,6 +65,9 @@ export default function Pointer_test() { ...@@ -65,6 +65,9 @@ export default function Pointer_test() {
it('Pointer_PointerVisibleTest_002', 0, async function (done) { it('Pointer_PointerVisibleTest_002', 0, async function (done) {
console.info(`Pointer_PointerVisibleTest_002 enter`); console.info(`Pointer_PointerVisibleTest_002 enter`);
var result = canIUse("SystemCapability.MultimodalInput.Input.Pointer");
console.info('Pointer_PointerVisibleTest_002 segregate result=' + result);
if (result) {
try { try {
await pointer.setPointerVisible(true).then(data => { await pointer.setPointerVisible(true).then(data => {
console.info(`Pointer_PointerVisibleTest_002 success_1, data=${JSON.stringify(data)}`); console.info(`Pointer_PointerVisibleTest_002 success_1, data=${JSON.stringify(data)}`);
...@@ -92,6 +95,11 @@ export default function Pointer_test() { ...@@ -92,6 +95,11 @@ export default function Pointer_test() {
console.info(`Pointer_PointerVisibleTest_002 error`); console.info(`Pointer_PointerVisibleTest_002 error`);
expect(false).assertTrue(); expect(false).assertTrue();
} }
} else {
expect(true).assertTrue();
console.info('Pointer_PointerVisibleTest_002 SystemCapability.MultimodalInput.Input.Pointer segregate');
done();
}
console.info(`Pointer_PointerVisibleTest_002 exit`); console.info(`Pointer_PointerVisibleTest_002 exit`);
}) })
...@@ -122,6 +130,9 @@ export default function Pointer_test() { ...@@ -122,6 +130,9 @@ export default function Pointer_test() {
}) })
}) })
} }
var result = canIUse("SystemCapability.MultimodalInput.Input.Pointer");
console.info('Pointer_SetPointerStyle_001 segregate result=' + result);
if (result) {
window.getTopWindow(async (err, data) => { window.getTopWindow(async (err, data) => {
console.info(`case:SetPointerStyle_001 enter`); console.info(`case:SetPointerStyle_001 enter`);
var windowClass = data; var windowClass = data;
...@@ -134,9 +145,13 @@ export default function Pointer_test() { ...@@ -134,9 +145,13 @@ export default function Pointer_test() {
console.info(`case:SetPointerStyle_001 exit`); console.info(`case:SetPointerStyle_001 exit`);
done(); done();
}) })
} else {
expect(true).assertTrue();
console.info('Pointer_SetPointerStyle_001 SystemCapability.MultimodalInput.Input.Pointer segregate');
done();
}
}) })
it('Pointer_SetPointerStyle_002', 0, async function (done) { it('Pointer_SetPointerStyle_002', 0, async function (done) {
console.info(`SetPointerStyle_002 enter`); console.info(`SetPointerStyle_002 enter`);
function getPropertiesPromise(windowClass) { function getPropertiesPromise(windowClass) {
...@@ -166,6 +181,9 @@ export default function Pointer_test() { ...@@ -166,6 +181,9 @@ export default function Pointer_test() {
}) })
}) })
} }
var result = canIUse("SystemCapability.MultimodalInput.Input.Pointer");
console.info('Pointer_SetPointerStyle_002 segregate result=' + result);
if (result) {
window.getTopWindow(async (err, data) => { window.getTopWindow(async (err, data) => {
console.info(`case:SetPointerStyle_002 enter`); console.info(`case:SetPointerStyle_002 enter`);
var windowClass = data; var windowClass = data;
...@@ -178,6 +196,11 @@ export default function Pointer_test() { ...@@ -178,6 +196,11 @@ export default function Pointer_test() {
console.info(`case:SetPointerStyle_002 exit`); console.info(`case:SetPointerStyle_002 exit`);
done(); done();
}) })
} else {
expect(true).assertTrue();
console.info('Pointer_SetPointerStyle_002 SystemCapability.MultimodalInput.Input.Pointer segregate');
done();
}
}) })
it('Pointer_GetPointerStyle_001', 0, async function (done) { it('Pointer_GetPointerStyle_001', 0, async function (done) {
...@@ -207,6 +230,9 @@ export default function Pointer_test() { ...@@ -207,6 +230,9 @@ export default function Pointer_test() {
}) })
}) })
} }
var result = canIUse("SystemCapability.MultimodalInput.Input.Pointer");
console.info('Pointer_GetPointerStyle_001 segregate result=' + result);
if (result) {
window.getTopWindow(async (err, data) => { window.getTopWindow(async (err, data) => {
console.info(`case:GetPointerStyle_001 enter`); console.info(`case:GetPointerStyle_001 enter`);
var windowClass = data; var windowClass = data;
...@@ -219,6 +245,11 @@ export default function Pointer_test() { ...@@ -219,6 +245,11 @@ export default function Pointer_test() {
console.info(`case:GetPointerStyle_001 exit`); console.info(`case:GetPointerStyle_001 exit`);
done(); done();
}) })
} else {
expect(true).assertTrue();
console.info('Pointer_GetPointerStyle_001 SystemCapability.MultimodalInput.Input.Pointer segregate');
done();
}
}) })
it('Pointer_GetPointerStyle_002', 0, async function (done) { it('Pointer_GetPointerStyle_002', 0, async function (done) {
...@@ -251,6 +282,9 @@ export default function Pointer_test() { ...@@ -251,6 +282,9 @@ export default function Pointer_test() {
}) })
}) })
} }
var result = canIUse("SystemCapability.MultimodalInput.Input.Pointer");
console.info('Pointer_GetPointerStyle_002 segregate result=' + result);
if (result) {
window.getTopWindow(async (err, data) => { window.getTopWindow(async (err, data) => {
console.info(`case:GetPointerStyle_002 enter`); console.info(`case:GetPointerStyle_002 enter`);
var windowClass = data; var windowClass = data;
...@@ -264,6 +298,11 @@ export default function Pointer_test() { ...@@ -264,6 +298,11 @@ export default function Pointer_test() {
console.info(`case:GetPointerStyle_002 exit`); console.info(`case:GetPointerStyle_002 exit`);
done(); done();
}) })
} else {
expect(true).assertTrue();
console.info('Pointer_GetPointerStyle_002 SystemCapability.MultimodalInput.Input.Pointer segregate');
done();
}
}) })
it('Pointer_PointerStyle_test', 0, function () { it('Pointer_PointerStyle_test', 0, function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册