未验证 提交 c360bfd0 编写于 作者: O openharmony_ci 提交者: Gitee

!3692 fix test case

Merge pull request !3692 from chengxingzhen/xts_0610
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for hjunit demo Tests", "description": "Configuration for hjunit demo Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "1000000", "test-timeout": "500000",
"package": "com.example.abilitymultiinstance", "package": "com.example.abilitymultiinstance",
"shell-timeout": "300000" "shell-timeout": "300000"
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for hjunit demo Tests", "description": "Configuration for hjunit demo Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "1000000", "test-timeout": "300000",
"package": "com.example.systemcalltest", "package": "com.example.systemcalltest",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
......
...@@ -45,6 +45,7 @@ var subscriberInfo = { ...@@ -45,6 +45,7 @@ var subscriberInfo = {
events: ["CallTest"], events: ["CallTest"],
}; };
var caseDepBundles = []; var caseDepBundles = [];
var subscriber = null;
class MySequenceable { class MySequenceable {
num: number = 0; num: number = 0;
...@@ -134,6 +135,13 @@ export default function abilityTest(abilityContext) { ...@@ -134,6 +135,13 @@ export default function abilityTest(abilityContext) {
afterEach(async (done) => { afterEach(async (done) => {
var testMissionId; var testMissionId;
if (subscriber != null) {
commonEvent.unsubscribe(subscriber, () => {
console.log('======>afterEach unsubscribe<=======');
});
subscriber = null;
}
testMissionId = await getMissionId(sysAMainAbilityName, 0); testMissionId = await getMissionId(sysAMainAbilityName, 0);
console.log('======>afterEach test missionId<=======' + testMissionId); console.log('======>afterEach test missionId<=======' + testMissionId);
if (testMissionId != -1) { if (testMissionId != -1) {
...@@ -158,10 +166,10 @@ export default function abilityTest(abilityContext) { ...@@ -158,10 +166,10 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_CommonComponent_Call_0100', 0, async function (done) { it('ACTS_CommonComponent_Call_0100', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_0100 begin'); console.log('ACTS_CommonComponent_Call_0100 begin');
var subscriber;
function unSubscribeCallBack() { function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_0100 unSubscribeCallBack') console.log('ACTS_CommonComponent_Call_0100 unSubscribeCallBack')
subscriber = null;
done(); done();
} }
...@@ -241,11 +249,11 @@ export default function abilityTest(abilityContext) { ...@@ -241,11 +249,11 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_CommonComponent_Call_0300', 0, async function (done) { it('ACTS_CommonComponent_Call_0300', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_0300 begin'); console.log('ACTS_CommonComponent_Call_0300 begin');
var subscriber;
caseDepBundles = [systemAppCalleeABundleName]; caseDepBundles = [systemAppCalleeABundleName];
function unSubscribeCallBack() { function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_0300 unSubscribeCallBack') console.log('ACTS_CommonComponent_Call_0300 unSubscribeCallBack')
subscriber = null;
done(); done();
} }
...@@ -327,13 +335,13 @@ export default function abilityTest(abilityContext) { ...@@ -327,13 +335,13 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_CommonComponent_Call_0500', 0, async function (done) { it('ACTS_CommonComponent_Call_0500', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_0500 begin'); console.log('ACTS_CommonComponent_Call_0500 begin');
var subscriber;
var caller1; var caller1;
var caller2; var caller2;
caseDepBundles = [systemAppCalleeABundleName]; caseDepBundles = [systemAppCalleeABundleName];
function unSubscribeCallBack() { function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_0500 unSubscribeCallBack') console.log('ACTS_CommonComponent_Call_0500 unSubscribeCallBack')
subscriber = null;
caller1.release(); caller1.release();
done(); done();
} }
...@@ -426,12 +434,12 @@ export default function abilityTest(abilityContext) { ...@@ -426,12 +434,12 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_CommonComponent_Call_0700', 0, async function (done) { it('ACTS_CommonComponent_Call_0700', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_0700 begin'); console.log('ACTS_CommonComponent_Call_0700 begin');
var subscriber;
var caller; var caller;
caseDepBundles = [systemAppCalleeABundleName]; caseDepBundles = [systemAppCalleeABundleName];
function unSubscribeCallBack() { function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_0700 unSubscribeCallBack') console.log('ACTS_CommonComponent_Call_0700 unSubscribeCallBack')
subscriber = null;
done(); done();
} }
...@@ -549,12 +557,12 @@ export default function abilityTest(abilityContext) { ...@@ -549,12 +557,12 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_CommonComponent_Call_0900', 0, async function (done) { it('ACTS_CommonComponent_Call_0900', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_0900 begin'); console.log('ACTS_CommonComponent_Call_0900 begin');
var subscriber;
caseDepBundles = [thirdAppABundleName]; caseDepBundles = [thirdAppABundleName];
var caller; var caller;
function unSubscribeCallBack() { function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_0900 unSubscribeCallBack') console.log('ACTS_CommonComponent_Call_0900 unSubscribeCallBack')
subscriber = null;
done(); done();
} }
...@@ -660,7 +668,6 @@ export default function abilityTest(abilityContext) { ...@@ -660,7 +668,6 @@ export default function abilityTest(abilityContext) {
*/ */
it('ACTS_CommonComponent_Call_1900', 0, async function (done) { it('ACTS_CommonComponent_Call_1900', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1900 begin'); console.log('ACTS_CommonComponent_Call_1900 begin');
var subscriber;
var callBackCnt = 0; var callBackCnt = 0;
function checkFinish() { function checkFinish() {
...@@ -672,6 +679,7 @@ export default function abilityTest(abilityContext) { ...@@ -672,6 +679,7 @@ export default function abilityTest(abilityContext) {
function unSubscribeCallBack() { function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_1900 unSubscribeCallBack') console.log('ACTS_CommonComponent_Call_1900 unSubscribeCallBack')
subscriber = null;
done(); done();
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
@Entry @Entry
@Component @Component
struct Index { struct Second {
build() { build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('SystemCallTest SecondAbility)') Text('SystemCallTest SecondAbility)')
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for hjunit demo Tests", "description": "Configuration for hjunit demo Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "1000000", "test-timeout": "100000",
"package": "com.example.thirdcalltest", "package": "com.example.thirdcalltest",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
......
...@@ -64,7 +64,7 @@ function testCall(data) { ...@@ -64,7 +64,7 @@ function testCall(data) {
commonEvent.publish('CallTest', commonEventData, (err) => { commonEvent.publish('CallTest', commonEventData, (err) => {
console.log('======>CallTestSysA ThirdAbility Call_Finish<======') console.log('======>CallTestSysA ThirdAbility Call_Finish<======')
}) })
return; return recvSequence;
} }
function testCallWithResult(data) { function testCallWithResult(data) {
......
...@@ -12,20 +12,10 @@ ...@@ -12,20 +12,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {Core} from 'deccjsunit/index'
@Entry @Entry
@Component @Component
struct Index { struct Index {
aboutToAppear() {
console.info('onShow finish')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
core.execute()
}
build() { build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World') Text('Hello World')
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility'
import commonEvent from "@ohos.commonEvent" import commonEvent from "@ohos.commonEvent"
import rpc from '@ohos.rpc';
export default class ServiceAbility2 extends ServiceExtensionAbility { export default class ServiceAbility2 extends ServiceExtensionAbility {
onCreate(want) { onCreate(want) {
...@@ -39,6 +40,7 @@ export default class ServiceAbility2 extends ServiceExtensionAbility { ...@@ -39,6 +40,7 @@ export default class ServiceAbility2 extends ServiceExtensionAbility {
onConnect(want) { onConnect(want) {
console.log('ServiceAbility2 onConnect'); console.log('ServiceAbility2 onConnect');
return new rpc.RemoteObject('connect');
} }
onDisconnect(want) { onDisconnect(want) {
......
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAmsUsersKillProcessAppA") { ohos_hap("ActsAmsUsersKillProcessAppA") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
hap_name = "ActsAmsUsersKillProcessAppA"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":actsamsuserskillprocessappa_js_assets", ":actsamsuserskillprocessappa_js_assets",
":actsamsuserskillprocessappa_resources", ":actsamsuserskillprocessappa_resources",
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAmsUsersKillProcessAppA"
} }
ohos_app_scope("actsamsuserskillprocessappa_app_profile") { ohos_app_scope("actsamsuserskillprocessappa_app_profile") {
......
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAmsUsersKillProcessAppB") { ohos_hap("ActsAmsUsersKillProcessAppB") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
hap_name = "ActsAmsUsersKillProcessAppB"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":actsamsuserskillprocessappb_js_assets", ":actsamsuserskillprocessappb_js_assets",
":actsamsuserskillprocessappb_resources", ":actsamsuserskillprocessappb_resources",
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAmsUsersKillProcessAppB"
} }
ohos_app_scope("actsamsuserskillprocessappb_app_profile") { ohos_app_scope("actsamsuserskillprocessappb_app_profile") {
......
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAmsUsersKillProcessAppC") { ohos_hap("ActsAmsUsersKillProcessAppC") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
hap_name = "ActsAmsUsersKillProcessAppC"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":actsamsuserskillprocessappc_js_assets", ":actsamsuserskillprocessappc_js_assets",
":actsamsuserskillprocessappc_resources", ":actsamsuserskillprocessappc_resources",
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAmsUsersKillProcessAppC"
} }
ohos_app_scope("actsamsuserskillprocessappc_app_profile") { ohos_app_scope("actsamsuserskillprocessappc_app_profile") {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility'
import commonEvent from "@ohos.commonEvent" import commonEvent from "@ohos.commonEvent"
import rpc from '@ohos.rpc';
export default class ServiceAbility extends ServiceExtensionAbility { export default class ServiceAbility extends ServiceExtensionAbility {
onCreate(want) { onCreate(want) {
...@@ -35,6 +36,7 @@ export default class ServiceAbility extends ServiceExtensionAbility { ...@@ -35,6 +36,7 @@ export default class ServiceAbility extends ServiceExtensionAbility {
onConnect(want) { onConnect(want) {
console.log('ServiceAbility onConnect'); console.log('ServiceAbility onConnect');
return new rpc.RemoteObject('connect');
} }
onDisconnect(want) { onDisconnect(want) {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
import rpc from '@ohos.rpc';
import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility'
var conn = -1; var conn = -1;
...@@ -41,6 +42,51 @@ function publishCallBackttwo () { ...@@ -41,6 +42,51 @@ function publishCallBackttwo () {
console.log("========Publish CallBack AMSc_disonnectAbility_0200_commonEvent========"); console.log("========Publish CallBack AMSc_disonnectAbility_0200_commonEvent========");
} }
class Stub extends rpc.RemoteObject {
constructor(des) {
super(des);
}
onRemoteRequest(code, data, reply, option) {
reply.writeNoException();
reply.writeString("success");
return true;
}
}
function onConnectCallback(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onConnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onConnect element.abilityName : ' + element.abilityName)
}
function onDisconnectCallback1(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
}
function onDisconnectCallback2(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
}
function onDisconnectCallback3(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
}
function onDisconnectCallback4(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
}
function onDisconnectCallback5(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
}
function onDisconnectCallback6(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
}
function onFailedCallback(code) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onFailed errCode : ' + code)
}
export default class ServiceAbility extends ServiceExtensionAbility { export default class ServiceAbility extends ServiceExtensionAbility {
onCreate(want) { onCreate(want) {
console.log('ServiceAbility onCreate, want: ' + want.abilityName); console.log('ServiceAbility onCreate, want: ' + want.abilityName);
...@@ -85,16 +131,30 @@ export default class ServiceAbility extends ServiceExtensionAbility { ...@@ -85,16 +131,30 @@ export default class ServiceAbility extends ServiceExtensionAbility {
{ {
bundleName: "com.example.actsconnectabilitysystemabilitytest", bundleName: "com.example.actsconnectabilitysystemabilitytest",
abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility2", abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility2",
} },
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback1,
onFailed: onFailedCallback,
},
); );
var myStub4 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility");
return myStub4;
}; };
if (want.action == "Eight") { if (want.action == "Eight") {
extensionContext.connectAbility( extensionContext.connectAbility(
{ {
bundleName: "com.example.actsconnectabilitysystemabilitytest", bundleName: "com.example.actsconnectabilitysystemabilitytest",
abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility3", abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility3",
} },
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback6,
onFailed: onFailedCallback,
},
); );
var myStub1 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility");
return myStub1;
}; };
if (want.action == "Nine") { if (want.action == "Nine") {
console.log('connectAbility 111'); console.log('connectAbility 111');
...@@ -102,12 +162,19 @@ export default class ServiceAbility extends ServiceExtensionAbility { ...@@ -102,12 +162,19 @@ export default class ServiceAbility extends ServiceExtensionAbility {
{ {
bundleName: 'com.example.actsconnectabilitysystemabilitytest', bundleName: 'com.example.actsconnectabilitysystemabilitytest',
abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2'
}) },
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback2,
onFailed: onFailedCallback,
},)
setTimeout(()=>{ setTimeout(()=>{
extensionContext.disconnectAbility(num).then(()=>{ extensionContext.disconnectAbility(num).then(()=>{
console.log('in disconnectAbility'); console.log('in disconnectAbility');
}) })
},1000) },1000)
var myStub2 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility");
return myStub2;
}; };
if (want.action == "Ten") { if (want.action == "Ten") {
...@@ -116,12 +183,19 @@ export default class ServiceAbility extends ServiceExtensionAbility { ...@@ -116,12 +183,19 @@ export default class ServiceAbility extends ServiceExtensionAbility {
{ {
bundleName: 'com.example.actsconnectabilitysystemabilitytest', bundleName: 'com.example.actsconnectabilitysystemabilitytest',
abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2'
}) },
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback3,
onFailed: onFailedCallback,
},)
setTimeout(()=>{ setTimeout(()=>{
extensionContext.disconnectAbility(num).then(()=>{ extensionContext.disconnectAbility(num).then(()=>{
console.log('in disconnectAbility2'); console.log('in disconnectAbility2');
}) })
},1000) },1000)
var myStub3 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility");
return myStub3;
}; };
if (want.action == "Ten one") { if (want.action == "Ten one") {
...@@ -130,12 +204,19 @@ export default class ServiceAbility extends ServiceExtensionAbility { ...@@ -130,12 +204,19 @@ export default class ServiceAbility extends ServiceExtensionAbility {
{ {
bundleName: 'com.example.actsconnectabilitysystemabilitytest', bundleName: 'com.example.actsconnectabilitysystemabilitytest',
abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2'
}) },
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback4,
onFailed: onFailedCallback,
},)
setTimeout(()=>{ setTimeout(()=>{
extensionContext.disconnectAbility(2222).then(()=>{ extensionContext.disconnectAbility(2222).then(()=>{
console.log('in disconnectAbility3'); console.log('in disconnectAbility3');
}) })
},1000) },1000)
var myStub5 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility");
return myStub5;
}; };
if (want.action == "Ten two") { if (want.action == "Ten two") {
...@@ -144,12 +225,19 @@ export default class ServiceAbility extends ServiceExtensionAbility { ...@@ -144,12 +225,19 @@ export default class ServiceAbility extends ServiceExtensionAbility {
{ {
bundleName: 'com.example.actsconnectabilitysystemabilitytest', bundleName: 'com.example.actsconnectabilitysystemabilitytest',
abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2'
}) },
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback5,
onFailed: onFailedCallback,
},)
setTimeout(()=>{ setTimeout(()=>{
extensionContext.disconnectAbility(2222).then(()=>{ extensionContext.disconnectAbility(2222).then(()=>{
console.log('in disconnectAbility4'); console.log('in disconnectAbility4');
}) })
},1000) },1000)
var myStub6 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility");
return myStub6;
}; };
} }
......
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("actsServiceAbilityRelyHap") { ohos_hap("actsServiceAbilityRelyHap") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
hap_name = "actsServiceAbilityRelyHap"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":actsserviceabilityrelytest_js_assets", ":actsserviceabilityrelytest_js_assets",
":actsserviceabilityrelytest_resources", ":actsserviceabilityrelytest_resources",
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "actsServiceAbilityRelyHap"
} }
ohos_app_scope("actsserviceabilityrelytest_app_profile") { ohos_app_scope("actsserviceabilityrelytest_app_profile") {
......
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAmsExtensionModuleRelyHap") { ohos_hap("ActsAmsExtensionModuleRelyHap") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
hap_name = "ActsAmsExtensionModuleRelyHap"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":actsamsextensionmodulerelyhap_js_assets", ":actsamsextensionmodulerelyhap_js_assets",
":actsamsextensionmodulerelyhap_resources", ":actsamsextensionmodulerelyhap_resources",
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAmsExtensionModuleRelyHap"
} }
ohos_app_scope("actsamsextensionmodulerelyhap_app_profile") { ohos_app_scope("actsamsextensionmodulerelyhap_app_profile") {
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
*/ */
import Extension from '@ohos.application.ServiceExtensionAbility' import Extension from '@ohos.application.ServiceExtensionAbility'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
import Want from '@ohos.application.Want';
import rpc from '@ohos.rpc';
export default class ServiceExtAbility extends Extension { export default class ServiceExtAbility extends Extension {
onCreate(want) { onCreate(want) {
...@@ -26,7 +27,7 @@ export default class ServiceExtAbility extends Extension { ...@@ -26,7 +27,7 @@ export default class ServiceExtAbility extends Extension {
console.info('mxh ServiceAbility onRequest**'); console.info('mxh ServiceAbility onRequest**');
} }
onConnect(want) { onConnect(want:Want) {
console.info('mxh ServiceAbility onConnect**'); console.info('mxh ServiceAbility onConnect**');
commonEvent.publish("ACTS_ConnectAbility_0100_CommonEvent", { commonEvent.publish("ACTS_ConnectAbility_0100_CommonEvent", {
parameters: { parameters: {
...@@ -36,6 +37,7 @@ export default class ServiceExtAbility extends Extension { ...@@ -36,6 +37,7 @@ export default class ServiceExtAbility extends Extension {
console.log("Demo Publish CallBack MainAbility_Start_CommonEvent") console.log("Demo Publish CallBack MainAbility_Start_CommonEvent")
}); });
console.log('Demo SerivceAbilityServer OnConnect start 1'); console.log('Demo SerivceAbilityServer OnConnect start 1');
return new rpc.RemoteObject('connect');
} }
onDisconnect(want) { onDisconnect(want) {
......
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAmsStaticExtensionInfoRelyHap") { ohos_hap("ActsAmsStaticExtensionInfoRelyHap") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
hap_name = "ActsAmsStaticExtensionInfoRelyHap"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":actsamsstaticextensioninforelyhap_js_assets", ":actsamsstaticextensioninforelyhap_js_assets",
":actsamsstaticextensioninforelyhap_resources", ":actsamsstaticextensioninforelyhap_resources",
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAmsStaticExtensionInfoRelyHap"
} }
ohos_app_scope("actsamsstaticextensioninforelyhap_app_profile") { ohos_app_scope("actsamsstaticextensioninforelyhap_app_profile") {
......
...@@ -14,10 +14,12 @@ ...@@ -14,10 +14,12 @@
*/ */
import ServiceExtension from '@ohos.application.ServiceExtensionAbility' import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import commonEvent from "@ohos.commonEvent" import commonEvent from "@ohos.commonEvent";
import Want from '@ohos.application.Want';
import rpc from '@ohos.rpc';
export default class ServiceAbility extends ServiceExtension { export default class ServiceAbility extends ServiceExtension {
onCreate(want,startId) { onCreate(want:Want) {
globalThis.abilityWant = want; globalThis.abilityWant = want;
console.log('ServiceAbility onCreate, want: ' + want.abilityName); console.log('ServiceAbility onCreate, want: ' + want.abilityName);
} }
...@@ -40,7 +42,9 @@ export default class ServiceAbility extends ServiceExtension { ...@@ -40,7 +42,9 @@ export default class ServiceAbility extends ServiceExtension {
console.log("MainAbility Publish CallBack MainAbility_Start_CommonEvent") console.log("MainAbility Publish CallBack MainAbility_Start_CommonEvent")
}); });
console.log('stub SerivceAbilityServer OnConnect start 2'); console.log('stub SerivceAbilityServer OnConnect start 2');
} }
return new rpc.RemoteObject('connect');
} }
onDisconnect(want) { onDisconnect(want) {
......
...@@ -14,10 +14,12 @@ ...@@ -14,10 +14,12 @@
*/ */
import ServiceExtension from '@ohos.application.ServiceExtensionAbility' import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import commonEvent from "@ohos.commonEvent" import commonEvent from "@ohos.commonEvent";
import Want from '@ohos.application.Want';
import rpc from '@ohos.rpc';
export default class ServiceAbility extends ServiceExtension { export default class ServiceAbility extends ServiceExtension {
onCreate(want,startId) { onCreate(want:Want) {
globalThis.abilityWant = want; globalThis.abilityWant = want;
console.log('ServiceAbility onCreate, want: ' + want.abilityName); console.log('ServiceAbility onCreate, want: ' + want.abilityName);
} }
...@@ -41,7 +43,7 @@ export default class ServiceAbility extends ServiceExtension { ...@@ -41,7 +43,7 @@ export default class ServiceAbility extends ServiceExtension {
}); });
console.log('stub SerivceAbilityServer OnConnect start 1'); console.log('stub SerivceAbilityServer OnConnect start 1');
} }
return new rpc.RemoteObject('connect');
} }
onDisconnect(want) { onDisconnect(want) {
......
...@@ -237,7 +237,7 @@ export default function abilityTest(abilityContext) { ...@@ -237,7 +237,7 @@ export default function abilityTest(abilityContext) {
commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => { commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => {
console.debug("====>ACTS_getExtensionInfo_0200_Create Subscriber====>"); console.debug("====>ACTS_getExtensionInfo_0200_Create Subscriber====>");
subscriber = data; subscriber = data;
await commonEvent.subscribe(subscriber, subscribeCallBack);. await commonEvent.subscribe(subscriber, subscribeCallBack);
connId = await abilityContext.connectAbility( connId = await abilityContext.connectAbility(
{ {
bundleName: "com.example.staticextensioninfotest", bundleName: "com.example.staticextensioninfotest",
......
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAmsStaticARelyHap") { ohos_hap("ActsAmsStaticARelyHap") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
hap_name = "ActsAmsStaticARelyHap"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":actsamsstaticarelyhap_js_assets", ":actsamsstaticarelyhap_js_assets",
":actsamsstaticarelyhap_resources", ":actsamsstaticarelyhap_resources",
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAmsStaticARelyHap"
} }
ohos_app_scope("actsamsstaticarelyhap_app_profile") { ohos_app_scope("actsamsstaticarelyhap_app_profile") {
......
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAmsStaticBRelyHap") { ohos_hap("ActsAmsStaticBRelyHap") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
hap_name = "ActsAmsStaticBRelyHap"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":actsamsstaticbrelyhap_js_assets", ":actsamsstaticbrelyhap_js_assets",
":actsamsstaticbrelyhap_resources", ":actsamsstaticbrelyhap_resources",
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAmsStaticBRelyHap"
} }
ohos_app_scope("actsamsstaticbrelyhap_app_profile") { ohos_app_scope("actsamsstaticbrelyhap_app_profile") {
......
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAmsStaticQueryTestTwoRelyHap") { ohos_hap("ActsAmsStaticQueryTestTwoRelyHap") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
hap_name = "ActsAmsStaticQueryTestTwoRelyHap"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":actsamsstaticquerytesttworelyhap_js_assets", ":actsamsstaticquerytesttworelyhap_js_assets",
":actsamsstaticquerytesttworelyhap_resources", ":actsamsstaticquerytesttworelyhap_resources",
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAmsStaticQueryTestTwoRelyHap"
} }
ohos_app_scope("actsamsstaticquerytesttworelyhap_app_profile") { ohos_app_scope("actsamsstaticquerytesttworelyhap_app_profile") {
......
...@@ -14,50 +14,22 @@ ...@@ -14,50 +14,22 @@
*/ */
import file from '@system.file'; import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
@Entry @Entry
@Component @Component
struct Index { struct Index {
aboutToAppear(){ aboutToAppear() {
console.info("start run testcase!!!!") 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))
globalThis.abilityWant.parameters.timeout = 70000;
configService.setConfig(globalThis.abilityWant.parameters)
testsuite(globalThis.abilityContext)
core.execute()
} }
build() { build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World') Text('querytesttwo')
.fontSize(50) .fontSize(50)
.fontWeight(FontWeight.Bold) .fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({ .margin({
top: 20 top: 20
}) })
.backgroundColor('#0D9FFB')
.onClick(() => {
})
} }
.width('100%') .width('100%')
.height('100%') .height('100%')
......
...@@ -13,10 +13,12 @@ ...@@ -13,10 +13,12 @@
* limitations under the License. * limitations under the License.
*/ */
import ServiceExtension from '@ohos.application.ServiceExtensionAbility' import ServiceExtension from '@ohos.application.ServiceExtensionAbility';
import Want from '@ohos.application.Want';
import rpc from '@ohos.rpc';
export default class ServiceAbility extends ServiceExtension { export default class ServiceAbility extends ServiceExtension {
onCreate(want,startId) { onCreate(want:Want) {
globalThis.abilityWant = want; globalThis.abilityWant = want;
console.log('ServiceAbility onCreate, want: ' + want.abilityName); console.log('ServiceAbility onCreate, want: ' + want.abilityName);
} }
...@@ -43,7 +45,7 @@ export default class ServiceAbility extends ServiceExtension { ...@@ -43,7 +45,7 @@ export default class ServiceAbility extends ServiceExtension {
}) })
console.log('stub SerivceAbilityServer OnConnect start 2'); console.log('stub SerivceAbilityServer OnConnect start 2');
} }
return new rpc.RemoteObject('connect');
} }
onDisconnect(want) { onDisconnect(want) {
......
...@@ -74,8 +74,6 @@ export default function abilityTest(abilityContext) { ...@@ -74,8 +74,6 @@ export default function abilityTest(abilityContext) {
describe('ActsGetDisplayIdStartAbilityTest', function () { describe('ActsGetDisplayIdStartAbilityTest', function () {
afterEach(async (done) => { afterEach(async (done) => {
let installer = await bundle.getBundleInstaller();
var count = 0;
var testMissionId; var testMissionId;
testMissionId = await getMissionId(); testMissionId = await getMissionId();
......
...@@ -21,6 +21,7 @@ import wantAgent from '@ohos.wantAgent'; ...@@ -21,6 +21,7 @@ import wantAgent from '@ohos.wantAgent';
import particleAbility from '@ohos.ability.particleAbility' import particleAbility from '@ohos.ability.particleAbility'
import backgroundTaskManager from '@ohos.backgroundTaskManager' import backgroundTaskManager from '@ohos.backgroundTaskManager'
const CREATELOCALDIR = "/data/storage/el2/base/haps/entry";
const START_ABILITY_TIMEOUT = 4000; const START_ABILITY_TIMEOUT = 4000;
const TERMINATE_ABILITY_TIMEOUT = 1000; const TERMINATE_ABILITY_TIMEOUT = 1000;
const TIMEOUT = 1000; const TIMEOUT = 1000;
...@@ -1815,12 +1816,6 @@ describe('ActsFeatureAbilityTest', function () { ...@@ -1815,12 +1816,6 @@ describe('ActsFeatureAbilityTest', function () {
); );
}) })
// checkGetOrCreateLocalDir
function checkGetOrCreateLocalDir(info) {
console.log("checkGetOrCreateLocalDir root dir : " + info);
expect(typeof (info)).assertEqual("string");
}
// @tc.number: ACTS_GetOrCreateLocalDir_0100 // @tc.number: ACTS_GetOrCreateLocalDir_0100
// @tc.name: GetProcessName : Obtains the name of the current process. // @tc.name: GetProcessName : Obtains the name of the current process.
// @tc.desc: Check the return value of the interface (by promise) // @tc.desc: Check the return value of the interface (by promise)
...@@ -1829,7 +1824,7 @@ describe('ActsFeatureAbilityTest', function () { ...@@ -1829,7 +1824,7 @@ describe('ActsFeatureAbilityTest', function () {
var promise = context.getOrCreateLocalDir(); var promise = context.getOrCreateLocalDir();
expect(typeof (promise)).assertEqual("object"); expect(typeof (promise)).assertEqual("object");
var info = await context.getOrCreateLocalDir(); var info = await context.getOrCreateLocalDir();
checkGetOrCreateLocalDir(info); expect(info).assertEqual(CREATELOCALDIR);
done(); done();
setTimeout(function () { setTimeout(function () {
console.info('====> ACTS_GetOrCreateLocalDir_0100 =====>') console.info('====> ACTS_GetOrCreateLocalDir_0100 =====>')
...@@ -1843,7 +1838,7 @@ describe('ActsFeatureAbilityTest', function () { ...@@ -1843,7 +1838,7 @@ describe('ActsFeatureAbilityTest', function () {
var context = featureAbility.getContext(); var context = featureAbility.getContext();
var result = context.getOrCreateLocalDir( var result = context.getOrCreateLocalDir(
(err, data) => { (err, data) => {
checkGetOrCreateLocalDir(data); expect(data).assertEqual(CREATELOCALDIR);
done() done()
} }
); );
......
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsKillProcessWithAccountRelyHap") { ohos_hap("ActsKillProcessWithAccountRelyHap") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
hap_name = "ActsKillProcessWithAccountRelyHap"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":actskillprocesswithaccountrelyhap_js_assets", ":actskillprocesswithaccountrelyhap_js_assets",
":actskillprocesswithaccountrelyhap_resources", ":actskillprocesswithaccountrelyhap_resources",
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsKillProcessWithAccountRelyHap"
} }
ohos_app_scope("actskillprocesswithaccountrelyhap_app_profile") { ohos_app_scope("actskillprocesswithaccountrelyhap_app_profile") {
......
...@@ -13,11 +13,12 @@ ...@@ -13,11 +13,12 @@
* limitations under the License. * limitations under the License.
*/ */
import ServiceExtension from '@ohos.application.ServiceExtensionAbility' import ServiceExtension from '@ohos.application.ServiceExtensionAbility';
// import commonEvent from '@ohos.commonEvent' import Want from '@ohos.application.Want';
import rpc from "@ohos.rpc";
export default class ServiceAbility extends ServiceExtension { export default class ServiceAbility extends ServiceExtension {
onCreate(want, startId) { onCreate(want: Want) {
globalThis.abilityWant = want; globalThis.abilityWant = want;
console.log('ACTS_NewWant ServiceAbility onCreate, want: ' + want.abilityName); console.log('ACTS_NewWant ServiceAbility onCreate, want: ' + want.abilityName);
} }
...@@ -40,6 +41,7 @@ export default class ServiceAbility extends ServiceExtension { ...@@ -40,6 +41,7 @@ export default class ServiceAbility extends ServiceExtension {
}, },
) )
} }
return new rpc.RemoteObject('connect');
} }
onDisconnect(want) { onDisconnect(want) {
......
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsSystemAppOneRelyHap") { ohos_hap("ActsSystemAppOneRelyHap") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
hap_name = "ActsSystemAppOneRelyHap"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":acts_systemappone_rely_test_js_assets", ":acts_systemappone_rely_test_js_assets",
":acts_systemappone_rely_test_resources", ":acts_systemappone_rely_test_resources",
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsSystemAppOneRelyHap"
} }
ohos_app_scope("acts_systemappone_rely_test_app_profile") { ohos_app_scope("acts_systemappone_rely_test_app_profile") {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for hjunit demo Tests", "description": "Configuration for hjunit demo Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "1000000", "test-timeout": "300000",
"package": "com.example.zidlclienttest", "package": "com.example.zidlclienttest",
"shell-timeout": "300000" "shell-timeout": "300000"
}, },
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import ServiceExtension from '@ohos.application.ServiceExtensionAbility' import ServiceExtension from '@ohos.application.ServiceExtensionAbility';
import Want from '@ohos.application.Want';
import {voidOutStringCallback} from "./zidlTool/i_zidl_tool_test"; import {voidOutStringCallback} from "./zidlTool/i_zidl_tool_test";
import {voidOutIntCallback} from "./zidlTool/i_zidl_tool_test"; import {voidOutIntCallback} from "./zidlTool/i_zidl_tool_test";
import {voidOutMapStringIntCallback} from "./zidlTool/i_zidl_tool_test"; import {voidOutMapStringIntCallback} from "./zidlTool/i_zidl_tool_test";
...@@ -408,7 +409,7 @@ class ZidlTestImp extends ZidlTestServiceStub { ...@@ -408,7 +409,7 @@ class ZidlTestImp extends ZidlTestServiceStub {
} }
export default class ServiceAbility extends ServiceExtension { export default class ServiceAbility extends ServiceExtension {
onCreate(want,startId) { onCreate(want: Want) {
globalThis.abilityWant = want; globalThis.abilityWant = want;
console.log('ZidlClientTest ServiceAbility onCreate, want: ' + want.abilityName); console.log('ZidlClientTest ServiceAbility onCreate, want: ' + want.abilityName);
} }
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import ServiceExtension from '@ohos.application.ServiceExtensionAbility' import ServiceExtension from '@ohos.application.ServiceExtensionAbility';
import Want from '@ohos.application.Want';
import ZidlTestServiceStubOneway from './zidlToolOneWay/interface_attribute_declaratoin_oneway_stub'; import ZidlTestServiceStubOneway from './zidlToolOneWay/interface_attribute_declaratoin_oneway_stub';
import {voidVoidFirstCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway' import {voidVoidFirstCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway'
import {voidVoidSecondCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway' import {voidVoidSecondCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway'
...@@ -39,7 +40,7 @@ class ZidlTestImpOneway extends ZidlTestServiceStubOneway { ...@@ -39,7 +40,7 @@ class ZidlTestImpOneway extends ZidlTestServiceStubOneway {
} }
export default class ServiceAbility2 extends ServiceExtension { export default class ServiceAbility2 extends ServiceExtension {
onCreate(want,startId) { onCreate(want: Want) {
globalThis.abilityWant = want; globalThis.abilityWant = want;
console.log('ZidlClientTest ServiceAbility2 onCreate, want: ' + want.abilityName); console.log('ZidlClientTest ServiceAbility2 onCreate, want: ' + want.abilityName);
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import ServiceExtension from '@ohos.application.ServiceExtensionAbility' import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import Want from '@ohos.application.Want';
import {voidOutStringCallback} from "./zidlTool/i_zidl_tool_test"; import {voidOutStringCallback} from "./zidlTool/i_zidl_tool_test";
import {voidOutIntCallback} from "./zidlTool/i_zidl_tool_test"; import {voidOutIntCallback} from "./zidlTool/i_zidl_tool_test";
import {voidOutMapStringIntCallback} from "./zidlTool/i_zidl_tool_test"; import {voidOutMapStringIntCallback} from "./zidlTool/i_zidl_tool_test";
...@@ -408,7 +409,7 @@ class ZidlTestImp extends ZidlTestServiceStub { ...@@ -408,7 +409,7 @@ class ZidlTestImp extends ZidlTestServiceStub {
} }
export default class ServiceAbility extends ServiceExtension { export default class ServiceAbility extends ServiceExtension {
onCreate(want,startId) { onCreate(want: Want) {
globalThis.abilityWant = want; globalThis.abilityWant = want;
console.log('ZidlService ServiceAbility onCreate, want: ' + want.abilityName); console.log('ZidlService ServiceAbility onCreate, want: ' + want.abilityName);
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import ServiceExtension from '@ohos.application.ServiceExtensionAbility' import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import Want from '@ohos.application.Want';
import ZidlTestServiceStubOneway from './zidlToolOneWay/interface_attribute_declaratoin_oneway_stub'; import ZidlTestServiceStubOneway from './zidlToolOneWay/interface_attribute_declaratoin_oneway_stub';
import {voidVoidFirstCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway' import {voidVoidFirstCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway'
import {voidVoidSecondCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway' import {voidVoidSecondCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway'
...@@ -39,7 +40,7 @@ class ZidlTestImpOneway extends ZidlTestServiceStubOneway { ...@@ -39,7 +40,7 @@ class ZidlTestImpOneway extends ZidlTestServiceStubOneway {
} }
export default class ServiceAbility2 extends ServiceExtension { export default class ServiceAbility2 extends ServiceExtension {
onCreate(want,startId) { onCreate(want: Want) {
globalThis.abilityWant = want; globalThis.abilityWant = want;
console.log('ZidlService ServiceAbility2 onCreate, want: ' + want.abilityName); console.log('ZidlService ServiceAbility2 onCreate, want: ' + want.abilityName);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册