Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
521b71b1
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看板
提交
521b71b1
编写于
8月 25, 2023
作者:
W
wangyulie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改ffrt的xts模型
Signed-off-by:
N
wangyulie
<
wanglieyu@126.com
>
上级
0a4c273f
变更
24
显示空白变更内容
内联
并排
Showing
24 changed file
with
319 addition
and
160 deletion
+319
-160
resourceschedule/resourceschedule_standard/ffrt/AppScope/app.json
...schedule/resourceschedule_standard/ffrt/AppScope/app.json
+0
-16
resourceschedule/resourceschedule_standard/ffrt/AppScope/resources/base/element/string.json
...standard/ffrt/AppScope/resources/base/element/string.json
+0
-8
resourceschedule/resourceschedule_standard/ffrt/AppScope/resources/base/media/app_icon.png
..._standard/ffrt/AppScope/resources/base/media/app_icon.png
+0
-0
resourceschedule/resourceschedule_standard/ffrt/BUILD.gn
resourceschedule/resourceschedule_standard/ffrt/BUILD.gn
+13
-14
resourceschedule/resourceschedule_standard/ffrt/Test.json
resourceschedule/resourceschedule_standard/ffrt/Test.json
+4
-6
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/config.json
...resourceschedule_standard/ffrt/entry/src/main/config.json
+100
-0
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/BUILD.gn
...esourceschedule_standard/ffrt/entry/src/main/cpp/BUILD.gn
+0
-1
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/CMakeLists.txt
...eschedule_standard/ffrt/entry/src/main/cpp/CMakeLists.txt
+0
-0
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/ffrtndk.cpp
...urceschedule_standard/ffrt/entry/src/main/cpp/ffrtndk.cpp
+0
-0
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/types/libffrtndk/index.d.ts
...ndard/ffrt/entry/src/main/cpp/types/libffrtndk/index.d.ts
+0
-0
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/cpp/types/libffrtndk/package.json
...ard/ffrt/entry/src/main/cpp/types/libffrtndk/package.json
+0
-0
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/ets/MainAbility/app.ets
...dule_standard/ffrt/entry/src/main/ets/MainAbility/app.ets
+32
-0
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/ets/MainAbility/pages/index.ets
...ndard/ffrt/entry/src/main/ets/MainAbility/pages/index.ets
+36
-0
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/ets/TestAbility/app.ets
...dule_standard/ffrt/entry/src/main/ets/TestAbility/app.ets
+32
-0
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/ets/TestAbility/pages/index.ets
...ndard/ffrt/entry/src/main/ets/TestAbility/pages/index.ets
+5
-4
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...rt/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+77
-0
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/ets/test/Ffrt.test.ets
...edule_standard/ffrt/entry/src/main/ets/test/Ffrt.test.ets
+0
-0
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/ets/test/List.test.ets
...edule_standard/ffrt/entry/src/main/ets/test/List.test.ets
+0
-0
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/resources/base/element/string.json
...rd/ffrt/entry/src/main/resources/base/element/string.json
+20
-0
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/resources/base/media/icon.png
...tandard/ffrt/entry/src/main/resources/base/media/icon.png
+0
-0
resourceschedule/resourceschedule_standard/ffrt/src/main/ets/TestAbility/TestAbility.ets
...le_standard/ffrt/src/main/ets/TestAbility/TestAbility.ets
+0
-62
resourceschedule/resourceschedule_standard/ffrt/src/main/module.json
...edule/resourceschedule_standard/ffrt/src/main/module.json
+0
-36
resourceschedule/resourceschedule_standard/ffrt/src/main/resources/base/element/color.json
..._standard/ffrt/src/main/resources/base/element/color.json
+0
-8
resourceschedule/resourceschedule_standard/ffrt/src/main/resources/base/profile/test_pages.json
...dard/ffrt/src/main/resources/base/profile/test_pages.json
+0
-5
未找到文件。
resourceschedule/resourceschedule_standard/ffrt/AppScope/app.json
已删除
100644 → 0
浏览文件 @
0a4c273f
{
"app"
:
{
"bundleName"
:
"com.actsffrt.napitest"
,
"vendor"
:
"example"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
},
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"car"
:
{
"apiCompatibleVersion"
:
10
,
"singleUser"
:
false
}
}
resourceschedule/resourceschedule_standard/ffrt/AppScope/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
0a4c273f
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"MyApplication"
}
]
}
resourceschedule/resourceschedule_standard/ffrt/AppScope/resources/base/media/app_icon.png
已删除
100644 → 0
浏览文件 @
0a4c273f
6.6 KB
resourceschedule/resourceschedule_standard/ffrt/BUILD.gn
浏览文件 @
521b71b1
...
@@ -13,29 +13,28 @@
...
@@ -13,29 +13,28 @@
import("//build/ohos.gni")
import("//build/ohos.gni")
import("//test/xts/tools/build/suite.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("resourceschedule_ffrt_js_test") {
ohos_js_hap_suite("resourceschedule_ffrt_js_test") {
hap_profile = "./
src/main/module
.json"
hap_profile = "./
entry/src/main/config
.json"
deps = [
deps = [
":windowStage_js_assets",
":ace_third_ets_assets",
":windowStage_resources",
":ace_third_ets_resources",
":ace_third_ets_test_assets",
]
]
ets2abc = true
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsFfrtNativeTest"
hap_name = "ActsFfrtNativeTest"
subsystem_name = "resourceschedule"
subsystem_name = "resourceschedule"
part_name = "ffrt"
part_name = "ffrt"
shared_libraries = [ "./src/main/cpp:ffrtndk" ]
shared_libraries = [ "./
entry/
src/main/cpp:ffrtndk" ]
}
}
ohos_app_scope("windowStage_app_profile") {
app_profile = "AppScope/app.json"
ohos_js_assets("ace_third_ets_assets") {
source
s = [ "AppScope/resources" ]
source
_dir = "./entry/src/main/ets/MainAbility"
}
}
ohos_js_assets("
windowStage_js
_assets") {
ohos_js_assets("
ace_third_ets_test
_assets") {
source_dir = "./
src/main/ets
"
source_dir = "./
entry/src/main/ets/TestAbility
"
}
}
ohos_resources("windowStage_resources") {
ohos_resources("ace_third_ets_resources") {
sources = [ "./src/main/resources" ]
sources = [ "./entry/src/main/resources" ]
deps = [ ":windowStage_app_profile" ]
hap_profile = "./entry/src/main/config.json"
hap_profile = "./src/main/module.json"
}
}
resourceschedule/resourceschedule_standard/ffrt/Test.json
浏览文件 @
521b71b1
...
@@ -2,11 +2,10 @@
...
@@ -2,11 +2,10 @@
"description"
:
"Configuration for hjunit demo Tests"
,
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"
18
0000"
,
"test-timeout"
:
"
60
0000"
,
"bundle-name"
:
"com.actsffrt.napitest"
,
"bundle-name"
:
"com.actsffrt.napitest"
,
"module-name"
:
"entry_test"
,
"package-name"
:
"com.actsffrt.napitest"
,
"shell-timeout"
:
"600000"
,
"shell-timeout"
:
"600000"
"testcase-timeout"
:
70000
},
},
"kits"
:
[
"kits"
:
[
{
{
...
@@ -18,4 +17,3 @@
...
@@ -18,4 +17,3 @@
}
}
]
]
}
}
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/config.json
0 → 100644
浏览文件 @
521b71b1
{
"app"
:
{
"bundleName"
:
"com.actsffrt.napitest"
,
"vendor"
:
"open"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
9
,
"releaseType"
:
"Release"
,
"target"
:
9
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.actsffrt.napitest"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
"com.actsffrt.napitest.MainAbility"
,
"deviceType"
:
[
"default"
,
"tablet"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"MainAbility"
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:description_mainability"
,
"formsEnabled"
:
false
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"TestAbility"
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"formsEnabled"
:
false
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/ffrt/src/main/cpp/BUILD.gn
→
resourceschedule/resourceschedule_standard/ffrt/
entry/
src/main/cpp/BUILD.gn
浏览文件 @
521b71b1
...
@@ -51,7 +51,6 @@ ohos_shared_library("ffrtndk") {
...
@@ -51,7 +51,6 @@ ohos_shared_library("ffrtndk") {
deps = [
deps = [
"//foundation/resourceschedule/ffrt:ffrt_ndk",
"//foundation/resourceschedule/ffrt:ffrt_ndk",
"//foundation/resourceschedule/ffrt/interfaces/kits:libffrt_ndk",
]
]
output_extension = "so"
output_extension = "so"
...
...
resourceschedule/resourceschedule_standard/ffrt/src/main/cpp/CMakeLists.txt
→
resourceschedule/resourceschedule_standard/ffrt/
entry/
src/main/cpp/CMakeLists.txt
浏览文件 @
521b71b1
文件已移动
resourceschedule/resourceschedule_standard/ffrt/src/main/cpp/ffrtndk.cpp
→
resourceschedule/resourceschedule_standard/ffrt/
entry/
src/main/cpp/ffrtndk.cpp
浏览文件 @
521b71b1
文件已移动
resourceschedule/resourceschedule_standard/ffrt/src/main/cpp/types/libffrtndk/index.d.ts
→
resourceschedule/resourceschedule_standard/ffrt/
entry/
src/main/cpp/types/libffrtndk/index.d.ts
浏览文件 @
521b71b1
文件已移动
resourceschedule/resourceschedule_standard/ffrt/src/main/cpp/types/libffrtndk/package.json
→
resourceschedule/resourceschedule_standard/ffrt/
entry/
src/main/cpp/types/libffrtndk/package.json
浏览文件 @
521b71b1
文件已移动
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/ets/MainAbility/app.ets
0 → 100644
浏览文件 @
521b71b1
/**
* Copyright (c) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/ets/MainAbility/pages/index.ets
0 → 100644
浏览文件 @
521b71b1
/**
* Copyright (c) 2022 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.
*/
@Entry
@Component
struct MyComponent {
aboutToAppear() {
}
build() {
Flex({
direction: FlexDirection.Column,
alignItems: ItemAlign.Center,
justifyContent: FlexAlign.Center
}) {
Text('BMS ETS TEST')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
resourceschedule/resourceschedule_standard/ffrt/entry/src/main/ets/TestAbility/app.ets
0 → 100644
浏览文件 @
521b71b1
/**
* Copyright (c) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/ffrt/
src/main/ets/TestAbility/pages/I
ndex.ets
→
resourceschedule/resourceschedule_standard/ffrt/
entry/src/main/ets/TestAbility/pages/i
ndex.ets
浏览文件 @
521b71b1
/*
/*
*
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
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
...
@@ -12,14 +12,15 @@
...
@@ -12,14 +12,15 @@
* 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
hilog from '@ohos.hilog
';
import
router from '@system.router
';
@Entry
@Entry
@Component
@Component
struct Index {
struct Index {
aboutToAppear() {
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear');
console.info('TestAbility index aboutToAppear')
}
}
@State message: string = 'Hello World'
@State message: string = 'Hello World'
build() {
build() {
Row() {
Row() {
...
...
resourceschedule/resourceschedule_standard/ffrt/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
→
resourceschedule/resourceschedule_standard/ffrt/
entry/
src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
浏览文件 @
521b71b1
/*
/*
*
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
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
...
@@ -12,19 +12,33 @@
...
@@ -12,19 +12,33 @@
* 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
hilog
from
'
@ohos.hilog
'
;
import
TestRunner
from
'
@ohos.application.testRunner
'
import
TestRunner
from
'
@ohos.application.testRunner
'
;
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
AbilityDelegatorRegistry
from
'
@ohos.app.ability.abilityDelegatorRegistry
'
;
var
abilityDelegator
=
undefined
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s itName
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s package
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
async
function
onAbilityCreateCallback
()
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
onAbilityCreateCallback
'
);
console
.
log
(
'
onAbilityCreateCallback
'
);
}
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
addAbilityMonitorCallback : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
console
.
info
(
'
addAbilityMonitorCallback :
'
+
JSON
.
stringify
(
err
))
}
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
...
@@ -32,32 +46,32 @@ export default class OpenHarmonyTestRunner implements TestRunner {
...
@@ -32,32 +46,32 @@ export default class OpenHarmonyTestRunner implements TestRunner {
}
}
onPrepare
()
{
onPrepare
()
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner OnPrepare
'
);
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
}
}
async
onRun
()
{
onRun
()
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun run
'
);
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.TestAbility
'
let
lMonitor
=
{
let
lMonitor
=
{
abilityName
:
testAbilityName
,
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
};
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.MainAbility
'
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a TestAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
var
debug
=
abilityDelegatorArguments
.
parameters
[
'
-D
'
]
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
if
(
debug
==
'
true
'
)
console
.
info
(
'
cmd :
'
+
cmd
)
{
cmd
+=
'
-D
'
}
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
cmd : %{public}s
'
,
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
(
err
:
any
,
d
:
any
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : err : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
)
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
stdResult
??
''
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
exitCode
??
''
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
})
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun end
'
);
console
.
info
(
'
OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext
'
)
var
context
=
abilityDelegator
.
getAppContext
()
console
.
info
(
'
getAppContext :
'
+
JSON
.
stringify
(
context
))
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
}
}
};
\ No newline at end of file
\ No newline at end of file
resourceschedule/resourceschedule_standard/ffrt/src/main/ets/test/Ffrt.test.ets
→
resourceschedule/resourceschedule_standard/ffrt/
entry/
src/main/ets/test/Ffrt.test.ets
浏览文件 @
521b71b1
文件已移动
resourceschedule/resourceschedule_standard/ffrt/src/main/ets/test/List.test.ets
→
resourceschedule/resourceschedule_standard/ffrt/
entry/
src/main/ets/test/List.test.ets
浏览文件 @
521b71b1
文件已移动
resourceschedule/resourceschedule_standard/ffrt/src/main/resources/base/element/string.json
→
resourceschedule/resourceschedule_standard/ffrt/
entry/
src/main/resources/base/element/string.json
浏览文件 @
521b71b1
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_test_desc"
,
"name"
:
"entry_MainAbility"
,
"value"
:
"test ability description"
"value"
:
"entry_MainAbility"
},
{
"name"
:
"description_mainability"
,
"value"
:
"ETS_Empty Ability"
},
},
{
{
"name"
:
"TestAbility_desc"
,
"name"
:
"TestAbility_desc"
,
"value"
:
"
the test ability
"
"value"
:
"
description
"
},
},
{
{
"name"
:
"TestAbility_label"
,
"name"
:
"TestAbility_label"
,
"value"
:
"
test
label"
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/ffrt/src/main/resources/base/media/icon.png
→
resourceschedule/resourceschedule_standard/ffrt/
entry/
src/main/resources/base/media/icon.png
浏览文件 @
521b71b1
文件已移动
resourceschedule/resourceschedule_standard/ffrt/src/main/ets/TestAbility/TestAbility.ets
已删除
100644 → 0
浏览文件 @
0a4c273f
/*
* 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';
import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test';
import window from '@ohos.window';
export default class TestAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? '');
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}
onWindowStageCreate(windowStage: window.WindowStage) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
windowStage.loadContent('TestAbility/pages/Index', (err, data) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}
onForeground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}
onBackground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/ffrt/src/main/module.json
已删除
100644 → 0
浏览文件 @
0a4c273f
{
"module"
:
{
"name"
:
"entry_test"
,
"type"
:
"feature"
,
"description"
:
"$string:module_test_desc"
,
"mainElement"
:
"TestAbility"
,
"deviceTypes"
:
[
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:test_pages"
,
"abilities"
:
[
{
"name"
:
"TestAbility"
,
"srcEntry"
:
"./ets/TestAbility/TestAbility.ets"
,
"description"
:
"$string:TestAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:TestAbility_label"
,
"exported"
:
true
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:start_window_background"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}
]
}
]
}
}
resourceschedule/resourceschedule_standard/ffrt/src/main/resources/base/element/color.json
已删除
100644 → 0
浏览文件 @
0a4c273f
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/ffrt/src/main/resources/base/profile/test_pages.json
已删除
100644 → 0
浏览文件 @
0a4c273f
{
"src"
:
[
"TestAbility/pages/Index"
]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录