Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
bbaff12e
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看板
未验证
提交
bbaff12e
编写于
7月 11, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 11, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9270 增加UIExtension相关xts
Merge pull request !9270 from jsjzju/master
上级
9c712076
b7ba703c
变更
36
隐藏空白更改
内联
并排
Showing
36 changed file
with
1073 addition
and
1 deletion
+1073
-1
ability/ability_runtime/BUILD.gn
ability/ability_runtime/BUILD.gn
+2
-1
ability/ability_runtime/actsuiextensiontest/BUILD.gn
ability/ability_runtime/actsuiextensiontest/BUILD.gn
+24
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/AppScope/app.json
...actsuiextensiontest/uiextensionprovider/AppScope/app.json
+13
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/AppScope/resources/base/element/string.json
...nsionprovider/AppScope/resources/base/element/string.json
+8
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/AppScope/resources/base/media/app_icon.png
...ensionprovider/AppScope/resources/base/media/app_icon.png
+0
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/BUILD.gn
..._runtime/actsuiextensiontest/uiextensionprovider/BUILD.gn
+43
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/Application/MyAbilityStage.ts
...provider/entry/src/main/ets/Application/MyAbilityStage.ts
+24
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/MainAbility/MainAbility.ts
...ionprovider/entry/src/main/ets/MainAbility/MainAbility.ts
+66
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
...der/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
+49
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/model/Logger.ts
...st/uiextensionprovider/entry/src/main/ets/model/Logger.ts
+38
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/pages/index.ets
...st/uiextensionprovider/entry/src/main/ets/pages/index.ets
+92
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/module.json
...ensiontest/uiextensionprovider/entry/src/main/module.json
+54
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/resources/base/element/color.json
...provider/entry/src/main/resources/base/element/color.json
+8
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/resources/base/element/string.json
...rovider/entry/src/main/resources/base/element/string.json
+16
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/resources/base/media/icon.png
...sionprovider/entry/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/resources/base/profile/main_pages.json
...der/entry/src/main/resources/base/profile/main_pages.json
+5
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/signature/openharmony_sx.p7b
...siontest/uiextensionprovider/signature/openharmony_sx.p7b
+0
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/AppScope/app.json
...ime/actsuiextensiontest/uiextensiontest/AppScope/app.json
+13
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/AppScope/resources/base/element/string.json
...extensiontest/AppScope/resources/base/element/string.json
+8
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/AppScope/resources/base/media/app_icon.png
...iextensiontest/AppScope/resources/base/media/app_icon.png
+0
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/BUILD.gn
...lity_runtime/actsuiextensiontest/uiextensiontest/BUILD.gn
+43
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/Test.json
...ity_runtime/actsuiextensiontest/uiextensiontest/Test.json
+22
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/Application/TestAbilityStage.ts
...ontest/entry/src/main/ets/Application/TestAbilityStage.ts
+24
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/TestAbility/TestAbility.ets
...ensiontest/entry/src/main/ets/TestAbility/TestAbility.ets
+64
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/TestAbility/pages/index.ets
...ensiontest/entry/src/main/ets/TestAbility/pages/index.ets
+47
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/TestAbility/pages/p1.ets
...extensiontest/entry/src/main/ets/TestAbility/pages/p1.ets
+62
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+86
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/test/Ability.test.ets
.../uiextensiontest/entry/src/main/ets/test/Ability.test.ets
+148
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/test/List.test.ets
...est/uiextensiontest/entry/src/main/ets/test/List.test.ets
+20
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/test/Utils.ets
...iontest/uiextensiontest/entry/src/main/ets/test/Utils.ets
+26
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/module.json
...iextensiontest/uiextensiontest/entry/src/main/module.json
+38
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/resources/base/element/color.json
...siontest/entry/src/main/resources/base/element/color.json
+8
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/resources/base/element/string.json
...iontest/entry/src/main/resources/base/element/string.json
+16
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/resources/base/media/icon.png
...xtensiontest/entry/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/resources/base/profile/test_pages.json
...est/entry/src/main/resources/base/profile/test_pages.json
+6
-0
ability/ability_runtime/actsuiextensiontest/uiextensiontest/signature/openharmony_sx.p7b
...xtensiontest/uiextensiontest/signature/openharmony_sx.p7b
+0
-0
未找到文件。
ability/ability_runtime/BUILD.gn
浏览文件 @
bbaff12e
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (c) 2021
-2023
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
...
...
@@ -40,6 +40,7 @@ group("ability_runtime") {
"actsstserviceabilityclientcase:ActsStServiceAbilityClientCaseTest",
"actssupportfunction:actssupportfunction",
"actssystemapitest:ActsSystemAPITest",
"actsuiextensiontest:actsuiextensiontest",
"actsusers:actsusers",
"amscontextualinforquery:amscontextualinforquery",
"amsdatauriutils:ActsAmsDataUriUtilsTest",
...
...
ability/ability_runtime/actsuiextensiontest/BUILD.gn
0 → 100644
浏览文件 @
bbaff12e
# Copyright (c) 2023 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("//test/xts/tools/build/suite.gni")
group("actsuiextensiontest") {
testonly = true
if (is_standard_system) {
deps = [
"uiextensionprovider:UIExtensionProvider",
"uiextensiontest:UIExtensionTest",
]
}
}
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/AppScope/app.json
0 → 100644
浏览文件 @
bbaff12e
{
"app"
:
{
"bundleName"
:
"com.example.uiextensionprovider"
,
"vendor"
:
"example"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
,
"distributedNotificationEnabled"
:
true
,
"minAPIVersion"
:
10
,
"targetAPIVersion"
:
10
}
}
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
bbaff12e
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"UIExtensionProvider"
}
]
}
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
bbaff12e
6.6 KB
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/BUILD.gn
0 → 100644
浏览文件 @
bbaff12e
# Copyright (c) 2023 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("//test/xts/tools/build/suite.gni")
ohos_hap_assist_suite("UIExtensionProvider") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":uiextensionprovider_js_assets",
":uiextensionprovider_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "UIExtensionProvider"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("uiextensionprovider_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("uiextensionprovider_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("uiextensionprovider_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":uiextensionprovider_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/Application/MyAbilityStage.ts
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
AbilityStage onCreate
'
);
}
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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
Ability
from
'
@ohos.app.ability.UIAbility
'
import
Window
from
'
@ohos.window
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onCreate
'
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
want param:
'
+
JSON
.
stringify
(
want
)
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
launchParam:
'
+
JSON
.
stringify
(
launchParam
)
??
''
);
}
onDestroy
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onDestroy
'
);
}
onWindowStageCreate
(
windowStage
:
Window
.
WindowStage
)
{
// Main window is created, set main page for this ability
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onWindowStageCreate
'
);
windowStage
.
loadContent
(
'
pages/index
'
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
ERROR
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
Failed to load the content. Cause: %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
return
;
}
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
Succeeded in loading the content. Data: %{public}s
'
,
JSON
.
stringify
(
data
)
??
''
);
});
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onWindowStageDestroy
'
);
}
onForeground
()
{
// Ability has brought to foreground
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onForeground
'
);
}
onBackground
()
{
// Ability has back to background
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onBackground
'
);
}
}
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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
UIExtensionAbility
from
'
@ohos.app.ability.UIExtensionAbility
'
import
Logger
from
'
../model/Logger
'
const
TAG
:
string
=
'
[UIExtAbility]
'
export
default
class
UIExtAbility
extends
UIExtensionAbility
{
onCreate
()
{
Logger
.
log
(
TAG
,
`UIExtAbility onCreate`
)
}
onForeground
()
{
Logger
.
log
(
TAG
,
`UIExtAbility onForeground`
)
}
onBackground
()
{
Logger
.
log
(
TAG
,
`UIExtAbility onBackground`
)
}
onDestroy
()
{
Logger
.
log
(
TAG
,
`UIExtAbility onDestroy`
)
}
onSessionCreate
(
want
,
session
)
{
Logger
.
log
(
TAG
,
`UIExtAbility onSessionCreate, want:
${
JSON
.
stringify
(
want
)}
`
)
let
storage
:
LocalStorage
=
new
LocalStorage
({
'
session
'
:
session
});
session
.
loadContent
(
'
pages/index
'
,
storage
);
}
onSessionDestroy
(
session
)
{
Logger
.
log
(
TAG
,
`UIExtAbility onSessionDestroy`
)
}
};
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/model/Logger.ts
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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.
*/
const
TAG
:
string
=
'
=== Stage AMS ===
'
export
default
class
Logger
{
public
static
log
(
tag
,
...
args
:
any
[])
{
console
.
log
(
`
${
TAG
}
.
${
tag
}
:
${
args
.
join
(
''
)}
`
)
}
public
static
info
(
tag
,
...
args
:
any
[])
{
console
.
info
(
`
${
TAG
}
.
${
tag
}
:
${
args
.
join
(
''
)}
`
)
}
public
static
debug
(
tag
,
...
args
:
any
[])
{
console
.
debug
(
`
${
TAG
}
.
${
tag
}
:
${
args
.
join
(
''
)}
`
)
}
public
static
warn
(
tag
,
...
args
:
any
[])
{
console
.
warn
(
`
${
TAG
}
.
${
tag
}
:
${
args
.
join
(
''
)}
`
)
}
public
static
error
(
tag
,
...
args
:
any
[])
{
console
.
error
(
`
${
TAG
}
.
${
tag
}
:
${
args
.
join
(
''
)}
`
)
}
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/pages/index.ets
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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 UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'
import commonEventManager from '@ohos.commonEventManager'
import Logger from '../model/Logger'
const TAG: string = '[UIExtAbility]'
const sleepTimeOne = 1000;
let storage = LocalStorage.GetShared()
@Entry(storage)
@Component
struct Index {
@State message: string = 'UIExtension'
private session: UIExtensionContentSession = storage.get<UIExtensionContentSession>('session');
aboutToAppear() {
let appearEvent = 'ACTS_UIExtension_AboutToAppear';
let terminateSelfWithResultEvent = 'ACTS_UIExtension_TerminateSelfWithResult';
let sendDataEvent = 'ACTS_UIExtension_SendData';
var subscriber;
var subscribeInfo = {
events: [terminateSelfWithResultEvent, sendDataEvent]
}
commonEventManager.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
subscriber = data;
commonEventManager.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event == terminateSelfWithResultEvent) {
this.session.terminateSelfWithResult({
"resultCode": 0,
"want": {
"bundleName": "test"
}
});
commonEventManager.unsubscribe(subscriber, async (err, data) => {
console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
});
} else if (data.event == sendDataEvent) {
this.session.sendData({
name: {
last: 'King'
}
});
commonEventManager.unsubscribe(subscriber, async (err, data) => {
console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
});
}
});
}).catch((error) => {
console.log(TAG + "createSubscriber error : " + JSON.stringify(error));
})
setTimeout(async () => {
commonEventManager.publish(appearEvent, (err) => {
if (err) {
Logger.log(TAG + `publish ACTS_UIExtension_AboutToAppear failed, code is ${err.code}, message is ${err.message}`);
} else {
Logger.log(TAG + 'publish ACTS_UIExtension_AboutToAppear success');
}
});
}, sleepTimeOne);
}
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/module.json
0 → 100644
浏览文件 @
bbaff12e
{
"module"
:
{
"name"
:
"entry"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/MyAbilityStage.ts"
,
"description"
:
"$string:entry_desc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[
{
"name"
:
"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
,
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
]
}
],
"extensionAbilities"
:
[
{
"name"
:
"UIExtAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"UIExtAbility"
,
"type"
:
"ui"
,
"visible"
:
true
,
"srcEntrance"
:
"./ets/UIExtensionAbility/UIExtAbility.ts"
,
"metadata"
:
[
{
"name"
:
"ohos.extension.servicetype"
,
"value"
:
"share"
}
]
}
]
}
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
bbaff12e
{
"color"
:
[
{
"name"
:
"white"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
bbaff12e
{
"string"
:
[
{
"name"
:
"entry_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
bbaff12e
6.6 KB
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
bbaff12e
{
"src"
:
[
"pages/index"
]
}
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
bbaff12e
文件已添加
ability/ability_runtime/actsuiextensiontest/uiextensiontest/AppScope/app.json
0 → 100644
浏览文件 @
bbaff12e
{
"app"
:
{
"bundleName"
:
"com.example.uiextensiontest"
,
"vendor"
:
"example"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
,
"distributedNotificationEnabled"
:
true
,
"minAPIVersion"
:
10
,
"targetAPIVersion"
:
10
}
}
ability/ability_runtime/actsuiextensiontest/uiextensiontest/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
bbaff12e
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"UIExtensionTest"
}
]
}
ability/ability_runtime/actsuiextensiontest/uiextensiontest/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
bbaff12e
6.6 KB
ability/ability_runtime/actsuiextensiontest/uiextensiontest/BUILD.gn
0 → 100644
浏览文件 @
bbaff12e
# Copyright (c) 2023 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("UIExtensionTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":uiextensiontest_js_assets",
":uiextensiontest_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "UIExtensionTest"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("uiextensiontest_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("uiextensiontest_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("uiextensiontest_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":uiextensiontest_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
ability/ability_runtime/actsuiextensiontest/uiextensiontest/Test.json
0 → 100644
浏览文件 @
bbaff12e
{
"description"
:
"Configuration for aceceshi Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"bundle-name"
:
"com.example.uiextensiontest"
,
"module-name"
:
"entry"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
"30000"
},
"kits"
:
[
{
"test-file-name"
:
[
"UIExtensionTest.hap"
,
"UIextensionProvider.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/Application/TestAbilityStage.ts
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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
AbilityStage
from
"
@ohos.app.ability.UIAbility
"
export
default
class
TestAbilityStage
extends
AbilityStage
{
onCreate
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
TestAbilityStage onCreate
'
);
}
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/TestAbility/TestAbility.ets
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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 Ability from '@ohos.app.ability.UIAbility'
import Window from '@ohos.window'
export default class TestAbility extends Ability {
onCreate(want, launchParam) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
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) ?? '');
}
onDestroy() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}
onWindowStageCreate(windowStage: Window.WindowStage) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
windowStage.loadContent('TestAbility/pages/index', (err, data) => {
if (err.code) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR);
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
JSON.stringify(data) ?? '');
});
globalThis.abilityContext = this.context;
}
onWindowStageDestroy() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}
onForeground() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}
onBackground() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../test/List.test'
@Entry
@Component
struct Index {
@State message: string = 'Index'
aboutToAppear() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear');
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', '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
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/TestAbility/pages/p1.ets
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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 commonEventManager from '@ohos.commonEventManager'
const TAG: string = '[P1]'
@Entry
@Component
struct P1 {
aboutToAppear() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear');
}
build() {
Row() {
Column() {
UIExtensionComponent({
bundleName: 'com.example.uiextensionprovider',
abilityName: 'UIExtAbility'
}).width('100%').height('35%')
.onResult((data)=>{
let onResultEvent = 'ACTS_UIExtension_OnResult';
let options = {
parameters: {
'result': data
}
}
commonEventManager.publish(onResultEvent, options, (err) => {
console.log(TAG + 'ACTS_UIExtension_OnResult');
});
})
.onReceive((data)=>{
let onReceiveEvent = 'ACTS_UIExtension_OnReceive';
let options = {
parameters: {
'result': data
}
}
commonEventManager.publish(onReceiveEvent, options, (err) => {
console.log(TAG + 'ACTS_UIExtension_OnReceive');
});
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
onAbilityCreateCallback
'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
addAbilityMonitorCallback : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner OnPrepare
'
);
}
async
onRun
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun run
'
);
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.TestAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a TestAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
'
-D
'
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
cmd : %{public}s
'
,
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : err : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
stdResult
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
exitCode
??
''
);
})
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun end
'
);
}
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/test/Ability.test.ets
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import commonEventManager from '@ohos.commonEventManager'
import router from '@ohos.router'
import Utils from './Utils'
export default function abilityTest() {
describe('ACTS_UIExtension', function () {
let TAG = "";
let sleepTimeOne = 1000;
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(function () {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
})
beforeEach(async function (done) {
console.info("ACTS_UIExtension beforeEach start");
let options = {
url: 'TestAbility/pages/p1',
}
let result;
try {
result = await router.pushUrl(options);
await Utils.sleep(500);
console.info("ACTS_UIExtension push page result: " + JSON.stringify(result));
} catch (err) {
console.error("ACTS_UIExtension push page error: " + err);
}
done()
});
afterEach(async function (done) {
router.back()
await Utils.sleep(500);
done()
})
afterAll(function () {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
})
it('ACTS_UIExtension_TerminateSelfWithResult_001',0, async function (done) {
TAG = 'ACTS_UIExtension_TerminateSelfWithResult_001 == ';
console.log(TAG + "begin");
let appearEvent = 'ACTS_UIExtension_AboutToAppear';
let onResultEvent = 'ACTS_UIExtension_OnResult';
let terminateSelfWithResultEvent = 'ACTS_UIExtension_TerminateSelfWithResult';
var subscriber;
var subscribeInfo = {
events: [appearEvent, onResultEvent]
}
await commonEventManager.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
subscriber = data;
commonEventManager.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event == appearEvent) {
commonEventManager.publish(terminateSelfWithResultEvent, (err) => {
if (err) {
console.log(TAG + `publish ACTS_UIExtension_TerminateSelfWithResult failed, code is ${err.code}, message is ${err.message}`);
} else {
console.log(TAG + 'publish ACTS_UIExtension_TerminateSelfWithResult success');
}
});
} else if (data.event == onResultEvent) {
let result = data.parameters.result;
setTimeout(async () => {
commonEventManager.unsubscribe(subscriber, async (err, data) => {
console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
expect(result.want.bundleName).assertEqual('test');
done();
});
}, sleepTimeOne);
}
});
}).catch((error) => {
console.log(TAG + "createSubscriber err : " + JSON.stringify(error));
expect().assertFail();
done();
})
})
it('ACTS_UIExtension_UIExtensionSendData_001',0, async function (done) {
TAG = 'ACTS_UIExtension_UIExtensionSendData_001 == ';
console.log(TAG + "begin");
let appearEvent = 'ACTS_UIExtension_AboutToAppear';
let onReceiveEvent = 'ACTS_UIExtension_OnReceive';
let sendDataEvent = 'ACTS_UIExtension_SendData';
var subscriber;
var subscribeInfo = {
events: [appearEvent, onReceiveEvent]
}
await commonEventManager.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
subscriber = data;
commonEventManager.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event == appearEvent) {
commonEventManager.publish(sendDataEvent, (err) => {
if (err) {
console.log(TAG + `publish ACTS_UIExtension_SendData failed, code is ${err.code}, message is ${err.message}`);
} else {
console.log(TAG + 'publish ACTS_UIExtension_SendData success');
}
});
} else if (data.event == onReceiveEvent) {
let result = data.parameters.result;
let resultCheck = {
name: {
last: 'King'
}
};
setTimeout(async () => {
commonEventManager.unsubscribe(subscriber, async (err, data) => {
console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
expect(JSON.stringify(result)).assertEqual(JSON.stringify(resultCheck));
done();
});
}, sleepTimeOne);
}
});
}).catch((error) => {
console.log(TAG + "createSubscriber err : " + JSON.stringify(error));
expect().assertFail();
done();
})
})
})
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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 abilityTest from './Ability.test'
export default function testsuite() {
abilityTest()
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/ets/test/Utils.ets
0 → 100644
浏览文件 @
bbaff12e
/*
* Copyright (c) 2023 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.
*/
export default class Utils {
static sleep(time) {
return new Promise<void>((resolve, reject) => {
setTimeout(() => {
resolve()
}, time)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/module.json
0 → 100644
浏览文件 @
bbaff12e
{
"module"
:
{
"name"
:
"entry"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/TestAbilityStage.ts"
,
"description"
:
"$string:entry_test_desc"
,
"mainElement"
:
"TestAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:test_pages"
,
"abilities"
:
[
{
"name"
:
"TestAbility"
,
"srcEntrance"
:
"./ets/TestAbility/TestAbility.ets"
,
"description"
:
"$string:TestAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:TestAbility_label"
,
"visible"
:
true
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:white"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}
]
}
]
}
}
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
bbaff12e
{
"color"
:
[
{
"name"
:
"white"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
bbaff12e
{
"string"
:
[
{
"name"
:
"entry_test_desc"
,
"value"
:
"test ability description"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"the test ability"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"test label"
}
]
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
bbaff12e
6.6 KB
ability/ability_runtime/actsuiextensiontest/uiextensiontest/entry/src/main/resources/base/profile/test_pages.json
0 → 100644
浏览文件 @
bbaff12e
{
"src"
:
[
"TestAbility/pages/index"
,
"TestAbility/pages/p1"
]
}
ability/ability_runtime/actsuiextensiontest/uiextensiontest/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
bbaff12e
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录