Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6afa77f8
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看板
提交
6afa77f8
编写于
6月 30, 2022
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
XTS元能力用例整改
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
e22e5719
变更
35
隐藏空白更改
内联
并排
Showing
35 changed file
with
0 addition
and
1328 deletion
+0
-1328
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/app.json
...tsusers/actsextensionconnectabilitytest/AppScope/app.json
+0
-21
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json
...ctabilitytest/AppScope/resources/base/element/string.json
+0
-8
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/media/app_icon.png
...ectabilitytest/AppScope/resources/base/media/app_icon.png
+0
-0
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/BUILD.gn
...untime/actsusers/actsextensionconnectabilitytest/BUILD.gn
+0
-41
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/Test.json
...ntime/actsusers/actsextensionconnectabilitytest/Test.json
+0
-42
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts
...bilitytest/entry/src/main/ets/Application/AbilityStage.ts
+0
-25
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts
...abilitytest/entry/src/main/ets/MainAbility/MainAbility.ts
+0
-55
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
...ytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
+0
-81
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/service.ts
...tabilitytest/entry/src/main/ets/ServiceAbility/service.ts
+0
-25
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts
...est/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts
+0
-77
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/service.ts
...abilitytest/entry/src/main/ets/ServiceAbility2/service.ts
+0
-25
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/index/index.ets
...nnectabilitytest/entry/src/main/ets/pages/index/index.ets
+0
-52
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/second/second.ets
...ectabilitytest/entry/src/main/ets/pages/second/second.ets
+0
-43
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets
...nconnectabilitytest/entry/src/main/ets/test/List.test.ets
+0
-19
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets
...rc/main/ets/test/actsextensionconnectabilitytest.test.ets
+0
-291
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json
...ctsextensionconnectabilitytest/entry/src/main/module.json
+0
-100
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json
...itytest/entry/src/main/resources/base/element/string.json
+0
-32
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/media/icon.png
...tabilitytest/entry/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+0
-6
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/signature/openharmony_sx.p7b
...sextensionconnectabilitytest/signature/openharmony_sx.p7b
+0
-0
ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/app.json
...me/actsusers/actsserviceabilityrelytest/AppScope/app.json
+0
-21
ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/element/string.json
...ilityrelytest/AppScope/resources/base/element/string.json
+0
-8
ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/media/app_icon.png
...bilityrelytest/AppScope/resources/base/media/app_icon.png
+0
-0
ability/ability_runtime/actsusers/actsserviceabilityrelytest/BUILD.gn
...ity_runtime/actsusers/actsserviceabilityrelytest/BUILD.gn
+0
-45
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/Application/AbilityStage.ts
...tyrelytest/entry/src/main/ets/Application/AbilityStage.ts
+0
-9
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/MainAbility/MainAbility.ts
...ityrelytest/entry/src/main/ets/MainAbility/MainAbility.ts
+0
-45
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
...ytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
+0
-50
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/service.ts
...lityrelytest/entry/src/main/ets/ServiceAbility/service.ts
+0
-28
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/index/index.ets
...eabilityrelytest/entry/src/main/ets/pages/index/index.ets
+0
-49
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/second/second.ets
...bilityrelytest/entry/src/main/ets/pages/second/second.ets
+0
-43
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/module.json
...ers/actsserviceabilityrelytest/entry/src/main/module.json
+0
-49
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/element/string.json
...elytest/entry/src/main/resources/base/element/string.json
+0
-32
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/media/icon.png
...lityrelytest/entry/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+0
-6
ability/ability_runtime/actsusers/actsserviceabilityrelytest/signature/openharmony_sx.p7b
...s/actsserviceabilityrelytest/signature/openharmony_sx.p7b
+0
-0
未找到文件。
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/app.json
已删除
100644 → 0
浏览文件 @
e22e5719
{
"app"
:
{
"bundleName"
:
"com.example.actsextensionconnectabilitytest"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
8
,
"targetAPIVersion"
:
8
,
"car"
:
{
"apiCompatibleVersion"
:
8
,
"singleUser"
:
false
}
}
}
\ No newline at end of file
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
e22e5719
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/media/app_icon.png
已删除
100644 → 0
浏览文件 @
e22e5719
6.6 KB
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/BUILD.gn
已删除
100644 → 0
浏览文件 @
e22e5719
# 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsExtensionConnectAbilityTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":actsextensionconnectabilitytest_js_assets",
":actsextensionconnectabilitytest_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsExtensionConnectAbilityTest"
}
ohos_app_scope("actsextensionconnectabilitytest_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("actsextensionconnectabilitytest_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("actsextensionconnectabilitytest_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":actsextensionconnectabilitytest_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/Test.json
已删除
100644 → 0
浏览文件 @
e22e5719
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"120000"
,
"package"
:
"com.example.actsextensionconnectabilitytest"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"acm create -n 101 -t normal"
,
"acm switch -i 101"
],
"teardown-command"
:[
"acm delete -i 101"
]
},
{
"test-file-name"
:
[
"ActsExtensionConnectAbilityTest.hap"
,
"actsServiceAbilityRelyHap.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"PushKit"
,
"push"
:
[
"actsServiceAbilityRelyHap.hap->/data/app/actsServiceAbilityRelyHap.hap"
]
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"chmod 777 /data/app/*.hap"
]
}
]
}
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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
AbilityStage
from
"
@ohos.application.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
startnum
=
0
globalThis
.
stageContext
=
this
.
context
;
}
}
\ No newline at end of file
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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.application.Ability
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
// Ability is creating, initialize resources for this ability
console
.
log
(
"
AbilityMultiInstanceTest onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
AbilityMultiInstanceTest onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
AbilityMultiInstanceTest onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
log
(
"
AbilityMultiInstanceTest onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
AbilityMultiInstanceTest onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
AbilityMultiInstanceTest onBackground
"
)
}
};
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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
ServiceExtensionAbility
from
'
@ohos.application.ServiceExtensionAbility
'
import
commonEvent
from
'
@ohos.commonEvent
'
import
Want
from
'
@ohos.application.Want
'
;
import
rpc
from
'
@ohos.rpc
'
;
function
publishCallBackOne
()
{
console
.
log
(
"
========Publish CallBack AMS_ConnectAbility_0300_commonEvent========
"
);
}
function
onConnectCallback
(
element
)
{
console
.
log
(
'
connectAbilityWithAccount onConnect element.bundleName :
'
+
element
.
bundleName
)
console
.
log
(
'
connectAbilityWithAccount onConnect element.abilityName :
'
+
element
.
abilityName
)
}
function
onDisconnectCallback
(
element
)
{
console
.
log
(
'
connectAbilityWithAccount onDisconnect element.bundleName :
'
+
element
.
bundleName
)
console
.
log
(
'
connectAbilityWithAccount onDisconnect element.abilityName :
'
+
element
.
abilityName
)
}
function
onFailedCallback
(
code
)
{
console
.
log
(
'
connectAbilityWithAccount onFailed errCode :
'
+
code
)
}
var
conn
=
-
1
;
export
default
class
ServiceAbility
extends
ServiceExtensionAbility
{
onCreate
(
want
)
{
console
.
log
(
'
ServiceAbility onCreate, want:
'
+
want
.
abilityName
);
}
onRequest
(
want
,
startId
)
{
console
.
log
(
'
ServiceAbility onRequest, want:
'
+
want
.
abilityName
+
'
, startId:
'
+
startId
);
console
.
log
(
'
ServiceAbility registerApplicationStateObserver begin
'
);
console
.
log
(
'
ServiceAbility registerApplicationStateObserver end, conn:
'
+
conn
);
}
onConnect
(
want
:
Want
)
{
console
.
log
(
'
ServiceAbility onConnect, want:
'
+
want
.
abilityName
);
let
extensionContext
=
this
.
context
if
(
want
.
action
==
"
Three
"
)
{
console
.
log
(
'
connectAbility 111
'
);
let
num
=
extensionContext
.
connectAbility
(
{
bundleName
:
'
com.example.actsserviceabilityrelytest
'
,
abilityName
:
'
com.example.actsserviceabilityrelytest.ServiceAbility
'
},
{
onConnect
:
onConnectCallback
,
onDisconnect
:
onDisconnectCallback
,
onFailed
:
onFailedCallback
,
},)
setTimeout
(()
=>
{
extensionContext
.
disconnectAbility
(
num
).
then
(()
=>
{
console
.
log
(
'
in disconnectAbility
'
);
})
},
1000
)
};
commonEvent
.
publish
(
"
AMS_ConnectAbility_0300_commonEvent
"
,
publishCallBackOne
);
return
new
rpc
.
RemoteObject
(
'
connect
'
);
};
onDisconnect
(
want
)
{
console
.
log
(
'
ServiceAbility onDisconnect, want:
'
+
want
.
abilityName
);
}
onDestroy
()
{
console
.
log
(
'
ServiceAbility onDestroy
'
);
}
}
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/service.ts
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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.
*/
export
default
{
onStart
()
{
console
.
info
(
'
ServiceAbility onStart
'
);
},
onStop
()
{
console
.
info
(
'
ServiceAbility onStop
'
);
},
onCommand
(
want
,
startId
)
{
console
.
info
(
'
ServiceAbility onCommand
'
);
}
};
\ No newline at end of file
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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
ServiceExtensionAbility
from
'
@ohos.application.ServiceExtensionAbility
'
import
commonEvent
from
'
@ohos.commonEvent
'
import
Want
from
'
@ohos.application.Want
'
;
import
rpc
from
'
@ohos.rpc
'
;
function
publishCallBackOne
()
{
console
.
log
(
"
========Publish CallBack AMS_ConnectAbility_0400_commonEvent========
"
);
}
var
conn
=
-
1
;
function
onConnectCallback
(
element
)
{
console
.
log
(
'
connectAbilityWithAccount onConnect element.bundleName :
'
+
element
.
bundleName
)
console
.
log
(
'
connectAbilityWithAccount onConnect element.abilityName :
'
+
element
.
abilityName
)
}
function
onDisconnectCallback
(
element
)
{
console
.
log
(
'
connectAbilityWithAccount onDisconnect element.bundleName :
'
+
element
.
bundleName
)
console
.
log
(
'
connectAbilityWithAccount onDisconnect element.abilityName :
'
+
element
.
abilityName
)
}
function
onFailedCallback
(
code
)
{
console
.
log
(
'
connectAbilityWithAccount onFailed errCode :
'
+
code
)
}
export
default
class
ServiceAbility2
extends
ServiceExtensionAbility
{
onCreate
(
want
)
{
console
.
log
(
'
ServiceAbility onCreate, want:
'
+
want
.
abilityName
);
}
onRequest
(
want
,
startId
)
{
console
.
log
(
'
ServiceAbility onRequest, want:
'
+
want
.
abilityName
+
'
, startId:
'
+
startId
);
console
.
log
(
'
ServiceAbility registerApplicationStateObserver begin
'
);
console
.
log
(
'
ServiceAbility registerApplicationStateObserver end, conn:
'
+
conn
);
}
onConnect
(
want
:
Want
)
{
console
.
log
(
'
ServiceAbility onConnect, want:
'
+
want
.
abilityName
);
let
extensionContext
=
this
.
context
console
.
log
(
'
connectAbility 222
'
);
let
num
=
extensionContext
.
connectAbility
(
{
bundleName
:
'
com.example.actsserviceabilityrelytest
'
,
abilityName
:
'
com.example.actsserviceabilityrelytest.ServiceAbility
'
},
{
onConnect
:
onConnectCallback
,
onDisconnect
:
onDisconnectCallback
,
onFailed
:
onFailedCallback
,
},)
setTimeout
(()
=>
{
extensionContext
.
disconnectAbility
(
num
).
then
(()
=>
{
console
.
log
(
'
in disconnectAbility2
'
);
})
},
1000
)
commonEvent
.
publish
(
"
AMS_ConnectAbility_0400_commonEvent
"
,
publishCallBackOne
);
return
new
rpc
.
RemoteObject
(
'
connect
'
);
};
onDisconnect
(
want
)
{
console
.
log
(
'
ServiceAbility onDisconnect, want:
'
+
want
.
abilityName
);
}
onDestroy
()
{
console
.
log
(
'
ServiceAbility onDestroy
'
);
}
}
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/service.ts
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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.
*/
export
default
{
onStart
()
{
console
.
info
(
'
ServiceAbility onStart
'
);
},
onStop
()
{
console
.
info
(
'
ServiceAbility onStop
'
);
},
onCommand
(
want
,
startId
)
{
console
.
info
(
'
ServiceAbility onCommand
'
);
}
};
\ No newline at end of file
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/index/index.ets
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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 file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
import testsuite from "../../test/List.test.ets"
@Entry
@Component
struct Index {
aboutToAppear() {
console.info("start run testcase!!!!")
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
const reportExtend = new ReportExtend(file)
core.addService('report', reportExtend)
core.init()
core.subscribeEvent('task', reportExtend)
const configService = core.getDefaultService('config')
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters))
configService.setConfig(globalThis.abilityWant.parameters)
testsuite(globalThis.abilityContext)
core.execute()
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World1111111')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/second/second.ets
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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 router from '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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 abilityTest from './actsextensionconnectabilitytest.test.ets'
export default function testsuite(context) {
abilityTest(context)
}
\ No newline at end of file
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"
import commonEvent from '@ohos.commonEvent'
var subscriberInfoStartAbility_0100 = {
events: ["AMS_ConnectAbility_0100_commonEvent"],
};
var subscriberInfoStartAbility_0200 = {
events: ["AMS_ConnectAbility_0200_commonEvent"],
};
var subscriberInfoStartAbility_0300 = {
events: ["AMS_ConnectAbility_0300_commonEvent"],
};
var subscriberInfoStartAbility_0400 = {
events: ["AMS_ConnectAbility_0400_commonEvent"],
};
const START_ABILITY_TIMEOUT = 5000;
globalThis.number = 0;
export default function abilityTest(abilityContext) {
describe('ActsExtensionConnectAbilityTest', function () {
it('ACTS_ConnectAbility_0300', 0, async function (done) {
console.log('ACTS_ConnectAbility_0300====<begin');
console.log('========ACTS_ConnectAbility_0300 1 called');
var subscriber;
let id;
let connId;
function subscribeCallBack(err, data) {
console.debug("====>ACTS_ConnectAbility_0300 7 CallBack data:====>" + JSON.stringify(data));
clearTimeout(id);
expect(data.event).assertEqual("AMS_ConnectAbility_0100_commonEvent");
console.debug("====>ACTS_ConnectAbility_0300 5 ");
abilityContext.disconnectAbility(
connId,
(err, data) => {
console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data)
}
);
console.debug("====>ACTS_ConnectAbility_0300 6 ");
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
}
commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => {
console.debug("====>ACTS_ConnectAbility_0300 2 Subscriber1====>");
subscriber = data;
await commonEvent.subscribe(subscriber, subscribeCallBack)
connId = await abilityContext.connectAbility({
bundleName: "com.example.actsserviceabilityrelytest",
abilityName: "com.example.actsserviceabilityrelytest.ServiceAbility",
}, (err, data) => {
console.log('ACTS_ProcessManage SystemAppA onShowProcess startAbility startServiceAbility: '
+ JSON.stringify(err) + ", " + JSON.stringify(data))
})
})
function unSubscribeCallback() {
console.debug("====>UnSubscribe CallBack1====>");
setTimeout(() => {
done();
}, 1000)
}
function timeout() {
expect().assertFail();
console.debug('ACTS_ConnectAbility_0300 timeout');
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
abilityContext.disconnectAbility(
connId,
(err, data) => {
console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data)
});
}
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
console.debug("====>ACTS_ConnectAbility_0300 4 ");
})
it('ACTS_ConnectAbility_0400', 0, async function (done) {
console.log('ACTS_ConnectAbility_0400====<begin');
console.log('========ACTS_ConnectAbility_0400 1 called');
var subscriber;
let id;
let connId;
function subscribeCallBack(err, data) {
console.debug("====>ACTS_ConnectAbility_0400 7 CallBack data:====>" + JSON.stringify(data));
clearTimeout(id);
expect(data.event).assertEqual("AMS_ConnectAbility_0200_commonEvent");
console.debug("====>ACTS_ConnectAbility_0400 5 ");
abilityContext.disconnectAbility(
connId,
(err, data) => {
console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data)
}
);
console.debug("====>ACTS_ConnectAbility_0400 6 ");
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
}
commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => {
console.debug("====>ACTS_ConnectAbility_0400 2 Subscriber1====>");
subscriber = data;
await commonEvent.subscribe(subscriber, subscribeCallBack);
console.debug("====>ACTS_ConnectAbility_0400 3 ");
connId = await abilityContext.connectAbility({
bundleName: "com.example.actsserviceabilityrelytest",
abilityName: "com.example.actsserviceabilityrelytest.ServiceAbility",
}, (err, data) => {
console.log('ACTS_ProcessManage SystemAppA onShowProcess startAbility startServiceAbility: '
+ JSON.stringify(err) + ", " + JSON.stringify(data))
})
console.debug("====>ACTS_ConnectAbility_0400 4 ");
})
function unSubscribeCallback() {
console.debug("====>UnSubscribe CallBack1====>");
setTimeout(() => {
done();
}, 1000)
}
function timeout() {
expect().assertFail();
console.debug('ACTS_ConnectAbility_0400 timeout');
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
abilityContext.disconnectAbility(
connId,
(err, data) => {
console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data)
});
}
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
})
it('ACTS_ExtensionConnectAbility_0300', 0, async function (done) {
console.log('ACTS_ExtensionConnectAbility_0300====<begin');
console.log('========ACTS_ExtensionConnectAbility_0300 1 called');
var subscriber;
let id;
let connId;
function subscribeCallBack(err, data) {
console.debug("====>ACTS_ExtensionConnectAbility_0300 7 CallBack data:====>" + JSON.stringify(data));
clearTimeout(id);
expect(data.event).assertEqual("AMS_ConnectAbility_0300_commonEvent");
console.debug("====>ACTS_ExtensionConnectAbility_0300 5 ");
abilityContext.disconnectAbility(
connId,
(error, data) => {
console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data)
}
);
console.debug("====>ACTS_ExtensionConnectAbility_0300 6 ");
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
}
commonEvent.createSubscriber(subscriberInfoStartAbility_0300).then(async (data) => {
console.debug("====>ACTS_ExtensionConnectAbility_0300 2 Subscriber1====>");
subscriber = data;
await commonEvent.subscribe(subscriber, subscribeCallBack);
connId = await abilityContext.connectAbility(
{
bundleName: "com.example.actsextensionconnectabilitytest",
abilityName: "com.example.actsextensionconnectabilitytest.ServiceAbility",
action:"Three",
}).then(()=>{
console.debug("====>startAbility end====>");
})
console.debug("====>ACTS_ExtensionConnectAbility_0300 4 ");
})
function unSubscribeCallback() {
console.debug("====>UnSubscribe CallBack1====>");
setTimeout(() => {
done();
}, 1000)
}
function timeout() {
expect().assertFail();
console.debug('ACTS_ExtensionConnectAbility_0300 timeout');
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
abilityContext.disconnectAbility(
connId,
(error, data) => {
console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data)
});
}
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
console.debug("====>ACTS_ExtensionConnectAbility_0300 3 ");
})
it('ACTS_ExtensionConnectAbility_0400', 0, async function (done) {
console.log('ACTS_ExtensionConnectAbility_0400====<begin');
console.log('========ACTS_ExtensionConnectAbility_0400 1 called');
var subscriber;
let id;
let connId;
function subscribeCallBack(err, data) {
console.debug("====>ACTS_ExtensionConnectAbility_0400 7 CallBack data:====>" + JSON.stringify(data));
clearTimeout(id);
expect(data.event).assertEqual("AMS_ConnectAbility_0400_commonEvent");
console.debug("====>ACTS_ExtensionConnectAbility_0400 5 ");
abilityContext.disconnectAbility(
connId,
(error, data) => {
console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data)
}
);
console.debug("====>ACTS_ExtensionConnectAbility_0400 6 ");
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
}
commonEvent.createSubscriber(subscriberInfoStartAbility_0400).then(async (data) => {
console.debug("====>ACTS_ExtensionConnectAbility_0400 2 Subscriber1====>");
subscriber = data;
await commonEvent.subscribe(subscriber, subscribeCallBack);
console.debug("====>ACTS_ExtensionConnectAbility_0400 3 ");
connId = await abilityContext.connectAbility(
{
bundleName: "com.example.actsextensionconnectabilitytest",
abilityName: "com.example.actsextensionconnectabilitytest.ServiceAbility2",
action:"Four",
},
);
console.debug("====>ACTS_ExtensionConnectAbility_0400 4 ");
})
function unSubscribeCallback() {
console.debug("====>UnSubscribe CallBack1====>");
setTimeout(() => {
done();
}, 1000)
}
function timeout() {
expect().assertFail();
console.debug('ACTS_ExtensionConnectAbility_0400 timeout');
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
abilityContext.disconnectAbility(
connId,
(error, data) => {
console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data)
});
}
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
})
})
}
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json
已删除
100644 → 0
浏览文件 @
e22e5719
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[
{
"name"
:
"com.example.actsextensionconnectabilitytest.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}
]
}
],
"extensionAbilities"
:
[
{
"srcEntrance"
:
"./ets/ServiceAbility/ServiceAbility.ts"
,
"name"
:
"com.example.actsextensionconnectabilitytest.ServiceAbility"
,
"icon"
:
"$media:icon"
,
"srcLanguage"
:
"ets"
,
"description"
:
"$string:phone_entry_main"
,
"type"
:
"service"
,
"visible"
:
true
},
{
"srcEntrance"
:
"./ets/ServiceAbility2/ServiceAbility2.ts"
,
"name"
:
"com.example.actsextensionconnectabilitytest.ServiceAbility2"
,
"icon"
:
"$media:icon"
,
"srcLanguage"
:
"ets"
,
"description"
:
"$string:phone_entry_main"
,
"type"
:
"service"
,
"visible"
:
true
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
,
"reason"
:
"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO"
,
"reason"
:
"need use ohos.permission.GET_BUNDLE_INFO"
},
{
"name"
:
"ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
,
"reason"
:
"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name"
:
"ohos.permission.REMOVE_CACHE_FILES"
,
"reason"
:
"need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name"
:
"ohos.permission.LISTEN_BUNDLE_CHANGE"
,
"reason"
:
"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
},
{
"name"
:
"ohos.permission.INSTALL_BUNDLE"
,
"reason"
:
"need use ohos.permission.INSTALL_BUNDLE"
},
{
"name"
:
"ohos.permission.MANAGE_MISSIONS"
,
"reason"
:
"need use ohos.permission.MANAGE_MISSIONS"
},
{
"name"
:
"ohos.permission.GET_RUNNING_INFO"
,
"reason"
:
"need use ohos.permission.GET_RUNNING_INFO"
},
{
"name"
:
"ohos.permission.CLEAN_BACKGROUND_PROCESSES"
,
"reason"
:
"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
},
{
"name"
:
"ohos.permission.CLEAN_APPLICATION_DATA"
,
"reason"
:
"need use ohos.permission.CLEAN_APPLICATION_DATA"
}
]
}
}
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
e22e5719
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
\ No newline at end of file
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/media/icon.png
已删除
100644 → 0
浏览文件 @
e22e5719
6.6 KB
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/profile/main_pages.json
已删除
100644 → 0
浏览文件 @
e22e5719
{
"src"
:
[
"pages/index/index"
,
"pages/second/second"
]
}
\ No newline at end of file
ability/ability_runtime/actsusers/actsextensionconnectabilitytest/signature/openharmony_sx.p7b
已删除
100644 → 0
浏览文件 @
e22e5719
文件已删除
ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/app.json
已删除
100644 → 0
浏览文件 @
e22e5719
{
"app"
:{
"bundleName"
:
"com.example.actsserviceabilityrelytest"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
8
,
"targetAPIVersion"
:
8
,
"car"
:{
"apiCompatibleVersion"
:
8
,
"singleUser"
:
false
}
}
}
ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
e22e5719
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/media/app_icon.png
已删除
100644 → 0
浏览文件 @
e22e5719
15.1 KB
ability/ability_runtime/actsusers/actsserviceabilityrelytest/BUILD.gn
已删除
100644 → 0
浏览文件 @
e22e5719
# 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("//test/xts/tools/build/suite.gni")
ohos_hap("actsServiceAbilityRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "actsServiceAbilityRelyHap"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":actsserviceabilityrelytest_js_assets",
":actsserviceabilityrelytest_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
}
ohos_app_scope("actsserviceabilityrelytest_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("actsserviceabilityrelytest_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("actsserviceabilityrelytest_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":actsserviceabilityrelytest_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/Application/AbilityStage.ts
已删除
100644 → 0
浏览文件 @
e22e5719
import
AbilityStage
from
"
@ohos.application.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/MainAbility/MainAbility.ts
已删除
100644 → 0
浏览文件 @
e22e5719
import
Ability
from
'
@ohos.application.Ability
'
import
commonEvent
from
'
@ohos.commonEvent
'
function
publishCallBackOne
()
{
console
.
log
(
"
========Publish CallBack AMS_ConnectAbility_0200_commonEvent========
"
);
}
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
// Ability is creating, initialize resources for this ability
console
.
log
(
"
AbilityMultiInstanceTest onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
AbilityMultiInstanceTest onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
AbilityMultiInstanceTest onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
log
(
"
AbilityMultiInstanceTest onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
AbilityMultiInstanceTest onForeground
"
)
commonEvent
.
publish
(
"
AMS_ConnectAbility_0200_commonEvent
"
,
publishCallBackOne
);
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
AbilityMultiInstanceTest onBackground
"
)
}
};
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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
ServiceExtensionAbility
from
'
@ohos.application.ServiceExtensionAbility
'
import
commonEvent
from
'
@ohos.commonEvent
'
import
Want
from
'
@ohos.application.Want
'
;
import
rpc
from
'
@ohos.rpc
'
;
function
publishCallBackOne
()
{
console
.
log
(
"
========Publish CallBack AMS_ConnectAbility_0100_commonEvent========
"
);
}
function
publishCallBackTwo
()
{
console
.
log
(
"
========Publish CallBack AMS_ConnectAbility_0200_commonEvent========
"
);
}
export
default
class
ServiceAbility
extends
ServiceExtensionAbility
{
onCreate
(
want
)
{
console
.
log
(
'
ServiceAbility onCreate, want:
'
+
want
.
abilityName
);
}
onRequest
(
want
,
startId
)
{
console
.
log
(
'
ServiceAbility onRequest, want:
'
+
want
.
abilityName
+
'
, startId:
'
+
startId
);
}
onConnect
(
want
:
Want
)
{
console
.
log
(
'
ServiceAbility onConnect, want:
'
+
want
.
abilityName
);
commonEvent
.
publish
(
"
AMS_ConnectAbility_0100_commonEvent
"
,
publishCallBackOne
);
commonEvent
.
publish
(
"
AMS_ConnectAbility_0200_commonEvent
"
,
publishCallBackTwo
);
return
new
rpc
.
RemoteObject
(
'
connect
'
);
};
onDisconnect
(
want
)
{
console
.
log
(
'
ServiceAbility onDisconnect, want:
'
+
want
.
abilityName
);
}
onDestroy
()
{
console
.
log
(
'
ServiceAbility onDestroy
'
);
}
}
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/service.ts
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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.
*/
export
default
{
onStart
()
{
console
.
info
(
'
ACTS_ProcessManage ServiceAbility onStart
'
);
},
onStop
()
{
console
.
info
(
'
ACTS_ProcessManage ServiceAbility onStop
'
);
},
onCommand
(
want
,
startId
)
{
console
.
info
(
'
ACTS_ProcessManage ServiceAbility onCommand
'
);
},
};
\ No newline at end of file
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/index/index.ets
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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 file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
@Entry
@Component
struct Index {
aboutToAppear(){
console.info("start run testcase!!!!")
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/second/second.ets
已删除
100644 → 0
浏览文件 @
e22e5719
/*
* 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 router from '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/module.json
已删除
100644 → 0
浏览文件 @
e22e5719
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[
{
"name"
:
"com.example.actsserviceabilityrelytest.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:[
"entity.system.home"
]
}
]
}
],
"extensionAbilities"
:
[
{
"srcEntrance"
:
"./ets/ServiceAbility/ServiceAbility.ts"
,
"name"
:
"com.example.actsserviceabilityrelytest.ServiceAbility"
,
"icon"
:
"$media:icon"
,
"srcLanguage"
:
"ets"
,
"description"
:
"$string:phone_entry_main"
,
"type"
:
"service"
,
"visible"
:
true
}
]
}
}
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
e22e5719
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/media/icon.png
已删除
100644 → 0
浏览文件 @
e22e5719
15.1 KB
ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/profile/main_pages.json
已删除
100644 → 0
浏览文件 @
e22e5719
{
"src"
:
[
"pages/index/index"
,
"pages/second/second"
]
}
\ No newline at end of file
ability/ability_runtime/actsusers/actsserviceabilityrelytest/signature/openharmony_sx.p7b
已删除
100644 → 0
浏览文件 @
e22e5719
文件已删除
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录