Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
cec887ad
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看板
提交
cec887ad
编写于
9月 28, 2022
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
XTS冻结修改
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
164f0356
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
48 addition
and
23 deletion
+48
-23
ability/ability_runtime/aacommand/AACommandPrintOneTest/entry/src/main/ets/test/Ability.test.ets
...mandPrintOneTest/entry/src/main/ets/test/Ability.test.ets
+1
-1
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/test/Ability.test.ets
...andPrintSyncTest/entry/src/main/ets/test/Ability.test.ets
+1
-1
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts
...Commandtest/entry/src/main/ets/MainAbility/MainAbility.ts
+1
-2
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/test/Ability.test.ets
...nd/AACommandtest/entry/src/main/ets/test/Ability.test.ets
+1
-1
ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/TestAbility/TestAbility.ts
...monitortest/entry/src/main/ets/TestAbility/TestAbility.ts
+1
-1
ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/test/AbilityStageMonitor.test.ets
...test/entry/src/main/ets/test/AbilityStageMonitor.test.ets
+19
-1
ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets
.../actsnewwanttest/entry/src/main/ets/test/Ability.test.ets
+24
-16
未找到文件。
ability/ability_runtime/aacommand/AACommandPrintOneTest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
cec887ad
...
@@ -27,7 +27,7 @@ export default function abilityTest() {
...
@@ -27,7 +27,7 @@ export default function abilityTest() {
bundleName: "com.example.aacommandprintonetest",
bundleName: "com.example.aacommandprintonetest",
abilityName: "MainAbility"
abilityName: "MainAbility"
}
}
await globalThis.ability
Test
Context.startAbility(wantInfo).then((data) => {
await globalThis.abilityContext.startAbility(wantInfo).then((data) => {
console.log("ActsAACommandPrinOneTest startAbility data : " + JSON.stringify(data));
console.log("ActsAACommandPrinOneTest startAbility data : " + JSON.stringify(data));
}).catch((err) => {
}).catch((err) => {
console.log("ActsAACommandPrinOneTest startAbility err : " + JSON.stringify(err));
console.log("ActsAACommandPrinOneTest startAbility err : " + JSON.stringify(err));
...
...
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
cec887ad
...
@@ -25,7 +25,7 @@ export default function abilityTest() {
...
@@ -25,7 +25,7 @@ export default function abilityTest() {
bundleName: "com.example.aacommandprintsynctest",
bundleName: "com.example.aacommandprintsynctest",
abilityName: "MainAbility"
abilityName: "MainAbility"
}
}
await globalThis.ability
Test
Context.startAbility(wantInfo).then((data) => {
await globalThis.abilityContext.startAbility(wantInfo).then((data) => {
console.log("ActsAACommandPrintSyncTest startAbility data : " + JSON.stringify(data));
console.log("ActsAACommandPrintSyncTest startAbility data : " + JSON.stringify(data));
}).catch((err) => {
}).catch((err) => {
console.log("ActsAACommandPrintSyncTest startAbility err : " + JSON.stringify(err));
console.log("ActsAACommandPrintSyncTest startAbility err : " + JSON.stringify(err));
...
...
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
cec887ad
...
@@ -32,6 +32,7 @@ async function startAbilityTest(TAG, context) {
...
@@ -32,6 +32,7 @@ async function startAbilityTest(TAG, context) {
export
default
class
MainAbility
extends
Ability
{
export
default
class
MainAbility
extends
Ability
{
async
onCreate
(
want
,
launchParam
)
{
async
onCreate
(
want
,
launchParam
)
{
globalThis
.
abilityContext
=
this
.
context
;
console
.
log
(
'
MainAbility onCreate
'
)
console
.
log
(
'
MainAbility onCreate
'
)
let
cmd
:
any
let
cmd
:
any
let
abilityDelegatorArguments
:
any
let
abilityDelegatorArguments
:
any
...
@@ -315,8 +316,6 @@ export default class MainAbility extends Ability {
...
@@ -315,8 +316,6 @@ export default class MainAbility extends Ability {
onWindowStageCreate
(
windowStage
)
{
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
MainAbility onWindowStageCreate
'
)
console
.
log
(
'
MainAbility onWindowStageCreate
'
)
windowStage
.
setUIContent
(
this
.
context
,
'
pages/index
'
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
'
pages/index
'
,
null
)
globalThis
.
abilityContext
=
this
.
context
;
}
}
onWindowStageDestroy
()
{
onWindowStageDestroy
()
{
...
...
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
cec887ad
...
@@ -28,7 +28,7 @@ export default function abilityTest() {
...
@@ -28,7 +28,7 @@ export default function abilityTest() {
bundleName: "com.example.aacommandtest",
bundleName: "com.example.aacommandtest",
abilityName: "MainAbility"
abilityName: "MainAbility"
}
}
await globalThis.ability
Test
Context.startAbility(wantInfo).then((data) => {
await globalThis.abilityContext.startAbility(wantInfo).then((data) => {
console.log("ActsAACommandTest startAbility data : " + JSON.stringify(data));
console.log("ActsAACommandTest startAbility data : " + JSON.stringify(data));
}).catch((err) => {
}).catch((err) => {
console.log("ActsAACommandTest startAbility err : " + JSON.stringify(err));
console.log("ActsAACommandTest startAbility err : " + JSON.stringify(err));
...
...
ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/TestAbility/TestAbility.ts
浏览文件 @
cec887ad
...
@@ -19,6 +19,7 @@ import testsuite from '../test/List.test'
...
@@ -19,6 +19,7 @@ import testsuite from '../test/List.test'
export
default
class
TestAbility
extends
Ability
{
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
onCreate
(
want
,
launchParam
)
{
globalThis
.
abilityContext
=
this
.
context
;
console
.
info
(
'
TestAbility onCreate
'
)
console
.
info
(
'
TestAbility onCreate
'
)
let
abilityDelegatorArguments
:
any
let
abilityDelegatorArguments
:
any
let
abilityDelegator
:
any
let
abilityDelegator
:
any
...
@@ -34,7 +35,6 @@ export default class TestAbility extends Ability {
...
@@ -34,7 +35,6 @@ export default class TestAbility extends Ability {
onWindowStageCreate
(
windowStage
)
{
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
setUIContent
(
this
.
context
,
'
TestAbility/pages/index
'
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
'
TestAbility/pages/index
'
,
null
)
globalThis
.
abilityContext
=
this
.
context
;
}
}
onWindowStageDestroy
()
{
onWindowStageDestroy
()
{
...
...
ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/test/AbilityStageMonitor.test.ets
浏览文件 @
cec887ad
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import { describe, it, expect } from '@ohos/hypium'
import { describe, it, expect
, afterEach
} from '@ohos/hypium'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...
@@ -37,6 +37,24 @@ function test(time) {
...
@@ -37,6 +37,24 @@ function test(time) {
export default function abilityStageMonitorTest() {
export default function abilityStageMonitorTest() {
describe('ActsAbilityTest', function () {
describe('ActsAbilityTest', function () {
afterEach(async (done) => {
console.log("SUB_AA_AbilityStageMonitor afterEach called");
let wantInfo = {
bundleName: "com.example.abilitystagemonitortest",
abilityName: "TestAbility"
}
await globalThis.abilityContext.startAbility(wantInfo).then((data) => {
console.log("SUB_AA_AbilityStageMonitor startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log("SUB_AA_AbilityStageMonitor startAbility err : " + JSON.stringify(err));
})
setTimeout(function () {
console.log("SUB_AA_AbilityStageMonitor afterEach called");
done();
}, 1000);
})
/**
/**
* @tc.number: SUB_AA_AbilityStageMonitor_0100
* @tc.number: SUB_AA_AbilityStageMonitor_0100
* @tc.name: Call waitAbilityStageMonitor in the form of callback, and enter the monitor
* @tc.name: Call waitAbilityStageMonitor in the form of callback, and enter the monitor
...
...
ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
cec887ad
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
import commonEvent from '@ohos.commonEvent'
import commonEvent from '@ohos.commonEvent'
import backgroundTaskManager from '@ohos.backgroundTaskManager';
let subscriberInfo = {
let subscriberInfo = {
events: ['onCreateMain_To_Test_CommonEvent',
events: ['onCreateMain_To_Test_CommonEvent',
...
@@ -38,22 +39,29 @@ let flagNewWant = false;
...
@@ -38,22 +39,29 @@ let flagNewWant = false;
export default function abilityTest() {
export default function abilityTest() {
describe('ActsNewWantTest', function () {
describe('ActsNewWantTest', function () {
afterEach(async (done) => {
let TAG1 = 'ACTS_NewWant_Test : '
console.log("ACTS_NewWant afterEach called");
let id = undefined;
let wantInfo = {
beforeAll(async (done) => {
bundleName: "com.example.newwanttest",
console.log(TAG1 + "beforeAll called");
abilityName: "com.example.newwanttest.MainAbility"
let myReason = 'test ActsNewWantTest';
}
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
await globalThis.abilityTestContext.startAbility(wantInfo).then((data) => {
console.log(TAG1 + "Request suspension delay will time out.");
console.log("ACTS_NewWant startAbility data : " + JSON.stringify(data));
})
}).catch((err) => {
id = delayInfo.requestId;
console.log("ACTS_NewWant startAbility err : " + JSON.stringify(err));
console.log(TAG1 + "requestId is : " + id);
})
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
setTimeout(function () {
done();
console.log("ACTS_NewWant afterEach end");
}, 1000);
done();
})
}, 1000);
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, 1000);
})
})
/**
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录