提交 abbb616d 编写于 作者: C chengxingzhen

XTS元能力用例优化

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 ce84b214
...@@ -89,11 +89,6 @@ export default class MainAbility extends Ability { ...@@ -89,11 +89,6 @@ export default class MainAbility extends Ability {
console.log("ACTS_NewWant Publish CallBack onNewWantMain_To_Test_CommonEvent") console.log("ACTS_NewWant Publish CallBack onNewWantMain_To_Test_CommonEvent")
}); });
switch (want.action) { switch (want.action) {
case 'restartHapB':
commonEvent.publish("onNewWantMain1_To_Test_CommonEvent", publishData, () => {
console.log("ACTS_NewWant Publish CallBack onNewWantMain1_To_Test_CommonEvent")
});
break;
case 'restartHapC': case 'restartHapC':
commonEvent.publish("onNewWantMain2_To_Test_CommonEvent", publishData, () => { commonEvent.publish("onNewWantMain2_To_Test_CommonEvent", publishData, () => {
console.log("ACTS_NewWant Publish CallBack onNewWantMain2_To_Test_CommonEvent") console.log("ACTS_NewWant Publish CallBack onNewWantMain2_To_Test_CommonEvent")
......
...@@ -88,5 +88,12 @@ export default class MainAbility extends Ability { ...@@ -88,5 +88,12 @@ export default class MainAbility extends Ability {
commonEvent.publish("onNewWantMain_To_Test_CommonEvent", publishData, () => { commonEvent.publish("onNewWantMain_To_Test_CommonEvent", publishData, () => {
console.log("ACTS_NewWant Publish CallBack onNewWantMain_To_Test_CommonEvent") console.log("ACTS_NewWant Publish CallBack onNewWantMain_To_Test_CommonEvent")
}); });
switch (want.action) {
case 'restartHapB':
commonEvent.publish("onNewWantMain1_To_Test_CommonEvent", publishData, () => {
console.log("ACTS_NewWant Publish CallBack onNewWantMain1_To_Test_CommonEvent")
});
break;
}
} }
}; };
...@@ -80,6 +80,16 @@ export default class MainAbility extends Ability { ...@@ -80,6 +80,16 @@ export default class MainAbility extends Ability {
+ JSON.stringify(error) + ", " + JSON.stringify(data)) + JSON.stringify(error) + ", " + JSON.stringify(data))
}) })
} }
if (globalThis.abilityWant.action == 'startMainAbility0800') {
globalThis.abilityContext.startAbility({
bundleName: "com.example.newwanthap",
abilityName: "com.example.newwanthapa.SecondAbility",
action: "startSecondAbility0800"
}, (error, data) => {
console.log('ACTS_NewWant MainAbility onForeground - startAbility startServiceAbility: '
+ JSON.stringify(error) + ", " + JSON.stringify(data))
})
}
commonEvent.publish("onForegroundMain_To_Test_CommonEvent", () => { commonEvent.publish("onForegroundMain_To_Test_CommonEvent", () => {
console.log("ACTS_NewWant MainAbility Publish CallBack onForegroundMain_To_Test_CommonEvent") console.log("ACTS_NewWant MainAbility Publish CallBack onForegroundMain_To_Test_CommonEvent")
}); });
...@@ -102,9 +112,23 @@ export default class MainAbility extends Ability { ...@@ -102,9 +112,23 @@ export default class MainAbility extends Ability {
console.log("ACTS_NewWant MainAbility onNewWant type :" + want.type) console.log("ACTS_NewWant MainAbility onNewWant type :" + want.type)
console.log("ACTS_NewWant MainAbility onNewWant flags :" + want.flags) console.log("ACTS_NewWant MainAbility onNewWant flags :" + want.flags)
console.log("ACTS_NewWant MainAbility onNewWant action :" + want.action) console.log("ACTS_NewWant MainAbility onNewWant action :" + want.action)
var publishData = {
data: want.action
}
commonEvent.publish("onNewWantMain_To_Test_CommonEvent", () => { commonEvent.publish("onNewWantMain_To_Test_CommonEvent", () => {
console.log("ACTS_NewWant MainAbility Publish CallBack onNewWantMain_To_Test_CommonEvent") console.log("ACTS_NewWant MainAbility Publish CallBack onNewWantMain_To_Test_CommonEvent")
}); });
switch (want.action) {
case 'restartHapB':
commonEvent.publish("onNewWantSecond1_To_Test_CommonEvent", publishData,() => {
console.log("ACTS_NewWant SecondAbility Publish CallBack onNewWantSecond1_To_Test_CommonEvent")
});
break;
case 'restartSecondAbility0700':
commonEvent.publish("onNewWantSecond2_To_Test_CommonEvent", publishData,() => {
console.log("ACTS_NewWant SecondAbility Publish CallBack onNewWantSecond2_To_Test_CommonEvent")
});
break;
}
} }
}; };
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index"
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
var subscriberInfo = { let subscriberInfo = {
events: ['onCreateMain_To_Test_CommonEvent', events: ['onCreateMain_To_Test_CommonEvent',
'onWindowStageCreateMain_To_Test_CommonEvent', 'onWindowStageCreateMain_To_Test_CommonEvent',
'onForegroundMain_To_Test_CommonEvent', 'onForegroundMain_To_Test_CommonEvent',
...@@ -33,6 +33,8 @@ var subscriberInfo = { ...@@ -33,6 +33,8 @@ var subscriberInfo = {
], ],
}; };
let flagNewWant = false;
export default function abilityTest(abilityContext) { export default function abilityTest(abilityContext) {
describe('ActsNewWantTest', function () { describe('ActsNewWantTest', function () {
...@@ -43,13 +45,13 @@ export default function abilityTest(abilityContext) { ...@@ -43,13 +45,13 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_NewWant_Test_0100', 0, async function (done) { it('ACTS_NewWant_Test_0100', 0, async function (done) {
console.log("ACTS_NewWant_Test_0100 --- start") console.log("ACTS_NewWant_Test_0100 --- start")
var Subscriber; let Subscriber;
var flagOnCreate = 0; let flagOnCreate = 0;
var flagOnWindowStageCreate = 0; let flagOnWindowStageCreate = 0;
var flagOnForeground = 0; let flagOnForeground = 0;
var flagOnNewWant = 0; let flagOnNewWant = 0;
commonEvent.createSubscriber(subscriberInfo).then(async (data) => { await commonEvent.createSubscriber(subscriberInfo).then(async (data) => {
console.debug("ACTS_NewWant_Test_0100====>Create Subscriber====>"); console.debug("ACTS_NewWant_Test_0100====>Create Subscriber====>");
Subscriber = data; Subscriber = data;
await commonEvent.subscribe(Subscriber, SubscribeCallBack); await commonEvent.subscribe(Subscriber, SubscribeCallBack);
...@@ -94,17 +96,14 @@ export default function abilityTest(abilityContext) { ...@@ -94,17 +96,14 @@ export default function abilityTest(abilityContext) {
+ flagOnNewWant) + flagOnNewWant)
if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 if (flagOnCreate == 1 && flagOnWindowStageCreate == 1
&& flagOnForeground == 1 && flagOnNewWant == 0) { && flagOnForeground == 1 && flagOnNewWant == 0) {
expect(flagOnCreate).assertEqual(1); flagNewWant = true;
expect(flagOnWindowStageCreate).assertEqual(1);
expect(flagOnForeground).assertEqual(1);
expect(flagOnNewWant).assertEqual(0);
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
} }
done()
} }
function UnSubscribeCallback() { function UnSubscribeCallback() {
console.debug("ACTS_NewWant_Test_0100====>UnSubscribe CallBack====>"); console.debug("ACTS_NewWant_Test_0100====>UnSubscribe CallBack====>");
expect(flagNewWant).assertTrue();
done(); done();
} }
}) })
...@@ -116,13 +115,13 @@ export default function abilityTest(abilityContext) { ...@@ -116,13 +115,13 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_NewWant_Test_0200', 0, async function (done) { it('ACTS_NewWant_Test_0200', 0, async function (done) {
console.log("ACTS_NewWant_Test_0200 --- start") console.log("ACTS_NewWant_Test_0200 --- start")
var Subscriber; let Subscriber;
var flagOnCreate = 0; let flagOnCreate = 0;
var flagOnWindowStageCreate = 0; let flagOnWindowStageCreate = 0;
var flagOnForeground = 0; let flagOnForeground = 0;
var flagOnNewWant = 0; let flagOnNewWant = 0;
commonEvent.createSubscriber(subscriberInfo).then(async (data) => { await commonEvent.createSubscriber(subscriberInfo).then(async (data) => {
console.debug("ACTS_NewWant_Test_0200====>Create Subscriber====>"); console.debug("ACTS_NewWant_Test_0200====>Create Subscriber====>");
Subscriber = data; Subscriber = data;
await commonEvent.subscribe(Subscriber, SubscribeCallBack); await commonEvent.subscribe(Subscriber, SubscribeCallBack);
...@@ -166,17 +165,14 @@ export default function abilityTest(abilityContext) { ...@@ -166,17 +165,14 @@ export default function abilityTest(abilityContext) {
+ flagOnNewWant) + flagOnNewWant)
if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 if (flagOnCreate == 1 && flagOnWindowStageCreate == 1
&& flagOnForeground == 1 && flagOnNewWant == 0) { && flagOnForeground == 1 && flagOnNewWant == 0) {
expect(flagOnCreate).assertEqual(1); flagNewWant = true;
expect(flagOnWindowStageCreate).assertEqual(1);
expect(flagOnForeground).assertEqual(1);
expect(flagOnNewWant).assertEqual(0);
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
} }
done()
} }
function UnSubscribeCallback() { function UnSubscribeCallback() {
console.debug("ACTS_NewWant_Test_0200====>UnSubscribe CallBack====>"); console.debug("ACTS_NewWant_Test_0200====>UnSubscribe CallBack====>");
expect(flagNewWant).assertTrue();
done(); done();
} }
}) })
...@@ -188,13 +184,13 @@ export default function abilityTest(abilityContext) { ...@@ -188,13 +184,13 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_NewWant_Test_0300', 0, async function (done) { it('ACTS_NewWant_Test_0300', 0, async function (done) {
console.log("ACTS_NewWant_Test_0300 --- start") console.log("ACTS_NewWant_Test_0300 --- start")
var Subscriber; let Subscriber;
var flagOnCreate = 0; let flagOnCreate = 0;
var flagOnWindowStageCreate = 0; let flagOnWindowStageCreate = 0;
var flagOnForeground = 0; let flagOnForeground = 0;
var flagOnNewWant = 0; let flagOnNewWant = 0;
commonEvent.createSubscriber(subscriberInfo).then(async (data) => { await commonEvent.createSubscriber(subscriberInfo).then(async (data) => {
console.debug("ACTS_NewWant_Test_0300====>Create Subscriber====>"); console.debug("ACTS_NewWant_Test_0300====>Create Subscriber====>");
Subscriber = data; Subscriber = data;
await commonEvent.subscribe(Subscriber, SubscribeCallBack); await commonEvent.subscribe(Subscriber, SubscribeCallBack);
...@@ -240,15 +236,13 @@ export default function abilityTest(abilityContext) { ...@@ -240,15 +236,13 @@ export default function abilityTest(abilityContext) {
if (flagOnCreate == 2 && flagOnWindowStageCreate == 2 if (flagOnCreate == 2 && flagOnWindowStageCreate == 2
&& flagOnForeground == 2 && flagOnNewWant == 0) { && flagOnForeground == 2 && flagOnNewWant == 0) {
expect(flagOnCreate).assertEqual(2); flagNewWant = true;
expect(flagOnWindowStageCreate).assertEqual(2);
expect(flagOnForeground).assertEqual(2);
expect(flagOnNewWant).assertEqual(0);
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
} }
} }
function UnSubscribeCallback() { function UnSubscribeCallback() {
console.debug("ACTS_NewWant_Test_0300====>UnSubscribe CallBack====>"); console.debug("ACTS_NewWant_Test_0300====>UnSubscribe CallBack====>");
expect(flagNewWant).assertTrue();
done(); done();
} }
}) })
...@@ -260,13 +254,13 @@ export default function abilityTest(abilityContext) { ...@@ -260,13 +254,13 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_NewWant_Test_0400', 0, async function (done) { it('ACTS_NewWant_Test_0400', 0, async function (done) {
console.log("ACTS_NewWant_Test_0400 --- start") console.log("ACTS_NewWant_Test_0400 --- start")
var Subscriber; let Subscriber;
var flagOnCreate = 0; let flagOnCreate = 0;
var flagOnWindowStageCreate = 0; let flagOnWindowStageCreate = 0;
var flagOnForeground = 0; let flagOnForeground = 0;
var flagOnNewWant = 0; let flagOnNewWant = 0;
commonEvent.createSubscriber(subscriberInfo).then(async (data) => { await commonEvent.createSubscriber(subscriberInfo).then(async (data) => {
console.debug("ACTS_NewWant_Test_0400====>Create Subscriber====>"); console.debug("ACTS_NewWant_Test_0400====>Create Subscriber====>");
Subscriber = data; Subscriber = data;
await commonEvent.subscribe(Subscriber, SubscribeCallBack); await commonEvent.subscribe(Subscriber, SubscribeCallBack);
...@@ -311,19 +305,16 @@ export default function abilityTest(abilityContext) { ...@@ -311,19 +305,16 @@ export default function abilityTest(abilityContext) {
console.debug("ACTS_NewWant_Test_0400====>flagOnNewWant:====>" console.debug("ACTS_NewWant_Test_0400====>flagOnNewWant:====>"
+ flagOnNewWant) + flagOnNewWant)
if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 if (flagOnCreate == 0 && flagOnWindowStageCreate == 0
&& flagOnForeground == 2 && flagOnNewWant == 1) { && flagOnForeground == 2 && flagOnNewWant == 1) {
expect(flagOnCreate).assertEqual(1); flagNewWant = true;
expect(flagOnWindowStageCreate).assertEqual(1);
expect(flagOnForeground).assertEqual(2);
expect(flagOnNewWant).assertEqual(1);
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
} }
done()
} }
function UnSubscribeCallback() { function UnSubscribeCallback() {
console.debug("ACTS_NewWant_Test_0400====>UnSubscribe CallBack====>"); console.debug("ACTS_NewWant_Test_0400====>UnSubscribe CallBack====>");
expect(flagNewWant).assertTrue();
done(); done();
} }
}) })
...@@ -335,13 +326,13 @@ export default function abilityTest(abilityContext) { ...@@ -335,13 +326,13 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_NewWant_Test_0500', 0, async function (done) { it('ACTS_NewWant_Test_0500', 0, async function (done) {
console.log("ACTS_NewWant_Test_0500 --- start") console.log("ACTS_NewWant_Test_0500 --- start")
var Subscriber; let Subscriber;
var flagOnCreate = 0; let flagOnCreate = 0;
var flagOnWindowStageCreate = 0; let flagOnWindowStageCreate = 0;
var flagOnForeground = 0; let flagOnForeground = 0;
var flagOnNewWant = 0; let flagOnNewWant = 0;
commonEvent.createSubscriber(subscriberInfo).then(async (data) => { await commonEvent.createSubscriber(subscriberInfo).then(async (data) => {
console.debug("ACTS_NewWant_Test_0500====>Create Subscriber====>"); console.debug("ACTS_NewWant_Test_0500====>Create Subscriber====>");
Subscriber = data; Subscriber = data;
await commonEvent.subscribe(Subscriber, SubscribeCallBack); await commonEvent.subscribe(Subscriber, SubscribeCallBack);
...@@ -388,17 +379,14 @@ export default function abilityTest(abilityContext) { ...@@ -388,17 +379,14 @@ export default function abilityTest(abilityContext) {
if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 if (flagOnCreate == 1 && flagOnWindowStageCreate == 1
&& flagOnForeground == 2 && flagOnNewWant == 1) { && flagOnForeground == 2 && flagOnNewWant == 1) {
expect(flagOnCreate).assertEqual(1); flagNewWant = true;
expect(flagOnWindowStageCreate).assertEqual(1);
expect(flagOnForeground).assertEqual(2);
expect(flagOnNewWant).assertEqual(1);
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
} }
done()
} }
function UnSubscribeCallback() { function UnSubscribeCallback() {
console.debug("ACTS_NewWant_Test_0500====>UnSubscribe CallBack====>"); console.debug("ACTS_NewWant_Test_0500====>UnSubscribe CallBack====>");
expect(flagNewWant).assertTrue();
done(); done();
} }
}) })
...@@ -410,13 +398,13 @@ export default function abilityTest(abilityContext) { ...@@ -410,13 +398,13 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_NewWant_Test_0600', 0, async function (done) { it('ACTS_NewWant_Test_0600', 0, async function (done) {
console.log("ACTS_NewWant_Test_0600 --- start") console.log("ACTS_NewWant_Test_0600 --- start")
var Subscriber; let Subscriber;
var flagOnCreate = 0; let flagOnCreate = 0;
var flagOnWindowStageCreate = 0; let flagOnWindowStageCreate = 0;
var flagOnForeground = 0; let flagOnForeground = 0;
var flagOnNewWant = 0; let flagOnNewWant = 0;
commonEvent.createSubscriber(subscriberInfo).then(async (data) => { await commonEvent.createSubscriber(subscriberInfo).then(async (data) => {
console.debug("ACTS_NewWant_Test_0600====>Create Subscriber====>"); console.debug("ACTS_NewWant_Test_0600====>Create Subscriber====>");
Subscriber = data; Subscriber = data;
await commonEvent.subscribe(Subscriber, SubscribeCallBack); await commonEvent.subscribe(Subscriber, SubscribeCallBack);
...@@ -463,17 +451,14 @@ export default function abilityTest(abilityContext) { ...@@ -463,17 +451,14 @@ export default function abilityTest(abilityContext) {
if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 if (flagOnCreate == 1 && flagOnWindowStageCreate == 1
&& flagOnForeground == 2 && flagOnNewWant == 1) { && flagOnForeground == 2 && flagOnNewWant == 1) {
expect(flagOnCreate).assertEqual(1); flagNewWant = true;
expect(flagOnWindowStageCreate).assertEqual(1);
expect(flagOnForeground).assertEqual(2);
expect(flagOnNewWant).assertEqual(1);
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
} }
done()
} }
function UnSubscribeCallback() { function UnSubscribeCallback() {
console.debug("ACTS_NewWant_Test_0600====>UnSubscribe CallBack====>"); console.debug("ACTS_NewWant_Test_0600====>UnSubscribe CallBack====>");
expect(flagNewWant).assertTrue();
done(); done();
} }
}) })
...@@ -485,13 +470,13 @@ export default function abilityTest(abilityContext) { ...@@ -485,13 +470,13 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_NewWant_Test_0700', 0, async function (done) { it('ACTS_NewWant_Test_0700', 0, async function (done) {
console.log("ACTS_NewWant_Test_0700 --- start") console.log("ACTS_NewWant_Test_0700 --- start")
var Subscriber; let Subscriber;
var flagOnCreate = 0; let flagOnCreate = 0;
var flagOnWindowStageCreate = 0; let flagOnWindowStageCreate = 0;
var flagOnForeground = 0; let flagOnForeground = 0;
var flagOnNewWant = 0; let flagOnNewWant = 0;
commonEvent.createSubscriber(subscriberInfo).then(async (data) => { await commonEvent.createSubscriber(subscriberInfo).then(async (data) => {
console.debug("ACTS_NewWant_Test_0700====>Create Subscriber====>"); console.debug("ACTS_NewWant_Test_0700====>Create Subscriber====>");
Subscriber = data; Subscriber = data;
await commonEvent.subscribe(Subscriber, SubscribeCallBack); await commonEvent.subscribe(Subscriber, SubscribeCallBack);
...@@ -536,18 +521,15 @@ export default function abilityTest(abilityContext) { ...@@ -536,18 +521,15 @@ export default function abilityTest(abilityContext) {
console.debug("ACTS_NewWant_Test_0700====>flagOnNewWant:====>" console.debug("ACTS_NewWant_Test_0700====>flagOnNewWant:====>"
+ flagOnNewWant) + flagOnNewWant)
if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 if (flagOnCreate == 0 && flagOnWindowStageCreate == 0
&& flagOnForeground == 2 && flagOnNewWant == 1) { && flagOnForeground == 2 && flagOnNewWant == 1) {
expect(flagOnCreate).assertEqual(1); flagNewWant = true;
expect(flagOnWindowStageCreate).assertEqual(1);
expect(flagOnForeground).assertEqual(2);
expect(flagOnNewWant).assertEqual(1);
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
} }
done()
} }
function UnSubscribeCallback() { function UnSubscribeCallback() {
console.debug("ACTS_NewWant_Test_0700====>UnSubscribe CallBack====>"); console.debug("ACTS_NewWant_Test_0700====>UnSubscribe CallBack====>");
expect(flagNewWant).assertTrue();
done(); done();
} }
}) })
...@@ -559,13 +541,13 @@ export default function abilityTest(abilityContext) { ...@@ -559,13 +541,13 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_NewWant_Test_0800', 0, async function (done) { it('ACTS_NewWant_Test_0800', 0, async function (done) {
console.log("ACTS_NewWant_Test_0800 --- start") console.log("ACTS_NewWant_Test_0800 --- start")
var Subscriber; let Subscriber;
var flagOnCreate = 0; let flagOnCreate = 0;
var flagOnWindowStageCreate = 0; let flagOnWindowStageCreate = 0;
var flagOnForeground = 0; let flagOnForeground = 0;
var flagOnNewWant = 0; let flagOnNewWant = 0;
commonEvent.createSubscriber(subscriberInfo).then(async (data) => { await commonEvent.createSubscriber(subscriberInfo).then(async (data) => {
console.debug("ACTS_NewWant_Test_0800====>Create Subscriber====>"); console.debug("ACTS_NewWant_Test_0800====>Create Subscriber====>");
Subscriber = data; Subscriber = data;
await commonEvent.subscribe(Subscriber, SubscribeCallBack); await commonEvent.subscribe(Subscriber, SubscribeCallBack);
...@@ -573,8 +555,8 @@ export default function abilityTest(abilityContext) { ...@@ -573,8 +555,8 @@ export default function abilityTest(abilityContext) {
abilityContext.startAbility({ abilityContext.startAbility({
bundleName: "com.example.newwanthap", bundleName: "com.example.newwanthap",
abilityName: "com.example.newwanthapa.SecondAbility", abilityName: "com.example.newwanthapa.MainAbility",
action: "startSecondAbility0800" action: "startMainAbility0800"
}, (error, data) => { }, (error, data) => {
console.log('ACTS_NewWant_Test_0800 - startAbility start SecondAbility: ' console.log('ACTS_NewWant_Test_0800 - startAbility start SecondAbility: '
+ JSON.stringify(error) + ", " + JSON.stringify(data)) + JSON.stringify(error) + ", " + JSON.stringify(data))
...@@ -611,18 +593,15 @@ export default function abilityTest(abilityContext) { ...@@ -611,18 +593,15 @@ export default function abilityTest(abilityContext) {
console.debug("ACTS_NewWant_Test_0800====>flagOnNewWant:====>" console.debug("ACTS_NewWant_Test_0800====>flagOnNewWant:====>"
+ flagOnNewWant) + flagOnNewWant)
if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 if (flagOnCreate == 0 && flagOnWindowStageCreate == 0
&& flagOnForeground == 2 && flagOnNewWant == 1) { && flagOnForeground == 2 && flagOnNewWant == 1) {
expect(flagOnCreate).assertEqual(1); flagNewWant = true;
expect(flagOnWindowStageCreate).assertEqual(1);
expect(flagOnForeground).assertEqual(2);
expect(flagOnNewWant).assertEqual(1);
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
} }
done()
} }
function UnSubscribeCallback() { function UnSubscribeCallback() {
console.debug("ACTS_NewWant_Test_0800====>UnSubscribe CallBack====>"); console.debug("ACTS_NewWant_Test_0800====>UnSubscribe CallBack====>");
expect(flagNewWant).assertTrue();
done(); done();
} }
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册