Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a9d0c554
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a9d0c554
编写于
7月 09, 2022
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
XTS元能力api覆盖
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
c5ff91ae
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
69 addition
and
141 deletion
+69
-141
aafwk/aafwk_standard/faapicover/faapicoverhaptest/entry/src/main/ets/test/VerificationTest.ets
...coverhaptest/entry/src/main/ets/test/VerificationTest.ets
+55
-2
aafwk/aafwk_standard/faapicover/faauxiliary/entry/src/main/config.json
...tandard/faapicover/faauxiliary/entry/src/main/config.json
+0
-27
aafwk/aafwk_standard/faapicover/faauxiliary/entry/src/main/ets/MainAbility6/app.ets
...cover/faauxiliary/entry/src/main/ets/MainAbility6/app.ets
+14
-18
aafwk/aafwk_standard/faapicover/faauxiliary/entry/src/main/ets/MainAbility7/app.ets
...cover/faauxiliary/entry/src/main/ets/MainAbility7/app.ets
+0
-55
aafwk/aafwk_standard/faapicover/faauxiliary/entry/src/main/ets/MainAbility7/pages/index.ets
...auxiliary/entry/src/main/ets/MainAbility7/pages/index.ets
+0
-31
aafwk/aafwk_standard/faapicover/faauxiliary/entry/src/main/resources/base/element/string.json
...xiliary/entry/src/main/resources/base/element/string.json
+0
-8
未找到文件。
aafwk/aafwk_standard/faapicover/faapicoverhaptest/entry/src/main/ets/test/VerificationTest.ets
浏览文件 @
a9d0c554
...
...
@@ -34,8 +34,6 @@ export default function verificationTest(){
TAG = 'SUB_AA_OpenHarmony_Test_HasWindowFocus_0100 ==>';
try {
let stageMode:any = ability_featureAbility.getContext
console.info(TAG + "stageMode = " + stageMode.stageMode)
let flags = false
let subscriber = null
let subscribeInfo = {
...
...
@@ -368,5 +366,60 @@ export default function verificationTest(){
done();
}
})
/*
* @tc.number SUB_AA_OpenHarmony_Test_TerminateSelfWithResult_0100
* @tc.name CTerminate ability through TerminateSelfWithResult.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_OpenHarmony_Test_TerminateSelfWithResult_0100', 0, async function(done) {
TAG = 'SUB_AA_OpenHarmony_Test_TerminateSelfWithResult_0100 ==>';
try {
let stageMode = ability_featureAbility.getContext().stageMode
let resultCode = undefined
let subscriber = null
let subscribeInfo = {
events: ["Fa_Auxiliary_MainAbility6_onDestroy"]
}
function SubscribeInfoCallback(err, data) {
console.info(TAG + "===SubscribeInfoCallback===" + JSON.stringify(data))
if (data.event == "Fa_Auxiliary_MainAbility6_onDestroy") {
setTimeout(()=>{
expect(stageMode).assertFalse()
expect(resultCode).assertEqual(661);
commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback)
}, 1000)
}
}
function UnSubscribeInfoCallback(err, data) {
console.info(TAG + "===UnSubscribeInfoCallback===")
done()
}
commonEvent.createSubscriber(subscribeInfo, (err, data) => {
console.info(TAG + "===CreateSubscriberCallback===")
subscriber = data
commonEvent.subscribe(subscriber, SubscribeInfoCallback)
})
let wantNum = {
want: {
bundleName: 'ohos.acts.aafwk.test.faauxiliary',
abilityName: 'ohos.acts.aafwk.test.faauxiliary.MainAbility6'
}
}
ability_featureAbility.startAbilityForResult(wantNum).then((data) => {
console.info(TAG + "startAbilityForResult data = " + JSON.stringify(data));
resultCode = data.resultCode
}).catch((err) => {
console.info(TAG + "startAbilityForResult err = " + JSON.stringify(err));
expect().assertFail();
done();
});
} catch (err) {
console.info(TAG + "getWindow catch err = " + JSON.stringify(err));
done();
}
})
})
}
aafwk/aafwk_standard/faapicover/faauxiliary/entry/src/main/config.json
浏览文件 @
a9d0c554
...
...
@@ -107,19 +107,6 @@
"type"
:
"page"
,
"launchType"
:
"singleton"
},
{
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"MainAbility7"
,
"name"
:
".MainAbility7"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:MainAbility7_desc"
,
"formsEnabled"
:
false
,
"label"
:
"$string:MainAbility7_label"
,
"type"
:
"page"
,
"launchType"
:
"singleton"
},
{
"srcPath"
:
"ServiceAbility"
,
"name"
:
".ServiceAbility"
,
...
...
@@ -232,20 +219,6 @@
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".MainAbility7"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
],
"reqPermissions"
:
[
...
...
aafwk/aafwk_standard/faapicover/faauxiliary/entry/src/main/ets/MainAbility6/app.ets
浏览文件 @
a9d0c554
...
...
@@ -21,9 +21,20 @@ export default {
onCreate() {
console.info(printLog1 + 'onCreate');
commonEvent.publish(listPush1 + "onCreate", (err) => {
console.info(printLog1 + listPush1 + "onCreate");
});
setTimeout(()=>{
let wantNum = {
want: {
bundleName: 'ohos.acts.aafwk.test.faauxiliary',
abilityName: 'ohos.acts.aafwk.test.faauxiliary.MainAbility'
},
resultCode: 661
}
ability_featureAbility.terminateSelfWithResult(wantNum).then((data) => {
console.info(printLog1 + "terminateSelfWithResult data = " + JSON.stringify(data));
}).catch((err) => {
console.info(printLog1 + "terminateSelfWithResult err = " + JSON.stringify(err));
});
}, 3000)
},
onDestroy() {
console.info(printLog1 + 'onDestroy');
...
...
@@ -51,20 +62,5 @@ export default {
commonEvent.publish(listPush1 + "onNewWant", (err) => {
console.info(printLog1 + listPush1 + "onNewWant");
});
setTimeout(()=>{
let wantNum = {
want: {
bundleName: 'ohos.acts.aafwk.test.faauxiliary',
abilityName: 'ohos.acts.aafwk.test.faauxiliary.MainAbility'
},
resultCode: 661
}
ability_featureAbility.terminateSelfWithResult(wantNum).then((data) => {
console.info(printLog1 + "terminateSelfWithResult data = " + JSON.stringify(data));
}).catch((err) => {
console.info(printLog1 + "terminateSelfWithResult err = " + JSON.stringify(err));
});
}, 3000)
}
}
\ No newline at end of file
aafwk/aafwk_standard/faapicover/faauxiliary/entry/src/main/ets/MainAbility7/app.ets
已删除
100644 → 0
浏览文件 @
c5ff91ae
/*
* 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_featureAbility from '@ohos.ability.featureAbility';
import commonEvent from '@ohos.commonEvent';
var printLog1 = "Fa:Auxiliary:MainAbility7:";
var listPush1 = "Fa_Auxiliary_MainAbility7_";
export default {
onCreate() {
console.info(printLog1 + 'onCreate');
commonEvent.publish(listPush1 + "onCreate", (err) => {
console.info(printLog1 + listPush1 + "onCreate");
});
setTimeout(()=>{
ability_featureAbility.terminateSelf().then((data) => {
console.info(printLog1 + "terminateSelf data = " + JSON.stringify(data));
}).catch((err) => {
console.info(printLog1 + "terminateSelf err = " + JSON.stringify(err));
});
}, 3000)
},
onDestroy() {
console.info(printLog1 + 'onDestroy');
commonEvent.publish(listPush1 + "onDestroy", (err) => {
console.info(printLog1 + listPush1 + "onDestroy");
});
},
onActive() {
console.info(printLog1 + 'onActive');
},
onInactive() {
console.info(printLog1 + 'onInactive');
},
onShow() {
console.info(printLog1 + 'onShow');
},
onHide() {
console.info(printLog1 + 'onHide');
}
}
\ No newline at end of file
aafwk/aafwk_standard/faapicover/faauxiliary/entry/src/main/ets/MainAbility7/pages/index.ets
已删除
100644 → 0
浏览文件 @
c5ff91ae
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct Index {
@State message: string = 'Hello World Test Fa 7'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
aafwk/aafwk_standard/faapicover/faauxiliary/entry/src/main/resources/base/element/string.json
浏览文件 @
a9d0c554
...
...
@@ -52,14 +52,6 @@
"name"
:
"MainAbility6_label"
,
"value"
:
"label"
},
{
"name"
:
"MainAbility7_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility7_label"
,
"value"
:
"label"
},
{
"name"
:
"ServiceAbility_desc"
,
"value"
:
"hap sample empty service"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录