diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Log.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Log.ets index 6dbc97e1227f29a08d60463d8bf5ed6586ee5920..018658e2911600fe489bd6a8430e8879be2b78eb 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Log.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Log.ets @@ -1,3 +1,18 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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. + */ + const TAG = 'ets_apiLack_add'; diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/scrollEdge.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/scrollEdge.test.ets index a14e5555ccc39e8abf3117674c1c3dfd35b9be0b..af1ae76fc8e34ebcdeb80ad79788b7da232a83fd 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/scrollEdge.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/scrollEdge.test.ets @@ -1,3 +1,18 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" diff --git a/arkui/ace_js_attribute_api/src/main/js/test/basicabilityapi.test.js b/arkui/ace_js_attribute_api/src/main/js/test/basicabilityapi.test.js index 9a3f64e2aac2d75bbe6b109871560d47eb0e8de1..154a9cb5545bdda3680eb4868d50596d170e2b4e 100644 --- a/arkui/ace_js_attribute_api/src/main/js/test/basicabilityapi.test.js +++ b/arkui/ace_js_attribute_api/src/main/js/test/basicabilityapi.test.js @@ -68,15 +68,13 @@ describe('basicabilityapi', function () { let promise1 = new Promise((resolve, reject) => { intervalID = setInterval(function () { if(res === testTimes ){ - resolve(null); clearInterval(intervalID); - }else{ - res++; - console.info('testClearInterval res = ' + res); } + res++; + console.info('testClearInterval res = ' + res); + resolve(); }, 100); - }) - + }); Promise.all([promise1]).then(() => { console.info('testClearInterval finally'); expect(testTimes).assertEqual(res); @@ -488,5 +486,38 @@ describe('basicabilityapi', function () { done(); }, 1000); }); + + /** + * @tc.number SUB_ACE_BASICABILITY_JS_API_1500 + * @tc.name testRequestAnimationFrame + * @tc.desc Sets a vsync after which a function will be executed. + */ + it('testRequestAnimationFrame', 0, async function (done) { + console.info('testRequestAnimationFrame START'); + let requestId = requestAnimationFrame(function () { + console.info('testRequestAnimationFrame success'); + expect(true).assertTrue(); + done(); + }); + }); + + /** + * @tc.number SUB_ACE_BASICABILITY_JS_API_1600 + * @tc.name testCancelAnimationFrame + * @tc.desc Indicates the vsync callback ID returned by "requestAnimationFrame()". + */ + it('testCancelAnimationFrame', 0, async function (done) { + console.info('testCancelAnimationFrame START'); + let result = true; + let requestId = requestAnimationFrame(function () { + console.info('testCancelAnimationFrame fail'); + result = false; + }); + cancelAnimationFrame(requestId); + await setTimeout(function () { + expect(result).assertTrue(); + done(); + }, 1000); + }); }); }