From 60f8c90f26db363f22c9375585674c5069965c47 Mon Sep 17 00:00:00 2001 From: wangyulie Date: Fri, 11 Aug 2023 17:01:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0xts=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyulie --- .../AppScope/resources/base/element/string.json | 2 +- .../resourceschedule_standard/ffrt/BUILD.gn | 4 ++-- .../ffrt/build-profile.json5 | 4 ++-- .../ffrt/entry/build-profile.json5 | 1 - .../ffrt/entry/src/main/cpp/CMakeLists.txt | 2 +- .../ffrt/entry/src/main/cpp/ffrtndk.cpp | 14 ++++++++++++++ .../entry/src/main/cpp/types/libentry/index.d.ts | 1 + .../src/main/cpp/types/libentry/oh-package.json5 | 6 ++++++ .../ffrt/entry/src/main/module.json5 | 3 ++- .../ffrt/entry/src/ohosTest/ets/test/Ffrt.test.ets | 14 ++++++++++++++ .../ffrt/entry/src/ohosTest/ets/test/List.test.ets | 14 ++++++++++++++ .../src/ohosTest/ets/testability/TestAbility.ets | 14 ++++++++++++++ .../src/ohosTest/ets/testability/pages/Index.ets | 14 ++++++++++++++ .../ffrt/entry/src/ohosTest/module.json5 | 2 ++ .../ffrt/oh-package.json5 | 2 +- 15 files changed, 88 insertions(+), 9 deletions(-) create mode 100644 resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/types/libentry/index.d.ts create mode 100644 resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/types/libentry/oh-package.json5 diff --git a/resourceschedule/resourceschedule_standard/ffrt/AppScope/resources/base/element/string.json b/resourceschedule/resourceschedule_standard/ffrt/AppScope/resources/base/element/string.json index 1080233f0..5427011cc 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/AppScope/resources/base/element/string.json +++ b/resourceschedule/resourceschedule_standard/ffrt/AppScope/resources/base/element/string.json @@ -2,7 +2,7 @@ "string": [ { "name": "app_name", - "value": "MyApplication" + "value": "FfrtTest" } ] } diff --git a/resourceschedule/resourceschedule_standard/ffrt/BUILD.gn b/resourceschedule/resourceschedule_standard/ffrt/BUILD.gn index 2329e3f8c..dd81004a3 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/BUILD.gn +++ b/resourceschedule/resourceschedule_standard/ffrt/BUILD.gn @@ -12,10 +12,10 @@ # limitations under the License. import("//test/xts/tools/build/suite.gni") ohos_js_app_suite("resourceschedule_ffrt_js_test") { - test_hap = true + test_hap = true testonly = true certificate_profile = "./signature/openharmony_sx.p7b" hap_name = "ActsFfrtNativeTest" part_name = "ffrt" subsystem_name = "resourceschedule" -} \ No newline at end of file +} diff --git a/resourceschedule/resourceschedule_standard/ffrt/build-profile.json5 b/resourceschedule/resourceschedule_standard/ffrt/build-profile.json5 index d7b1117cd..a4faee900 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/build-profile.json5 +++ b/resourceschedule/resourceschedule_standard/ffrt/build-profile.json5 @@ -1,8 +1,8 @@ { "app": { "signingConfigs": [], - "compileSdkVersion": 9, - "compatibleSdkVersion": 9, + "compileSdkVersion": 10, + "compatibleSdkVersion": 10, "products": [ { "name": "default", diff --git a/resourceschedule/resourceschedule_standard/ffrt/entry/build-profile.json5 b/resourceschedule/resourceschedule_standard/ffrt/entry/build-profile.json5 index 6f2e56988..e61ac60a8 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/entry/build-profile.json5 +++ b/resourceschedule/resourceschedule_standard/ffrt/entry/build-profile.json5 @@ -10,7 +10,6 @@ "targets": [ { "name": "default", - "runtimeOS": "HarmonyOS" }, { "name": "ohosTest", diff --git a/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/CMakeLists.txt b/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/CMakeLists.txt index e59172465..ee7b1638c 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/CMakeLists.txt +++ b/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/CMakeLists.txt @@ -1,6 +1,6 @@ # the minimum version of CMake. cmake_minimum_required(VERSION 3.4.1) -project(MyApplication) +project(FfrtTest) set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/ffrtndk.cpp b/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/ffrtndk.cpp index 3f1a733c9..2a4d76b47 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/ffrtndk.cpp +++ b/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/ffrtndk.cpp @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device 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. + */ #include "napi/native_api.h" #include "hilog/log.h" #include "ffrt/task.h" diff --git a/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/types/libentry/index.d.ts b/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/types/libentry/index.d.ts new file mode 100644 index 000000000..e44f3615a --- /dev/null +++ b/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/types/libentry/index.d.ts @@ -0,0 +1 @@ +export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/types/libentry/oh-package.json5 b/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/types/libentry/oh-package.json5 new file mode 100644 index 000000000..8c49cae22 --- /dev/null +++ b/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/types/libentry/oh-package.json5 @@ -0,0 +1,6 @@ +{ + "name": "libentry.so", + "types": "./index.d.ts", + "version": "", + "description": "Please describe the basic information." +} \ No newline at end of file diff --git a/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/module.json5 b/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/module.json5 index bf200cf76..9b07af70a 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/module.json5 +++ b/resourceschedule/resourceschedule_standard/ffrt/entry/src/main/module.json5 @@ -5,7 +5,8 @@ "description": "$string:module_desc", "mainElement": "EntryAbility", "deviceTypes": [ - "phone" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": false, diff --git a/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/test/Ffrt.test.ets b/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/test/Ffrt.test.ets index af249f4c4..27c00c61e 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/test/Ffrt.test.ets +++ b/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/test/Ffrt.test.ets @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device 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 hilog from '@ohos.hilog'; import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import ffrtndk from 'libffrtndk.so'; diff --git a/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/test/List.test.ets b/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/test/List.test.ets index fe3fa1ef6..767d03110 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/test/List.test.ets +++ b/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/test/List.test.ets @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device 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 ffrtTest from './Ffrt.test' export default function testsuite() { diff --git a/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/testability/TestAbility.ets b/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/testability/TestAbility.ets index e3f6e911d..e9f38bba2 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/testability/TestAbility.ets +++ b/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; import hilog from '@ohos.hilog'; diff --git a/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/testability/pages/Index.ets b/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/testability/pages/Index.ets index 166366593..22e23283e 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/testability/pages/Index.ets +++ b/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/ets/testability/pages/Index.ets @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device 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 hilog from '@ohos.hilog'; @Entry diff --git a/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/module.json5 b/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/module.json5 index 87631d3a1..48785eea7 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/module.json5 +++ b/resourceschedule/resourceschedule_standard/ffrt/entry/src/ohosTest/module.json5 @@ -5,6 +5,8 @@ "description": "$string:module_test_desc", "mainElement": "TestAbility", "deviceTypes": [ + "default", + "tablet", "phone" ], "deliveryWithInstall": true, diff --git a/resourceschedule/resourceschedule_standard/ffrt/oh-package.json5 b/resourceschedule/resourceschedule_standard/ffrt/oh-package.json5 index f1b2443f2..b97ffaec4 100644 --- a/resourceschedule/resourceschedule_standard/ffrt/oh-package.json5 +++ b/resourceschedule/resourceschedule_standard/ffrt/oh-package.json5 @@ -4,7 +4,7 @@ "@ohos/hypium": "1.0.6" }, "author": "", - "name": "myapplication", + "name": "ffrttest", "description": "Please describe the basic information.", "main": "", "version": "1.0.0", -- GitLab