Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b7f12c2c
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看板
未验证
提交
b7f12c2c
编写于
5月 23, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 23, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8697 taskpool xts test switch to stage model
Merge pull request !8697 from cwx1148594/master
上级
35d3c412
ae153cdf
变更
28
展开全部
隐藏空白更改
内联
并排
Showing
28 changed file
with
1913 addition
and
1794 deletion
+1913
-1794
commonlibrary/ets_utils/taskpool_lib_standard/AppScope/app.json
...library/ets_utils/taskpool_lib_standard/AppScope/app.json
+21
-0
commonlibrary/ets_utils/taskpool_lib_standard/AppScope/resources/base/element/string.json
..._lib_standard/AppScope/resources/base/element/string.json
+8
-0
commonlibrary/ets_utils/taskpool_lib_standard/AppScope/resources/base/media/app_icon.png
...l_lib_standard/AppScope/resources/base/media/app_icon.png
+0
-0
commonlibrary/ets_utils/taskpool_lib_standard/BUILD.gn
commonlibrary/ets_utils/taskpool_lib_standard/BUILD.gn
+20
-15
commonlibrary/ets_utils/taskpool_lib_standard/Test.json
commonlibrary/ets_utils/taskpool_lib_standard/Test.json
+4
-4
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/ets/Application/AbilityStage.ts
...b_standard/entry/src/main/ets/Application/AbilityStage.ts
+9
-9
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/ets/MainAbility/MainAbility.ts
...ib_standard/entry/src/main/ets/MainAbility/MainAbility.ts
+51
-0
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/ets/MainAbility/pages/index.ets
...b_standard/entry/src/main/ets/MainAbility/pages/index.ets
+46
-31
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/ets/TestAbility/TestAbility.ts
...ib_standard/entry/src/main/ets/TestAbility/TestAbility.ts
+49
-0
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/ets/TestAbility/pages/index.ets
...b_standard/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...rd/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/ets/test/List.test.js
...askpool_lib_standard/entry/src/main/ets/test/List.test.js
+20
-26
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/ets/test/TaskPool.test.js
...ool_lib_standard/entry/src/main/ets/test/TaskPool.test.js
+1482
-1482
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/module.json
...ts_utils/taskpool_lib_standard/entry/src/main/module.json
+40
-0
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/resources/base/element/color.json
...standard/entry/src/main/resources/base/element/color.json
+8
-0
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/resources/base/element/string.json
...tandard/entry/src/main/resources/base/element/string.json
+24
-0
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/resources/base/media/icon.png
...lib_standard/entry/src/main/resources/base/media/icon.png
+0
-0
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/resources/base/profile/main_pages.json
...ard/entry/src/main/resources/base/profile/main_pages.json
+5
-0
commonlibrary/ets_utils/taskpool_lib_standard/src/main/config.json
...rary/ets_utils/taskpool_lib_standard/src/main/config.json
+0
-97
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/MainAbility/i18n/en-US.json
...pool_lib_standard/src/main/js/MainAbility/i18n/en-US.json
+0
-6
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/MainAbility/i18n/zh-CN.json
...pool_lib_standard/src/main/js/MainAbility/i18n/zh-CN.json
+0
-6
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/MainAbility/pages/index/index.hml
...ib_standard/src/main/js/MainAbility/pages/index/index.hml
+0
-20
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/TestAbility/i18n/en-US.json
...pool_lib_standard/src/main/js/TestAbility/i18n/en-US.json
+0
-8
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/TestAbility/i18n/zh-CN.json
...pool_lib_standard/src/main/js/TestAbility/i18n/zh-CN.json
+0
-8
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/TestAbility/pages/index/index.css
...ib_standard/src/main/js/TestAbility/pages/index/index.css
+0
-30
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/TestAbility/pages/index/index.hml
...ib_standard/src/main/js/TestAbility/pages/index/index.hml
+0
-5
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/test/List.test.js
...utils/taskpool_lib_standard/src/main/js/test/List.test.js
+0
-19
commonlibrary/ets_utils/taskpool_lib_standard/src/main/resources/base/element/string.json
..._lib_standard/src/main/resources/base/element/string.json
+0
-28
未找到文件。
commonlibrary/ets_utils/taskpool_lib_standard/AppScope/app.json
0 → 100644
浏览文件 @
b7f12c2c
{
"app"
:
{
"bundleName"
:
"com.example.taskpool"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"distributedNotificationEnabled"
:
true
,
"debug"
:
false
,
"description"
:
"$string:app_name"
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"car"
:
{
"apiCompatibleVersion"
:
9
,
"singleUser"
:
false
}
}
}
commonlibrary/ets_utils/taskpool_lib_standard/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
b7f12c2c
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"TaskPoolTest"
}
]
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/
src/main/resources/base/media/
icon.png
→
commonlibrary/ets_utils/taskpool_lib_standard/
AppScope/resources/base/media/app_
icon.png
浏览文件 @
b7f12c2c
文件已移动
commonlibrary/ets_utils/taskpool_lib_standard/BUILD.gn
浏览文件 @
b7f12c2c
# 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
...
@@ -12,27 +12,32 @@
...
@@ -12,27 +12,32 @@
# limitations under the License.
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("taskPool_js_test") {
ohos_js_hap_suite("taskPool_js_test") {
hap_profile = "
./src/main/config
.json"
hap_profile = "
entry/src/main/module
.json"
js
2abc = true
js
_build_mode = "debug"
deps = [
deps = [
":task
P
ool_js_assets",
":task
p
ool_js_assets",
":task
P
ool_resources",
":task
p
ool_resources",
]
]
ets2abc = true
certificate_profile = "
./
signature/openharmony_sx.p7b"
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsTaskPoolJSApiTest"
hap_name = "ActsTaskPoolJSApiTest"
subsystem_name = "commonlibrary"
subsystem_name = "commonlibrary"
part_name = "ets_utils"
part_name = "ets_utils"
}
}
ohos_js_assets("taskPool_js_assets") {
ohos_app_scope("taskpool_app_profile") {
js2abc = true
app_profile = "AppScope/app.json"
hap_profile = "./src/main/config.json"
sources = [ "AppScope/resources" ]
source_dir = "./src/main/js"
}
}
ohos_resources("taskPool_resources") {
sources = [ "./src/main/resources" ]
ohos_js_assets("taskpool_js_assets") {
hap_profile = "./src/main/config.json"
source_dir = "entry/src/main/ets"
}
ohos_resources("taskpool_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":taskpool_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
}
commonlibrary/ets_utils/taskpool_lib_standard/Test.json
浏览文件 @
b7f12c2c
...
@@ -3,9 +3,9 @@
...
@@ -3,9 +3,9 @@
"driver"
:
{
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"800000"
,
"test-timeout"
:
"800000"
,
"shell-timeout"
:
"800000"
,
"bundle-name"
:
"com.example.taskpool"
,
"bundle-name"
:
"com.example.taskpool"
,
"package-name"
:
"com.example.taskpool"
"module-name"
:
"entry"
,
"shell-timeout"
:
"800000"
},
},
"kits"
:
[
"kits"
:
[
{
{
...
@@ -15,5 +15,5 @@
...
@@ -15,5 +15,5 @@
"type"
:
"AppInstallKit"
,
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
"cleanup-apps"
:
true
}
}
]
]
}
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/
src/main/js/MainAbility/app.j
s
→
commonlibrary/ets_utils/taskpool_lib_standard/
entry/src/main/ets/Application/AbilityStage.t
s
浏览文件 @
b7f12c2c
/*
/*
* 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.
*/
*/
export
default
{
import
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
var
printLog0
=
'
TaskPool:AbilityStage:
'
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
console
.
info
(
printLog0
+
"
onCreate
"
)
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
}
}
;
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
b7f12c2c
/*
* 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
Ability
from
'
@ohos.app.ability.UIAbility
'
;
var
printLog
=
'
TaskPool:MainAbility:
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
info
(
printLog
+
'
onCreate
'
)
}
onDestroy
()
{
console
.
info
(
printLog
+
'
onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
info
(
printLog
+
'
onWindowStageCreate
'
)
windowStage
.
loadContent
(
"
MainAbility/pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
}
onWindowStageDestroy
()
{
console
.
info
(
printLog
+
'
onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
info
(
printLog
+
'
onForeground
'
)
}
onBackground
()
{
console
.
info
(
printLog
+
'
onBackground
'
)
}
};
commonlibrary/ets_utils/taskpool_lib_standard/
src/main/js/TestAbility/app.j
s
→
commonlibrary/ets_utils/taskpool_lib_standard/
entry/src/main/ets/MainAbility/pages/index.et
s
浏览文件 @
b7f12c2c
/*
/*
* 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 router from '@ohos.router';
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import
{
Hypium
}
from
'
@ohos/hypium
'
import { Hypium } from '@ohos/hypium'
import
testsuite
from
'
../test/List.test
'
import testsuite from '../../test/List.test'
export
default
{
@Entry
onCreate
()
{
@Component
console
.
info
(
'
TestApplication onCreate
'
);
struct Index {
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
@State message: string = 'MainAbility TaskPool'
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
();
console
.
info
(
'
start run testcase!!!
'
);
aboutToAppear() {
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
);
console.info("start run testcase!!!!")
},
var abilityDelegator: any
onDestroy
()
{
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
console
.
info
(
"
TestApplication onDestroy
"
);
var abilityDelegatorArguments: any
}
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
};
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/
src/main/js/MainAbility/pages/index/index.cs
s
→
commonlibrary/ets_utils/taskpool_lib_standard/
entry/src/main/ets/TestAbility/TestAbility.t
s
浏览文件 @
b7f12c2c
/*
/*
* 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
Ability
from
'
@ohos.app.ability.UIAbility
'
.container
{
export
default
class
TestAbility
extends
Ability
{
flex-direction
:
column
;
onCreate
(
want
,
launchParam
)
{
justify-content
:
center
;
console
.
log
(
'
TestAbility onCreate
'
)
align-items
:
center
;
}
}
.title
{
font-size
:
40px
;
color
:
#000000
;
opacity
:
0.9
;
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
onDestroy
()
{
.title
{
console
.
log
(
'
TestAbility onDestroy
'
)
font-size
:
100px
;
}
}
}
@media
screen
and
(
device-type
:
wearable
)
{
onWindowStageCreate
(
windowStage
)
{
.title
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
font-size
:
28px
;
windowStage
.
loadContent
(
"
TestAbility/pages/index
"
,
(
err
,
data
)
=>
{
color
:
#FFFFFF
;
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
}
}
}
@media
screen
and
(
device-type
:
tv
)
{
onWindowStageDestroy
()
{
.container
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
background-image
:
url("../../common/images/Wallpaper.png")
;
background-size
:
cover
;
background-repeat
:
no-repeat
;
background-position
:
center
;
}
}
.title
{
onForeground
()
{
font-size
:
100px
;
console
.
log
(
'
TestAbility onForeground
'
)
color
:
#FFFFFF
;
}
}
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
onBackground
()
{
.title
{
console
.
log
(
'
TestAbility onBackground
'
)
font-size
:
60px
;
}
}
}
}
;
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/
src/main/js/MainAbility/pages/index/index.j
s
→
commonlibrary/ets_utils/taskpool_lib_standard/
entry/src/main/ets/TestAbility/pages/index.et
s
浏览文件 @
b7f12c2c
/*
/*
* 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 router from '@ohos.router';
import
app
from
'
@system.app
'
import
device
from
'
@system.device
'
@Entry
import
router
from
'
@system.router
'
@Component
struct Index {
export
default
{
aboutToAppear() {
data
:
{
console.info('TestAbility index aboutToAppear')
title
:
''
}
},
@State message: string = 'Hello World'
onInit
()
{
build() {
this
.
title
=
this
.
$t
(
'
strings.world
'
);
Row() {
},
Column() {
onShow
()
{
Text(this.message)
console
.
info
(
'
onShow finish
'
);
.fontSize(50)
},
.fontWeight(FontWeight.Bold)
onReady
()
{
Button() {
},
Text('next page')
}
.fontSize(20)
\ No newline at end of file
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/
src/main/js/TestRunner/OpenHarmonyTestRunner.j
s
→
commonlibrary/ets_utils/taskpool_lib_standard/
entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.t
s
浏览文件 @
b7f12c2c
/*
/*
* 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
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
function
translateParamsToString
(
parameters
)
{
var
abilityDelegator
=
undefined
const
keySet
=
new
Set
([
var
abilityDelegatorArguments
=
undefined
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s itName
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
function
translateParamsToString
(
parameters
)
{
'
-s package
'
,
'
-s dryRun
'
const
keySet
=
new
Set
([
]);
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
let
targetParams
=
''
;
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
for
(
const
key
in
parameters
)
{
'
-s dryRun
'
if
(
keySet
.
has
(
key
))
{
])
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
];
let
targetParams
=
''
;
}
for
(
const
key
in
parameters
)
{
}
if
(
keySet
.
has
(
key
))
{
return
targetParams
.
trim
();
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
}
export
default
{
return
targetParams
.
trim
()
onPrepare
()
{
}
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
);
},
async
function
onAbilityCreateCallback
()
{
onRun
()
{
console
.
log
(
"
onAbilityCreateCallback
"
);
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
);
}
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
();
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.TestAbility
'
;
}
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
;
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
);
constructor
()
{
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
];
}
console
.
info
(
'
debug value :
'
+
debug
);
if
(
debug
==
'
true
'
)
onPrepare
()
{
{
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
)
cmd
+=
'
-D
'
;
}
}
console
.
info
(
'
cmd :
'
+
cmd
);
async
onRun
()
{
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
stdResult
);
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
exitCode
);
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
})
let
lMonitor
=
{
}
abilityName
:
testAbilityName
,
};
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a com.example.taskpool.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/
src/main/js/TestAbility/pages/index/index
.js
→
commonlibrary/ets_utils/taskpool_lib_standard/
entry/src/main/ets/test/List.test
.js
浏览文件 @
b7f12c2c
/*
/*
* 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.
*/
*/
export
default
{
import
TaskPoolTest
from
'
./TaskPool.test.js
'
data
:
{
title
:
""
export
default
function
List
()
{
},
TaskPoolTest
()
onInit
()
{
}
this
.
title
=
this
.
$t
(
'
strings.world
'
);
\ No newline at end of file
}
}
commonlibrary/ets_utils/taskpool_lib_standard/
src/main/j
s/test/TaskPool.test.js
→
commonlibrary/ets_utils/taskpool_lib_standard/
entry/src/main/et
s/test/TaskPool.test.js
浏览文件 @
b7f12c2c
此差异已折叠。
点击以展开。
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/module.json
0 → 100644
浏览文件 @
b7f12c2c
{
"module"
:
{
"name"
:
"entry"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:entry_desc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:main_pages"
,
"uiSyntax"
:
"ets"
,
"abilities"
:
[
{
"name"
:
"com.example.taskpool.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:MainAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:MainAbility_label"
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:white"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
b7f12c2c
{
"color"
:
[
{
"name"
:
"white"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
b7f12c2c
{
"string"
:
[
{
"name"
:
"entry_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"form_FormAbility_desc"
,
"value"
:
"form_description"
},
{
"name"
:
"form_FormAbility_label"
,
"value"
:
"form_label"
}
]
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
b7f12c2c
6.6 KB
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
b7f12c2c
{
"src"
:
[
"MainAbility/pages/index"
]
}
commonlibrary/ets_utils/taskpool_lib_standard/src/main/config.json
已删除
100644 → 0
浏览文件 @
35d3c412
{
"app"
:
{
"bundleName"
:
"com.example.taskpool"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
8
,
"target"
:
9
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.taskpool"
,
"name"
:
".entry"
,
"srcPath"
:
""
,
"mainAbility"
:
".MainAbility"
,
"deviceType"
:
[
"tablet"
,
"default"
,
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"js"
,
"srcPath"
:
"MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:MainAbility_desc"
,
"label"
:
"$string:MainAbility_label"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"js"
,
"srcPath"
:
"TestAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
}
},
{
"pages"
:
[
"pages/index/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
],
"testRunner"
:
{
"name"
:
"OpenHarmonyTestRunner"
,
"srcPath"
:
"TestRunner"
}
}
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/MainAbility/i18n/en-US.json
已删除
100644 → 0
浏览文件 @
35d3c412
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/MainAbility/i18n/zh-CN.json
已删除
100644 → 0
浏览文件 @
35d3c412
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/MainAbility/pages/index/index.hml
已删除
100644 → 0
浏览文件 @
35d3c412
<!--
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.
-->
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{title}}
</text>
</div>
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/TestAbility/i18n/en-US.json
已删除
100644 → 0
浏览文件 @
35d3c412
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
},
"Files"
:
{
}
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/TestAbility/i18n/zh-CN.json
已删除
100644 → 0
浏览文件 @
35d3c412
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
},
"Files"
:
{
}
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/TestAbility/pages/index/index.css
已删除
100644 → 0
浏览文件 @
35d3c412
.container
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
60px
;
text-align
:
center
;
width
:
100%
;
height
:
40%
;
margin
:
10px
;
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
\ No newline at end of file
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/TestAbility/pages/index/index.hml
已删除
100644 → 0
浏览文件 @
35d3c412
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/test/List.test.js
已删除
100644 → 0
浏览文件 @
35d3c412
/*
* 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
TaskPoolTest
from
'
./TaskPool.test.js
'
export
default
function
testsuite
()
{
TaskPoolTest
()
}
commonlibrary/ets_utils/taskpool_lib_standard/src/main/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
35d3c412
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"entry_MainAbility"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Empty Ability"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录