提交 043a9d88 编写于 作者: O openharmony_ci 提交者: Gitee

!805 update xts test

Merge pull request !805 from blackleon/xts_0929
......@@ -9,8 +9,9 @@
"kits": [
{
"test-file-name": [
"ActsContextTest.hap",
"DefPermission.hap"
"DefPermission.hap",
"ActsContextTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
......@@ -17,95 +17,6 @@ import bundle from '@ohos.bundle'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('ActsContextTest', function () {
// @tc.number: ACTS_VerifySelfPermission_0100
// @tc.name: verifySelfPermission : Check specific permissions
// @tc.desc: Check the return type of the interface (by Promise)
it('ACTS_VerifySelfPermission_0100', 0, async function (done) {
console.debug("ACTS_VerifySelfPermission_0100 start")
var ret = false
var context = await featureAbility.getContext()
console.debug("VerifySelfPermission start")
var promise = await context.verifySelfPermission("com.example.permission");
console.info("VerifySelfPermission finish"+JSON.stringify(promise))
console.info("VerifySelfPermission finish"+JSON.stringify(context))
expect(typeof(promise)).assertEqual("number");
console.debug("VerifySelfPermission finish")
expect(typeof(context)).assertEqual("object");
ret = true
console.debug("ACTS_VerifySelfPermission_0100 finish")
done();
setTimeout(function(){
expect(ret).assertEqual(true)
},1000)
})
// @tc.number: ACTS_VerifySelfPermission_0200
// @tc.name: verifySelfPermission : Check the status of the specified permission
// @tc.desc: Check the status of the specified permission and return the authorized status (by Promise)
it('ACTS_VerifySelfPermission_0200', 0, async function (done) {
var ret = false
var context = await featureAbility.getContext();
var result = await context.verifySelfPermission("com.example.permission");
expect(result).assertEqual(0);
ret = true
done();
setTimeout(function(){
expect(ret).assertEqual(true)
},1000)
})
// @tc.number: ACTS_VerifySelfPermission_0300
// @tc.name: verifySelfPermission : Check the status of the specified permission
// @tc.desc: Check the status of the specified permission and return the unauthorized status (by Promise)
it('ACTS_VerifySelfPermission_0300', 0, async function (done) {
var ret = false
var context = await featureAbility.getContext();
var result = await context.verifySelfPermission("com.myability.permission.MYPERMISSION_NOT");
expect(result).assertEqual(-1);
ret = true
done();
setTimeout(function(){
expect(ret).assertEqual(true)
},1000)
})
// @tc.number: ACTS_VerifySelfPermission_0400
// @tc.name: verifySelfPermission : Check the status of the specified permission
// @tc.desc: Check the status of the specified permission and return the authorized status (by callback)
it('ACTS_VerifySelfPermission_0400', 0, async function (done) {
var ret = false
var context = await featureAbility.getContext();
var info = context.verifySelfPermission("com.example.permission",
(err, data) => {
expect(data).assertEqual(0);
ret = true
done();
}
);
setTimeout(function(){
expect(ret).assertEqual(true)
},1000)
})
// @tc.number: ACTS_VerifySelfPermission_0500
// @tc.name: verifySelfPermission : Check the status of the specified permission
// @tc.desc: Check the status of the specified permission and return the unauthorized status (by callback)
it('ACTS_VerifySelfPermission_0500', 0, async function (done) {
var ret = false
var context = featureAbility.getContext();
var info = context.verifySelfPermission("com.myability.permission.MYPERMISSION",
(err, data) => {
console.log("ACTS_VerifySelfPermission_0500>>>data=" + data);
expect(data).assertEqual(-1);
ret = true
done();
}
);
setTimeout(function(){
expect(ret).assertEqual(true)
},1000)
})
// @tc.number: ACTS_GetBundleName_0100
// @tc.name: getBundleName : Query return value type
......@@ -309,96 +220,7 @@ describe('ActsContextTest', function () {
},1000)
})
// @tc.number: ACTS_CanRequestPermission_0100
// @tc.name: CanRequestPermission : Whether to request the camera function permission to
// the authorization management module to have the permission
// @tc.desc: Whether to request the camera function permission to the authorization management
// module to have the permission (by CallBack)
it('ACTS_CanRequestPermission_0100', 0, async function (done) {
var ret = false
var context = await featureAbility.getContext();
var result = context.canRequestPermission("com.example.permission.user",
(err, data) => {
expect(data).assertEqual(true);
ret = true
done();
});
setTimeout(function(){
expect(ret).assertEqual(true)
},1000)
})
// @tc.number: ACTS_CanRequestPermission_0200
// @tc.name: CanRequestPermission : Whether to request the camera function permission to
// the authorization management module to have the permission
// @tc.desc: Whether to request the camera function permission to the authorization management
// module to have the permission (by Promise)
it('ACTS_CanRequestPermission_0200', 0, async function (done){
var ret = false
var context = await featureAbility.getContext();
var promise = await context.canRequestPermission("com.example.permission.user");
expect(promise).assertEqual(true);
ret = true
done();
setTimeout(function(){
expect(ret).assertEqual(true)
},1000)
})
// @tc.number: ACTS_CanRequestPermission_0300
// @tc.name: CanRequestPermission : Whether to request the camera function permission to
// the authorization management module to have the permission
// @tc.desc: Whether to request the camera function permission to the authorization management
// module to have the permission (by CallBack)
it('ACTS_CanRequestPermission_0300', 0, async function (done) {
var ret = false
var context = await featureAbility.getContext();
var result = context.canRequestPermission("com.example.permission",
(err, data) => {
expect(data).assertEqual(false);
ret = true
done();
});
setTimeout(function(){
expect(ret).assertEqual(true)
},1000)
})
// @tc.number: ACTS_CanRequestPermission_0400
// @tc.name: CanRequestPermission : Whether to request the camera function permission to
// the authorization management module to have the permission
// @tc.desc: Whether to request the camera function permission to the authorization management
// module to have the permission (by Promise)
it('ACTS_CanRequestPermission_0400', 0, async function (done){
var ret = false
var context = await featureAbility.getContext();
var promise = await context.canRequestPermission("com.example.permission");
expect(promise).assertEqual(false);
ret = true
done();
setTimeout(function(){
expect(ret).assertEqual(true)
},1000)
})
// @tc.number: ACTS_CanRequestPermission_0500
// @tc.name: CanRequestPermission : Whether to request the camera function permission to
// the authorization management module to have the permission
// @tc.desc: Whether to request the camera function permission to the authorization management
// module to have the permission (by Promise)
it('ACTS_CanRequestPermission_0500', 0, async function (done){
var ret = false
var context = await featureAbility.getContext();
var promise = await context.canRequestPermission(1000);
expect(promise).assertEqual(null);
ret = true
done();
setTimeout(function(){
expect(ret).assertEqual(true)
},1000)
})
// @tc.number: ACTS_RequestPermissionForUser_0100
// @tc.name: requestPermissionsFromUser : Requests certain permissions from the system.
// permission: The list of permissions to be requested.
......
......@@ -2340,7 +2340,9 @@ describe('ActsFeatureAbilityTest', function () {
}
console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data));
if (events.size == 1) {
expect(events.has("ACTS_GetCallingBundle_0100_CommonEvent")).assertTrue();
expect(events.has("ACTS_GetCallingBundle_0100_CommonEvent") ||
events.has("com.example.actsfeatureabilitytest.promise") ||
events.has("com.example.actsfeatureabilitytest.callback")).assertTrue();
} else if (events.size == 2) {
expect(events.has("com.example.actsfeatureabilitytest.promise") ||
events.has("com.example.actsfeatureabilitytest.callback")).assertTrue();
......
......@@ -19,7 +19,6 @@ group("want") {
deps = [
"actsgetwantalltest:ActsGetWantAllTest",
"sceneProject/actsgetwantalltesthap:ActsGetWantAllTestHap",
"sceneProject/actsgetwantalltesthaptwo:ActsGetWantAllTestHapTwo",
]
}
}
......@@ -12,21 +12,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import commenEvent from '@ohos.commonevent'
import featureAbility from '@ohos.ability.featureability'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import bundle from '@ohos.bundle'
import wantConstant from '@ohos.ability.wantConstant'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const installPath1 = "/data/ActsGetWantAllTestHap.hap"
const installPath2 = "/data/ActsGetWantAllTestHaptwo.hap"
describe('ActsgetWantTest', async function () {
var retFlag = false;
const installPath = "/data/ActsGetWantAllTestHap.hap"
describe('ActsGetWantTest', function () {
beforeAll(async (done) => {
console.debug('=======before all install========');
bundle.getBundleInstaller().then(data => {
data.install([
installPath1,installPath2], {
installPath], {
param: {
userId: 0,
isKeepData: false
......@@ -40,15 +37,12 @@ describe('ActsgetWantTest', async function () {
console.info('========install finish========' + data.status);
console.info('========install finish========' + data.statusMessage);
done()
setTimeout(function(){
console.info('========onReceiveinstallEvent finish========' + JSON.stringify(err));
},1000)
}
})
afterAll((done) => {
console.debug('=======after all uninstall========');
bundle.getBundleInstaller().then(data => {
data.uninstall(["com.example.actsgetwant","com.example.actsgetwanttwo"], {
data.uninstall("com.example.actsgetwantalltesthap", {
param: {
userId: 0,
isKeepData: false
......@@ -62,145 +56,237 @@ describe('ActsgetWantTest', async function () {
console.info('========uninstall finish========' + JSON.stringify(data));
console.info('========uninstall finish========' + data.status);
console.info('========uninstall finish========' + data.statusMessage);
setTimeout(function(){
console.info('========onReceiveinstallEvent finish========' + JSON.stringify(err));
},1000)
done();
}
})
function sleep(delay, flag) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay && flag == false) {
continue;
}
}
function sleep2(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
}
// @tc.number: ACTS_GetWant_0100
// @tc.name: getWant : get want in current ability
// @tc.desc: use event subscriptionsget to get want in current ability (by Promise)
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_0100', 0, async function (done) {
var ret = false
var Subscriber;
var CommonEventSubscriberInfo = {
events: ["ACTS_GetWant_0100_CommonEvent"],
};
featureAbility.startAbilityForResult({
want: {
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
parameters:
{
mykey0: 1,
mykey1: [1, 2, 3],
mykey2: "[1, 2, 3]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmony"],
},
}
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0100 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.parameters.mykey0).assertEqual(1);
expect(data.want.parameters.mykey1[0]).assertEqual(1);
expect(data.want.parameters.mykey1[1]).assertEqual(2);
expect(data.want.parameters.mykey1[2]).assertEqual(3);
expect(data.want.parameters.mykey2).assertEqual("[1, 2, 3]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
function SubscribeCallBack(err, data) {
console.debug("====>Subscriber CallBack01====>");
console.debug("====>Subscriber CallBack data:01====>" + JSON.stringify(data));
expect(data.data).assertEqual("succeed");
Subscriber.unsubscribe(Subscriber, unsubscribeCallback)
retFlag = true
}
console.info('====> before done=====>')
done();
setTimeout(function () {
console.info('====> ACTS_StartAbilityForResult_0100 =====>')
}, 5000)
console.info('====> after done=====>')
})
})
function unsubscribeCallback() {
console.debug("====>UnSubscriber CallBack01====>");
}
commenEvent.createSubscriber(CommonEventSubscriberInfo).then(async (data) => {
console.debug("====>Creat Subscriber01====>");
Subscriber = data;
console.debug("====>subscribe start01====>");
await commenEvent.subscribe(Subscriber, SubscribeCallBack);
console.debug("====>subscribe finish01====>");
})
console.debug("====>startAbility start01====>");
var promise = await featureAbility.startAbility(
{
// @tc.number: ACTS_GetWant_0200
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_0200', 0, async function (done) {
featureAbility.startAbilityForResult({
want: {
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action2",
}
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0200 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action2");
console.info('====> before done=====>')
done();
setTimeout(function () {
console.info('====> ACTS_StartAbilityForResult_0200 =====>')
}, 5000)
console.info('====> after done=====>')
})
})
// @tc.number: ACTS_GetWant_0200
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_0300', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwant",
abilityName: "com.example.actsgetwant.MainAbility",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0300 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
console.info('====> before done=====>')
done();
setTimeout(function () {
console.info('====> ACTS_StartAbilityForResult_0300 =====>')
}, 5000)
console.info('====> after done=====>')
})
})
// @tc.number: ACTS_GetWant_0400
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_0400', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action2",
entities: ["entity1","entity2"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags:wantConstant.Flags.FLAG_ABILITY_FORWARD_RESULT,
parameters:
{
mykey0: 1,
mykey1: [1, 2, 3],
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.3],
mykey2: "[1, 2, 3]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmony"],
mykey5: ["str", "!@#$%", "helloopenharmony"],
},
},
},
);
console.debug("====>startAbility finish01====>");
done();
console.debug("==============start waiting 5s....");
sleep(5000, retFlag);
retFlag = false;
console.debug("==============end waiting 5s.");
console.debug("====the first case finished and wait 5s.");
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0400 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action2");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.entities[1]).assertEqual("entity2");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_FORWARD_RESULT);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.3);
expect(data.want.parameters.mykey2).assertEqual("[1, 2, 3]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("!@#$%");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> before done=====>')
done();
setTimeout(function () {
console.info('====> ACTS_StartAbilityForResult_0400 =====>')
}, 5000)
console.info('====> after done=====>')
})
})
sleep2(2000);
console.debug("====the first end.");
console.debug("=====================================continue then Exit.");
// @tc.number: ACTS_GetWant_0200
// @tc.number: ACTS_GetWant_0500
// @tc.name: getWant : get want in current ability
// @tc.desc: use event subscriptionsget to get want in current ability (by callback)
it('ACTS_GetWant_0200', 0, async function (done) {
retFlag = false;
var Subscriber;
var CommonEventSubscriberInfo = {
events: ["ACTS_GetWant_0200_CommonEvent"],
};
function SubscribeCallBack2(err, data) {
console.debug("====>Subscriber CallBack02====>");
console.debug("====>Subscriber CallBack data:02====>" + JSON.stringify(data));
expect(data.data).assertEqual("succeed");
Subscriber.unsubscribe(Subscriber, unsubscribeCallback2)
retFlag = true;
}
function unsubscribeCallback2() {
console.debug("====>UnSubscriber CallBack02====>");
}
await commenEvent.createSubscriber(CommonEventSubscriberInfo).then(async (data) => {
console.debug("====>Creat Subscriber02====>");
Subscriber = data;
console.debug("====>subscribe start02====>");
await commenEvent.subscribe(Subscriber, SubscribeCallBack2);
console.debug("====>subscribe finish02====>");
})
console.debug("====>startAbility start02====>");
var promise = await featureAbility.startAbility(
{
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_0500', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
bundleName: "com.example.actsgetwanttwo",
abilityName: "com.example.actsgetwanttwo.MainAbility",
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags:wantConstant.Flags.FLAG_ABILITY_FORM_ENABLED,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
);
done();
setTimeout(function(){
console.debug("====>wangdalaowangwwwwwwwwwwwwwwwwwww====>");
},5000);
console.debug("====>startAbility finish02====>");
sleep(5000, retFlag);
console.debug("====>startAbility finish02===========1=>");
retFlag = false;
console.debug("====>startAbility finish02===========2=>");
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0500 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_FORM_ENABLED);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> before done=====>')
done();
setTimeout(function () {
console.info('====> ACTS_StartAbilityForResult_0500 =====>')
}, 5000)
console.info('====> after done=====>')
})
})
})
......@@ -12,113 +12,36 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import commonEvent from '@ohos.commonevent'
import featureAbility from '@ohos.ability.featureability'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var globalWant;
export default {
data: {
title: "预置"
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
function publishCallback(err) {
console.debug("====>publish call back ACTS_GetWant_0100_CommonEvent err====>" + JSON.stringify(err));
}
function timeout() {
console.debug("====>time out set hap====>");
}
console.log("==========getWant===========");
featureAbility.getWant().then(
data => {
console.debug("==========data1 is===========" + JSON.stringify(data));
var str = "succeed";
if (data.deviceId != "") {
str = "fail"
console.debug("====>deviceId fail====");
}
if (data.bundleName != "com.example.actsgetwant") {
str = "fail"
console.debug("====>bundleName fail====");
}
if (data.abilityName != "com.example.actsgetwant.MainAbility") {
str = "fail"
console.debug("====>abilityName fail====");
}
if (data.action != "action1") {
str = "fail"
console.debug("====>action fail====");
}
if (data.parameters.mykey0 != 1) {
str = "fail"
console.debug("====>mykey0 fail====");
}
if (data.parameters.mykey1[0] != 1) {
str = "fail"
console.debug("====>mykey1[0] fail====");
}
if (data.parameters.mykey1[1] != 2) {
str = "fail"
console.debug("====>mykey1[2] fail====");
}
if (data.parameters.mykey1[2] != 3) {
str = "fail"
console.debug("====>mykey1[3] fail====");
}
if (data.parameters.mykey2 != "[1, 2, 3]") {
str = "fail"
console.debug("====>mykey2 fail====");
}
if (data.parameters.mykey3 != "str") {
str = "fail"
console.debug("====>mykey3 fail====");
}
if (data.parameters.mykey4[0] != false) {
str = "fail"
console.debug("====>mykey4[0] fail====");
}
if (data.parameters.mykey4[1] != true) {
str = "fail"
console.debug("====>mykey4[1] fail====");
}
if (data.parameters.mykey4[2] != false) {
str = "fail"
console.debug("====>mykey4[2] fail====");
}
if (data.parameters.mykey5[0] != "str") {
str = "fail"
console.debug("====>mykey5[0] fail====");
}
if (data.parameters.mykey5[1] != "STR") {
str = "fail"
console.debug("====>mykey5[1] fail====");
}
if (data.parameters.mykey5[2] != "helloopenharmony") {
str = "fail"
console.debug("====>mykey5[2] fail====");
}
onShow() {
console.info('============Start Ability onShow finish');
var publishDataOne = {
code: 1,
data: str
}
console.log("==========================send commonevent start.");
commonEvent.publish("ACTS_GetWant_0100_CommonEvent",publishDataOne, publishCallback);
console.log("==========================send commonevent end.");
console.log("commonEvent.publish finish01")
featureAbility.getWant(
(err, data) => {
globalWant = data;
console.debug("==========data=" + JSON.stringify(globalWant));
setTimeout(function(){
console.debug("==========data1 bundleName is===========" + JSON.stringify(globalWant.bundleName));
var promise = featureAbility.terminateSelfWithResult(
{
resultCode: 1,
want: globalWant
}
);
},5000);
}
).catch(error =>
console.log("featureAbility getWant_0100::catch : " + error)
)
},
onReady() {
},
}
......@@ -20,6 +20,9 @@ group("ams_standard") {
"amsdatauriutils:amsDataUriUtils",
"amszipfileunzipfilest:amsZipfileUnzipfileST",
"fwkdataaccessor:FWKDataAccessor",
"serviceability/actsparticleabilitytest:ActsParticleAbilityTest",
"serviceability/sceneProject/particlestartability:ParticleStartAbility",
"serviceability/sceneProject/particletestserver:ParticleTestServer",
"serviceability/stserviceabilityclient:amsStServiceAbilityClient",
"serviceability/stserviceabilityserver:amsStServiceAilityServer",
]
......
......@@ -1600,7 +1600,7 @@ it('ACTS_unzipFile_0100', 0, async function (done) {
var src ="";
var dest ="";
zlib.zipFile(src,dest,
zlib.unzipFile(src,dest,
(err, data) => {
console.log("unzipFileCallBack_0100 err: " + err.code);
console.log("unzipFileCallBack_0100 data: " + data);
......@@ -1625,10 +1625,10 @@ it('ACTS_unzipFile_0100', 0, async function (done) {
it('ACTS_unzipFile_0200', 0, async function (done) {
console.log("==================ACTS_unzipFile_0200 start==================");
var src ="/data/test/zip_amsZipfileUnzipfileST-signed.zip";
var dest ="/data/test/";
var src ="/data/test/";
var dest ="/data/test/amsZipfileUnzipfileST.hap";
zlib.zipFile(src,dest,
zlib.unzipFile(src,dest,
(err, data) => {
console.log("unzipFileCallBack_0200 err: " + err.code);
console.log("unzipFileCallBack_0200 data: " + data);
......@@ -1638,7 +1638,7 @@ it('ACTS_unzipFile_0200', 0, async function (done) {
function timeout() {
expect().assertFail();
console.debug('ACTS_unzipFile_0100=====timeout======');
console.debug('ACTS_unzipFile_0200=====timeout======');
}
setTimeout(timeout, 5000);
done();
......@@ -1653,10 +1653,10 @@ it('ACTS_unzipFile_0200', 0, async function (done) {
it('ACTS_unzipFile_0300', 0, async function (done) {
console.log("==================ACTS_unzipFile_0300 start==================");
var src ="";
var src ="/data/test/amsZipfileUnzipfileST.hap";
var dest ="/data/test/amsZipfileUnzipfileST.hap";
zlib.zipFile(src,dest,
zlib.unzipFile(src,dest,
(err, data) => {
console.log("unzipFileCallBack_0300 err: " + err.code);
console.log("unzipFileCallBack_0300 data: " + data);
......@@ -1684,7 +1684,7 @@ it('ACTS_unzipFile_0400', 0, async function (done) {
var src ="/data/test/zip_amsZipfileUnzipfileST-signed.zip";
var dest ="/data/testA/";
zlib.zipFile(src,dest,
zlib.unzipFile(src,dest,
(err, data) => {
console.log("unzipFileCallBack_0400 err: " + err.code);
console.log("unzipFileCallBack_0400 data: " + data);
......@@ -1715,36 +1715,36 @@ it('ACTS_unzipFile_0500', 0, async function (done) {
var Options= {
flushFlush:FLUSH_TYPE_NO_FLUSH,
};
await zlib.zipFile(src,dest,Options,
await zlib.unzipFile(src,dest,Options,
() => {
console.log("ACTS_zipFile_0500 err:================================ ");
console.log("ACTS_unzipFile_0500 err:================================ ");
try{
var isfileio = fileio.accessSync(dest)
console.log("ACTS_zipFile_0500 isfileio:==============> "+JSON.stringify(isfileio));
console.log("ACTS_unzipFile_0500 isfileio:==============> "+JSON.stringify(isfileio));
var isDest = (fileio.accessSync(dest) !== null)
console.log("ACTS_zipFile_0500 isDest:==============> " +isDest);
console.log("ACTS_unzipFile_0500 isDest:==============> " +isDest);
expect(isDest).assertTrue();
var big = fileio.statSync(src).size;
var small = fileio.statSync(dest).size;
var isBigSmall = (big>=small)
var isBigSmall = (big<=small)
expect(isBigSmall).assertTrue();
console.log("ACTS_zipFile_0500 big=" + big);
console.log("ACTS_zipFile_0500 small=" + small);
console.log("ACTS_zipFile_0500 big>=small=" + isBigSmall);
console.log("ACTS_unzipFile_0500 big=" + big);
console.log("ACTS_unzipFile_0500 small=" + small);
console.log("ACTS_unzipFile_0500 big<=small=" + isBigSmall);
}catch(err) {
console.error('ACTS_zipFile_0500 assertTure err:' + err);
console.error('ACTS_unzipFile_0500 assertTure err:' + err);
}
console.debug('ACTS_zipFile_0500=====size======');
console.debug('ACTS_unzipFile_0500=====size======');
done();
});
}catch(err) {
console.error('ACTS_zipFile_0500 size err:' + err);
console.error('ACTS_unzipFile_0500 size err:' + err);
done();
}
setTimeout(function(){
console.debug('ACTS_zipFile_0500=====timeout======');
console.debug('ACTS_unzipFile_0500=====timeout======');
}, '1000');
})
......@@ -1764,36 +1764,36 @@ it('ACTS_unzipFile_0600', 0, async function (done) {
var Options= {
flushFlush:FLUSH_TYPE_PARTIAL_FLUSH,
};
await zlib.zipFile(src,dest,Options,
await zlib.unzipFile(src,dest,Options,
() => {
console.log("ACTS_zipFile_0600 err:================================ ");
console.log("ACTS_unzipFile_0600 err:================================ ");
try{
var isfileio = fileio.accessSync(dest)
console.log("ACTS_zipFile_0600 isfileio:==============> "+JSON.stringify(isfileio));
console.log("ACTS_unzipFile_0600 isfileio:==============> "+JSON.stringify(isfileio));
var isDest = (fileio.accessSync(dest) !== null)
console.log("ACTS_zipFile_0600 isDest:==============> " +isDest);
console.log("ACTS_unzipFile_0600 isDest:==============> " +isDest);
expect(isDest).assertTrue();
var big = fileio.statSync(src).size;
var small = fileio.statSync(dest).size;
var isBigSmall = (big>=small)
var isBigSmall = (big<=small)
expect(isBigSmall).assertTrue();
console.log("ACTS_zipFile_0600 big=" + big);
console.log("ACTS_zipFile_0600 small=" + small);
console.log("ACTS_zipFile_0600 big>=small=" + isBigSmall);
console.log("ACTS_unzipFile_0600 big=" + big);
console.log("ACTS_unzipFile_0600 small=" + small);
console.log("ACTS_unzipFile_0600 big<=small=" + isBigSmall);
}catch(err) {
console.error('ACTS_zipFile_0600 assertTure err:' + err);
console.error('ACTS_unzipFile_0600 assertTure err:' + err);
}
console.debug('ACTS_zipFile_0600=====size======');
console.debug('ACTS_unzipFile_0600=====size======');
done();
});
}catch(err) {
console.error('ACTS_zipFile_0600 size err:' + err);
console.error('ACTS_unzipFile_0600 size err:' + err);
done();
}
setTimeout(function(){
console.debug('ACTS_zipFile_0600=====timeout======');
console.debug('ACTS_unzipFile_0600=====timeout======');
}, '1000');
})
......@@ -1814,36 +1814,36 @@ it('ACTS_unzipFile_0700', 0, async function (done) {
var Options= {
flushFlush:FLUSH_TYPE_SYNC_FLUSH,
};
await zlib.zipFile(src,dest,Options,
await zlib.unzipFile(src,dest,Options,
() => {
console.log("ACTS_zipFile_0700 err:================================ ");
console.log("ACTS_unzipFile_0700 err:================================ ");
try{
var isfileio = fileio.accessSync(dest)
console.log("ACTS_zipFile_0700 isfileio:==============> "+JSON.stringify(isfileio));
console.log("ACTS_unzipFile_0700 isfileio:==============> "+JSON.stringify(isfileio));
var isDest = (fileio.accessSync(dest) !== null)
console.log("ACTS_zipFile_0700 isDest:==============> " +isDest);
console.log("ACTS_unzipFile_0700 isDest:==============> " +isDest);
expect(isDest).assertTrue();
var big = fileio.statSync(src).size;
var small = fileio.statSync(dest).size;
var isBigSmall = (big>=small)
var isBigSmall = (big<=small)
expect(isBigSmall).assertTrue();
console.log("ACTS_zipFile_0700 big=" + big);
console.log("ACTS_zipFile_0700 small=" + small);
console.log("ACTS_zipFile_0700 big>=small=" + isBigSmall);
console.log("ACTS_unzipFile_0700 big=" + big);
console.log("ACTS_unzipFile_0700 small=" + small);
console.log("ACTS_unzipFile_0700 big<=small=" + isBigSmall);
}catch(err) {
console.error('ACTS_zipFile_0700 assertTure err:' + err);
console.error('ACTS_unzipFile_0700 assertTure err:' + err);
}
console.debug('ACTS_zipFile_0700=====size======');
console.debug('ACTS_unzipFile_0700=====size======');
done();
});
}catch(err) {
console.error('ACTS_zipFile_0700 size err:' + err);
console.error('ACTS_unzipFile_0700 size err:' + err);
done();
}
setTimeout(function(){
console.debug('ACTS_zipFile_0700=====timeout======');
console.debug('ACTS_unzipFile_0700=====timeout======');
}, '1000');
})
......@@ -1864,36 +1864,36 @@ it('ACTS_unzipFile_0800', 0, async function (done) {
var Options= {
flushFlush:FLUSH_TYPE_FULL_FLUSH,
};
await zlib.zipFile(src,dest,Options,
await zlib.unzipFile(src,dest,Options,
() => {
console.log("ACTS_zipFile_0800 err:================================ ");
console.log("ACTS_unzipFile_0800 err:================================ ");
try{
var isfileio = fileio.accessSync(dest)
console.log("ACTS_zipFile_0800 isfileio:==============> "+JSON.stringify(isfileio));
console.log("ACTS_unzipFile_0800 isfileio:==============> "+JSON.stringify(isfileio));
var isDest = (fileio.accessSync(dest) !== null)
console.log("ACTS_zipFile_0800 isDest:==============> " +isDest);
console.log("ACTS_unzipFile_0800 isDest:==============> " +isDest);
expect(isDest).assertTrue();
var big = fileio.statSync(src).size;
var small = fileio.statSync(dest).size;
var isBigSmall = (big>=small)
var isBigSmall = (big<=small)
expect(isBigSmall).assertTrue();
console.log("ACTS_zipFile_0800 big=" + big);
console.log("ACTS_zipFile_0800 small=" + small);
console.log("ACTS_zipFile_0800 big>=small=" + isBigSmall);
console.log("ACTS_unzipFile_0800 big=" + big);
console.log("ACTS_unzipFile_0800 small=" + small);
console.log("ACTS_unzipFile_0800 big<=small=" + isBigSmall);
}catch(err) {
console.error('ACTS_zipFile_0800 assertTure err:' + err);
console.error('ACTS_unzipFile_0800 assertTure err:' + err);
}
console.debug('ACTS_zipFile_0800=====size======');
console.debug('ACTS_unzipFile_0800=====size======');
done();
});
}catch(err) {
console.error('ACTS_zipFile_0800 size err:' + err);
console.error('ACTS_unzipFile_0800 size err:' + err);
done();
}
setTimeout(function(){
console.debug('ACTS_zipFile_0800=====timeout======');
console.debug('ACTS_unzipFile_0800=====timeout======');
}, '1000');
})
......@@ -1912,38 +1912,38 @@ it('ACTS_unzipFile_0900', 0, async function (done) {
try{
var Options= {
flushFlush:FLUSH_TYPE__FINISH,
flushFlush:FLUSH_TYPE_FINISH,
};
await zlib.zipFile(src,dest,Options,
await zlib.unzipFile(src,dest,Options,
() => {
console.log("ACTS_zipFile_0900 err:================================ ");
console.log("ACTS_unzipFile_0900 err:================================ ");
try{
var isfileio = fileio.accessSync(dest)
console.log("ACTS_zipFile_0900 isfileio:==============> "+JSON.stringify(isfileio));
console.log("ACTS_unzipFile_0900 isfileio:==============> "+JSON.stringify(isfileio));
var isDest = (fileio.accessSync(dest) !== null)
console.log("ACTS_zipFile_0900 isDest:==============> " +isDest);
console.log("ACTS_unzipFile_0900 isDest:==============> " +isDest);
expect(isDest).assertTrue();
var big = fileio.statSync(src).size;
var small = fileio.statSync(dest).size;
var isBigSmall = (big>=small)
var isBigSmall = (big<=small)
expect(isBigSmall).assertTrue();
console.log("ACTS_zipFile_0900 big=" + big);
console.log("ACTS_zipFile_0900 small=" + small);
console.log("ACTS_zipFile_0900 big>=small=" + isBigSmall);
console.log("ACTS_unzipFile_0900 big=" + big);
console.log("ACTS_unzipFile_0900 small=" + small);
console.log("ACTS_unzipFile_0900 big<=small=" + isBigSmall);
}catch(err) {
console.error('ACTS_zipFile_0900 assertTure err:' + err);
console.error('ACTS_unzipFile_0900 assertTure err:' + err);
}
console.debug('ACTS_zipFile_0900=====size======');
console.debug('ACTS_unzipFile_0900=====size======');
done();
});
}catch(err) {
console.error('ACTS_zipFile_0900 size err:' + err);
console.error('ACTS_unzipFile_0900 size err:' + err);
done();
}
setTimeout(function(){
console.debug('ACTS_zipFile_0900=====timeout======');
console.debug('ACTS_unzipFile_0900=====timeout======');
}, '1000');
})
......@@ -1964,36 +1964,36 @@ it('ACTS_unzipFile_1000', 0, async function (done) {
var Options= {
flushFlush:FLUSH_TYPE_BLOCK,
};
await zlib.zipFile(src,dest,Options,
await zlib.unzipFile(src,dest,Options,
() => {
console.log("ACTS_zipFile_1000 err:================================ ");
console.log("ACTS_unzipFile_1000 err:================================ ");
try{
var isfileio = fileio.accessSync(dest)
console.log("ACTS_zipFile_1000 isfileio:==============> "+JSON.stringify(isfileio));
console.log("ACTS_unzipFile_1000 isfileio:==============> "+JSON.stringify(isfileio));
var isDest = (fileio.accessSync(dest) !== null)
console.log("ACTS_zipFile_1000 isDest:==============> " +isDest);
console.log("ACTS_unzipFile_1000 isDest:==============> " +isDest);
expect(isDest).assertTrue();
var big = fileio.statSync(src).size;
var small = fileio.statSync(dest).size;
var isBigSmall = (big>=small)
var isBigSmall = (big<=small)
expect(isBigSmall).assertTrue();
console.log("ACTS_zipFile_1000 big=" + big);
console.log("ACTS_zipFile_1000 small=" + small);
console.log("ACTS_zipFile_1000 big>=small=" + isBigSmall);
console.log("ACTS_unzipFile_1000 big=" + big);
console.log("ACTS_unzipFile_1000 small=" + small);
console.log("ACTS_unzipFile_1000 big<=small=" + isBigSmall);
}catch(err) {
console.error('ACTS_zipFile_1000 assertTure err:' + err);
console.error('ACTS_unzipFile_1000 assertTure err:' + err);
}
console.debug('ACTS_zipFile_1000=====size======');
console.debug('ACTS_unzipFile_1000=====size======');
done();
});
}catch(err) {
console.error('ACTS_zipFile_1000 size err:' + err);
console.error('ACTS_unzipFile_1000 size err:' + err);
done();
}
setTimeout(function(){
console.debug('ACTS_zipFile_1000=====timeout======');
console.debug('ACTS_unzipFile_1000=====timeout======');
}, '1000');
})
......@@ -2013,36 +2013,36 @@ it('ACTS_unzipFile_1100', 0, async function (done) {
var Options= {
flushFlush:FLUSH_TYPE_TREES,
};
await zlib.zipFile(src,dest,Options,
await zlib.unzipFile(src,dest,Options,
() => {
console.log("ACTS_zipFile_1100 err:================================ ");
console.log("ACTS_unzipFile_1100 err:================================ ");
try{
var isfileio = fileio.accessSync(dest)
console.log("ACTS_zipFile_1100 isfileio:==============> "+JSON.stringify(isfileio));
console.log("ACTS_unzipFile_1100 isfileio:==============> "+JSON.stringify(isfileio));
var isDest = (fileio.accessSync(dest) !== null)
console.log("ACTS_zipFile_1100 isDest:==============> " +isDest);
console.log("ACTS_unzipFile_1100 isDest:==============> " +isDest);
expect(isDest).assertTrue();
var big = fileio.statSync(src).size;
var small = fileio.statSync(dest).size;
var isBigSmall = (big>=small)
var isBigSmall = (big<=small)
expect(isBigSmall).assertTrue();
console.log("ACTS_zipFile_1100 big=" + big);
console.log("ACTS_zipFile_1100 small=" + small);
console.log("ACTS_zipFile_1100 big>=small=" + isBigSmall);
console.log("ACTS_unzipFile_1100 big=" + big);
console.log("ACTS_unipFile_1100 small=" + small);
console.log("ACTS_unzipFile_1100 big<=small=" + isBigSmall);
}catch(err) {
console.error('ACTS_zipFile_1100 assertTure err:' + err);
console.error('ACTS_unzipFile_1100 assertTure err:' + err);
}
console.debug('ACTS_zipFile_1100=====size======');
console.debug('ACTS_unzipFile_1100=====size======');
done();
});
}catch(err) {
console.error('ACTS_zipFile_0500 size err:' + err);
console.error('ACTS_unzipFile_0500 size err:' + err);
done();
}
setTimeout(function(){
console.debug('ACTS_zipFile_1100=====timeout======');
console.debug('ACTS_unzipFile_1100=====timeout======');
}, '1000');
})
......
# 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsParticleAbilityTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsParticleAbilityTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "60000",
"package": "com.example.actsparticleabilitytest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsParticleAbilityTest.hap",
"ParticleStartAbility.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.actsparticleabilitytest",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsparticleabilitytest",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.actsparticleabilitytest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard",
"visible": true
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
......@@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
......@@ -20,4 +19,5 @@ export default {
onDestroy() {
console.info('AceApplication onDestroy');
}
};
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
.btn {
width: 200px;
height: 80px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<button class="btn" type="capsule" value="start" onclick="start"></button>
</div>
......@@ -12,59 +12,32 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import commonEvent from '@ohos.commonevent'
import featureAbility from '@ohos.ability.featureability'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: "预置"
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
function publishCallback(err) {
console.debug("====>publish call back ACTS_GetWant_0100_CommonEvent err====>" + JSON.stringify(err));
}
function timeout() {
console.debug("====>time out set hap====>");
}
console.log("==========getWant===========");
featureAbility.getWant(
(err, data) => {
console.debug("==========data2 is===========" + JSON.stringify(data));
var str = "succeed";
if (data.bundleName != "com.example.actsgetwanttwo") {
str = "fail"
console.debug("====>bundleName fail====");
}
if (data.abilityName != "com.example.actsgetwanttwo.MainAbility") {
str = "fail"
console.debug("====>abilityName fail====");
}
var publishDataTwo = {
code: 2,
data: str
}
console.log("==========================send commonevent2 start.");
commonEvent.publish("ACTS_GetWant_0200_CommonEvent", publishDataTwo, publishCallback);
console.log("==========================send commonevent2 end.");
console.log("commonEvent.publish finish02")
}
).catch(error =>
console.log("featureAbility getWant_0200::catch : " + error)
)
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
{
"string": [
{
"name": "app_name",
"value": "actsparticleabilitytest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
/*
* 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 commonEvent from "@ohos.commonevent"
import rpc from "@ohos.rpc"
import featureAbility from '@ohos.ability.featureAbility'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 9000;
const START_ABILITY_TIMEOUT = 5000;
var subscriberInfoStartAbility_0100 = {
events: ["ACTS_Particle_StartAbility_0100_CommonEvent"],
};
var subscriberInfoStartAbility_0200 = {
events: ["ACTS_Particle_StartAbility_0200_CommonEvent"],
};
describe('ActsStServiceAbilityTest', function () {
let bundleName = "com.example.particletestserver";
let abilityName = "com.example.particletestserver.MainAbility";
var mRemote;
function onConnectCallback(element, remote) {
console.log('ACTS_featureAbilityTest ConnectAbility onConnect element.deviceId : ' + element.deviceId)
console.log('ACTS_featureAbilityTest ConnectAbility onConnect element.bundleName : ' + element.bundleName)
console.log('ACTS_featureAbilityTest ConnectAbility onConnect element.abilityName : ' + element.abilityName)
console.log('ACTS_featureAbilityTest ConnectAbility onConnect element.uri : ' + element.uri)
console.log('ACTS_featureAbilityTest ConnectAbility onConnect element.shortName : ' + element.shortName)
console.log('ACTS_featureAbilityTest ConnectAbility onConnect remote : ' + remote);
mRemote = remote;
console.log('ACTS_featureAbilityTest ConnectAbility onConnect remote 是否为proxy:' + (remote instanceof rpc.RemoteProxy));
}
function onDisconnectCallback(element) {
console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.deviceId : ' + element.deviceId)
console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.uri : ' + element.uri)
console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.shortName : ' + element.shortName)
}
function onFailedCallback(code) {
console.log('ACTS_featureAbilityTest ConnectAbility onFailed errCode : ' + code)
}
/*
* @tc.number: ACTS_ParticleAbility_startAbility_0100
* @tc.name: ConnectAbility : Connects an ability to a Service ability.
* @tc.desc: Check the return value of the interface (by Promise)
*/
it('ACTS_ParticleAbility_startAbility_0100', 0, async function (done) {
console.log('ACTS_ParticleAbility_startAbility_0100====<begin');
console.log('========StartConnect called');
var subscriber;
let id;
let connId;
function subscribeCallBack(err, data) {
clearTimeout(id);
expect(data.event).assertEqual("ACTS_Particle_StartAbility_0100_CommonEvent");
console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data));
var result = featureAbility.disconnectAbility(
connId,
(error, data) => {
console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data)
},
);
console.log('DisconnectNative ConnectAbility result : ' + result);
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
done();
}
commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => {
console.debug("====>Create Subscriber====>");
subscriber = data;
await commonEvent.subscribe(subscriber, subscribeCallBack);
})
function unSubscribeCallback() {
console.debug("====>UnSubscribe CallBack====>");
done();
}
function timeout() {
expect().assertFail();
console.debug('ACTS_ParticleAbility_startAbility_0100 timeout');
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
done();
}
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
connId = await featureAbility.connectAbility(
{
bundleName: bundleName,
abilityName: abilityName,
action: "StartAbilityPromise"
},
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback,
onFailed: onFailedCallback,
},
);
console.log('StartConnectNative ConnectAbility connId : ' + connId);
setTimeout(function () {
console.log('StartConnectNative ConnectAbility timeout')
}, TIMEOUT);
})
/*
* @tc.number: ACTS_ParticleAbility_startAbility_0200
* @tc.name: ConnectAbility : Connects an ability to a Service ability.
* @tc.desc: Check the return value of the interface (by Promise)
*/
it('ACTS_ParticleAbility_startAbility_0200', 0, async function (done) {
console.log('ACTS_ParticleAbility_startAbility_0200====<begin');
console.log('========StartConnect called');
var subscriber;
let id;
let connId;
function subscribeCallBack(err, data) {
clearTimeout(id);
expect(data.event).assertEqual("ACTS_Particle_StartAbility_0200_CommonEvent");
console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data));
var result = featureAbility.disconnectAbility(
connId,
(error,data) => {
console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data)
},
);
console.log('DisconnectNative ConnectAbility result : ' + result);
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
done();
}
commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => {
console.debug("====>Create Subscriber====>");
subscriber = data;
await commonEvent.subscribe(subscriber, subscribeCallBack);
})
function unSubscribeCallback() {
console.debug("====>UnSubscribe CallBack====>");
done();
}
function timeout() {
expect().assertFail();
console.debug('ACTS_ParticleAbility_startAbility_0200 timeout');
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
done();
}
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
connId = await featureAbility.connectAbility(
{
bundleName: bundleName,
abilityName: abilityName,
action: "StartAbilityCallback"
},
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback,
onFailed: onFailedCallback,
},
);
console.log('StartConnectNative ConnectAbility connId : ' + connId);
setTimeout(function () {
console.log('StartConnectNative ConnectAbility timeout')
}, TIMEOUT);
})
})
\ No newline at end of file
/*
* 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.
*/
require('./ActsParticleAbilityTest.test.js')
\ No newline at end of file
# 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("//test/xts/tools/build/suite.gni")
ohos_hap("ParticleStartAbility") {
hap_profile = "./src/main/config.json"
hap_name = "ParticleStartAbility"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/js/resources" ]
hap_profile = "./src/main/config.json"
}
{
"app": {
"bundleName": "com.example.actsgetwantalltesthaptwo",
"bundleName": "com.example.particlestartability",
"vendor": "example",
"version": {
"code": 1,
......@@ -14,8 +14,8 @@
},
"deviceConfig": {},
"module": {
"package": "com.example.actsgetwantallhaptwo",
"name": "com.example.actsgetwantalltesthap.MyApplication",
"package": "com.example.particlestartability",
"name": ".MyApplication",
"deviceType": [
"phone"
],
......@@ -36,7 +36,8 @@
]
}
],
"name": "com.example.actsgetwantalltesthaptwo.MainAbility",
"name": "com.example.particlestartability.MainAbility",
"visible": true,
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
......@@ -57,4 +58,4 @@
}
]
}
}
}
\ No newline at end of file
/*
* 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
/*
* 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 commonEvent from '@ohos.commonevent'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
function publishCallBackOne() {
console.debug("====>Publish CallBack ACTS_Particle_StartAbility_0100_CommonEvent====>");
}
function publishCallBackTwo() {
console.debug("====>Publish CallBack ACTS_Particle_StartAbility_0200_CommonEvent====>");
}
function publishCallBackThree() {
console.debug("====>Publish CallBack ACTS_Particle_StartAbility_0300_CommonEvent====>");
}
function publishCallBackFour() {
console.debug("====>Publish CallBack ACTS_Particle_StartAbility_0400_CommonEvent====>");
}
function publishCallBackFive() {
console.debug("====>Publish CallBack ACTS_Particle_StartAbility_0500_CommonEvent====>");
}
function publishCallBackSix() {
console.debug("====>Publish CallBack ACTS_Particle_StartAbility_0600_CommonEvent====>");
}
export default {
data: {
title: "ParticleStartAbility"
},
onInit() {
this.title = this.data.title;
},
onShow() {
commonEvent.publish("ACTS_Particle_StartAbility_0100_CommonEvent", publishCallBackOne);
commonEvent.publish("ACTS_Particle_StartAbility_0200_CommonEvent", publishCallBackTwo);
commonEvent.publish("ACTS_Particle_StartAbility_0300_CommonEvent", publishCallBackThree);
commonEvent.publish("ACTS_Particle_StartAbility_0400_CommonEvent", publishCallBackFour);
commonEvent.publish("ACTS_Particle_StartAbility_0500_CommonEvent", publishCallBackFive);
commonEvent.publish("ACTS_Particle_StartAbility_0600_CommonEvent", publishCallBackSix);
},
onReady() {
},
}
{
"string": [
{
"name": "app_name",
"value": "particlestartability"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
......@@ -12,9 +12,9 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsGetWantAllTestHapTwo") {
ohos_hap("ParticleTestServer") {
hap_profile = "./src/main/config.json"
hap_name = "ActsGetWantAllTestHapTwo"
hap_name = "ParticleTestServer"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
......
{
"description": "Configuration for hjunit demo Tests",
}
{
"app": {
"bundleName": "com.example.particletestserver",
"vendor": "neusoft",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.particletestserver",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"visible": true,
"name": "com.example.particletestserver.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "service",
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* 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 rpc from "@ohos.rpc"
import particleAbility from '@ohos.ability.particleability'
let mMyStub;
let mMyProxy;
export default {
data: {
title: ""
},
onStart(want) {
console.log('SerivceAbilityServer onStart');
class MyStub extends rpc.RemoteObject {
constructor(des) {
if (typeof des === 'string') {
super(des, des.length);
}
return null;
}
onRemoteRequest(code, message, reply, option) {
console.log("RPCTestServer onRemoteRequest called 1111");
console.log("RPCTestServer onRemoteRequest code:" + code);
if (code === 1) {
let getContextObject = rpc.IPCSkeleton.getContextObject();
let getCallingPid = rpc.IPCSkeleton.getCallingPid();
let getCallingUid = rpc.IPCSkeleton.getCallingUid();
let getCallingDeviceID = rpc.IPCSkeleton.getCallingDeviceID();
let getLocalDeviceID = rpc.IPCSkeleton.getLocalDeviceID();
let isLocalCalling = rpc.IPCSkeleton.isLocalCalling();
let remoteObject = new rpc.RemoteObject("aaa", 3);
let flushCommands = rpc.IPCSkeleton.flushCommands(remoteObject);
let resetCallingIdentity = rpc.IPCSkeleton.resetCallingIdentity();
let setCallingIdentity = rpc.IPCSkeleton.setCallingIdentity("aaa", 3);
let num = message.readInt();
let msg = message.readString();
console.log("num is " + num + "msg is " + msg);
reply.writeString("Success");
return true;
}
}
}
mMyStub = new MyStub("ServiceAbility-test");
},
onStop() {
console.log('SerivceAbilityServer onStop');
},
onConnect(want) {
console.log('stub SerivceAbilityServer OnConnect' + JSON.stringify(want));
if (want.action == 'StartAbilityPromise') {
console.log('stub SerivceAbilityServer OnConnect start 1');
console.log('=======startAbilityPromise=======')
particleAbility.startAbility(
{
want:
{
action: "action.system.home",
entities: ["entity.system.home"],
type: "MIMETYPE",
deviceId: "",
bundleName: "com.example.particlestartability",
abilityName: "com.example.particlestartability.MainAbility",
uri: ""
},
}
);
}
if (want.action == 'StartAbilityCallback') {
console.log('stub SerivceAbilityServer OnConnect start 2')
console.log('=======startAbilityCallback=======')
particleAbility.startAbility(
{
want:
{
action: "action.system.home",
entities: ["entity.system.home"],
type: "MIMETYPE",
deviceId: "",
bundleName: "com.example.particlestartability",
abilityName: "com.example.particlestartability.MainAbility",
uri: ""
},
}, (err, data) => {
console.debug('=====start Ability callback=====' + err.code + ', data ' + data);
}
);
}
return mMyStub;
},
onReconnect(want) {
console.log('SerivceAbilityServer onReconnect');
},
onDisconnect() {
console.log('SerivceAbilityServer OnDisConnect');
},
onCommand(want, restart, startId) {
console.log('SerivceAbilityServer onCommand');
},
}
......@@ -32,7 +32,8 @@
{
"type": "ShellKit",
"run-command": [
"chmod 644 /data/*.hap"
"chmod 644 /data/*.hap",
"chmod 600 /data/bmsJstest7.hap"
]
}
]
......
......@@ -207,7 +207,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfos interfaces with one hap.
*/
it('getApplicationInfos_0100', 0, async function (done) {
var datainfo = await demo.getApplicationInfos(8, 0)
var datainfo = await demo.getAllApplicationInfo(8, 0)
checkgetApplicationInfos(datainfo)
done()
setTimeout(function () {
......@@ -240,7 +240,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfos interfaces with one hap.
*/
it('getApplicationInfos_0600', 0, async function (done) {
await demo.getApplicationInfos(8, 0, (error, datainfo) => {
await demo.getAllApplicationInfo(8, 0, (error, datainfo) => {
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
......@@ -270,7 +270,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfos interfaces with one hap.
*/
it('getBundleInfos_0100', 0, async function (done) {
var data = await demo.getBundleInfos(0)
var data = await demo.getAllBundleInfo(0)
expect(typeof data).assertEqual(OBJECT)
expect(data.length).assertLarger(0)
for (var i = 0; i < data.length; i++) {
......@@ -335,15 +335,15 @@ describe('ActsBundleManagerTest', function () {
it('getBundleInfos_0600', 0, async function (done) {
await demo.getAllBundleInfo(0, (error, data) => {
expect(typeof data).assertEqual(OBJECT)
for (var i = 0; i < data.length; i++) {
expect(data[i].name.length).assertLarger(0)
expect(data[i].appInfo.name.length).assertLarger(0)
expect(data[i].appInfo.description.length).assertLarger(0)
expect(data[i].appInfo.icon.length).assertLarger(0)
expect(data[i].appInfo.label.length).assertLarger(0)
expect(data[i].appInfo.supportedModes).assertEqual(0)
expect(data[i].appInfo.moduleInfos.length).assertLarger(0)
}
for (var i = 0; i < data.length; i++) {
expect(data[i].name.length).assertLarger(0)
expect(data[i].appInfo.name.length).assertLarger(0)
expect(data[i].appInfo.description.length).assertLarger(0)
expect(data[i].appInfo.icon.length).assertLarger(0)
expect(data[i].appInfo.label.length).assertLarger(0)
expect(data[i].appInfo.supportedModes).assertEqual(0)
expect(data[i].appInfo.moduleInfos.length).assertLarger(0)
}
done();
})
......@@ -495,8 +495,8 @@ describe('ActsBundleManagerTest', function () {
entities: ["entity.system.home"],
elementName: {
deviceId: "0",
bundleName: "com.example.myapplication1",
abilityName: "",
bundleName: "",
abilityName: "com.example.myapplication1.MainAbility",
},
}
}, 0, 0)
......@@ -599,8 +599,8 @@ describe('ActsBundleManagerTest', function () {
entities: ["entity.system.home"],
elementName: {
deviceId: "0",
bundleName: "com.example.myapplication1",
abilityName: "",
bundleName: "",
abilityName: "com.example.myapplication1.MainAbility",
},
}
}, 0, 0, OnReceiveEvent)
......@@ -690,7 +690,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfos interfaces with two haps.
*/
it('getApplicationInfos_0200', 0, async function (done) {
var datainfo = await demo.getApplicationInfos(8, 0)
var datainfo = await demo.getAllApplicationInfo(8, 0)
console.info("==========ActsBmsGetInfosSecondScene is ==========" + JSON.stringify(datainfo));
checkgetApplicationInfos(datainfo)
done()
......@@ -705,7 +705,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfos interfaces with two haps and different param.
*/
it('getApplicationInfos_0400', 0, async function (done) {
var datainfo = await demo.getApplicationInfos(0, 0)
var datainfo = await demo.getAllApplicationInfo(0, 0)
expect(datainfo.length).assertLarger(0)
checkgetApplicationInfos(datainfo)
done()
......@@ -720,7 +720,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfos interfaces with two haps.
*/
it('getApplicationInfos_0700', 0, async function (done) {
await demo.getApplicationInfos(8, 0, (error, datainfo) => {
await demo.getAllApplicationInfo(8, 0, (error, datainfo) => {
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].description.length).assertLarger(0)
......@@ -750,7 +750,7 @@ describe('ActsBundleManagerTest', function () {
*/
it('getApplicationInfos_0900', 0, async function (done) {
await demo.getApplicationInfos(0, 0, (error, datainfo) => {
await demo.getAllApplicationInfo(0, 0, (error, datainfo) => {
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].description.length).assertLarger(0)
......@@ -1171,7 +1171,7 @@ describe('ActsBundleManagerTest', function () {
*/
it('getApplicationInfos_0300', 0, async function (done) {
console.info('===start getApplicationInfos===')
var datainfo = await demo.getApplicationInfos(8, 0)
var datainfo = await demo.getAllApplicationInfo(8, 0)
expect(datainfo.length).assertLarger(0)
checkgetApplicationInfos(datainfo)
done()
......@@ -2571,11 +2571,13 @@ describe('ActsBundleManagerTest', function () {
})
function UnSubscribeCallback() {
console.debug('====>UnSubscribe CallBack====>');
done();
}
function timeout() {
expect().assertFail();
console.debug('install_1000=====timeout======');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
done();
}
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
console.debug('=======start ability========')
......@@ -2611,6 +2613,7 @@ describe('ActsBundleManagerTest', function () {
}
expect(processMap2.has(uid)).assertFalse();
await uninstall(THIRD1);
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
done();
}
setTimeout(function () {
......
......@@ -235,11 +235,13 @@ describe('ActsBundleManagerTest', function () {
})
function UnSubscribeCallback() {
console.debug('====>UnSubscribe CallBack====>');
done();
}
function timeout() {
expect().assertFail();
console.debug('uninstall_0800=====timeout======');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
done();
}
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
console.debug('=======start ability========')
......@@ -275,6 +277,7 @@ describe('ActsBundleManagerTest', function () {
processMap2.set(processInfos2[i].uid, 0);
}
expect(processMap2.has(uid)).assertFalse();
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
done();
}
setTimeout(function () {
......
......@@ -16,8 +16,8 @@ group("ans_standard") {
testonly = true
if (is_standard_system) {
deps = [
"actsansnotificationcancel:ActsAnsNotificationCancel",
"actsansnotificationremove:ActsAnsNotificationRemove",
#"actsansnotificationcancel:ActsAnsNotificationCancel",
#"actsansnotificationremove:ActsAnsNotificationRemove",
"actsansslottest:ActsAnsSlotTest",
"publish_test:publish_test",
"publishicontest:ActsAnsIconTest",
......
{
"app": {
"bundleName": "com.example.actsansnotificationremove",
"bundleName": "com.example.actsansnotificationcancel",
"vendor": "example",
"version": {
"code": 1,
......@@ -14,8 +14,8 @@
},
"deviceConfig": {},
"module": {
"package": "com.example.actsansnotificationremove",
"name": ".actsansnotificationremove",
"package": "com.example.actsansnotificationcancel",
"name": ".actsansnotificationcancel",
"deviceType": [
"phone"
],
......@@ -36,7 +36,7 @@
]
}
],
"name": "com.example.actsansnotificationremove.MainAbility",
"name": "com.example.actsansnotificationcancel.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
......
......@@ -41,7 +41,8 @@
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard"
"launchType": "standard",
"visible": true
}
],
"js": [
......
......@@ -20,10 +20,11 @@ group("ActsAnsSlotTest") {
"actsansgetslottestcallback:ActsAnsGetSlotTestCallback",
"actsansgetslottestpromise:ActsAnsGetSlotTestPromise",
"actsansremoveslottest:ActsAnsRemoveSlotTest",
"actsansslotbybundle:ActsAnsSlotByBundle",
"actsansslotsystemcallback:ActsAnsSlotSystemCallback",
"actsansslotsystempromise:ActsAnsSlotSystemPromise",
"actsansslottaddremoveall:ActsAnsSlotAddRemoveAll",
#"actsansslotbybundle:ActsAnsSlotByBundle",
#"actsansslotsystemcallback:ActsAnsSlotSystemCallback",
#"actsansslotsystempromise:ActsAnsSlotSystemPromise",
#"actsansslottaddremoveall:ActsAnsSlotAddRemoveAll",
]
}
}
......@@ -31,9 +31,8 @@ export default {
const expectExtend = new ExpectExtend({
'id': 'extend'
})
const reportExtend = new ReportExtend(file)
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
core.init()
......
......@@ -16,16 +16,17 @@ group("publish_test") {
testonly = true
if (is_standard_system) {
deps = [
"actsanspublishcontroltest:ActsAnsPublishControlTest",
"badgedisplayed:badgedisplayed",
"badgedisplayedset:badgedisplayedset",
"enablenotification:enablenotification",
"enablenotificationset:enablenotificationset",
#"actsanspublishcontroltest:ActsAnsPublishControlTest",
#"badgedisplayed:badgedisplayed",
#"badgedisplayedset:badgedisplayedset",
#"enablenotification:enablenotification",
#"enablenotificationset:enablenotificationset",
"getactive:getactive",
"getwantagentinfo:getwantagentinfo",
"publishcontentype:ActsAnsNotificationTest",
"subscribe:subscribe",
"unsubscribe:ActsAnsUnSubscriberTest",
#"publishcontentype:ActsAnsNotificationTest",
#"subscribe:subscribe",
#"unsubscribe:ActsAnsUnSubscriberTest",
"wantagent:wantagent",
]
}
......
......@@ -186,9 +186,6 @@ function publish_the_eighteenth_notification(err){
function publish_the_nineteenth_notification(err){
console.debug("====>publish the nineteenth notification 19 19 err: ====>" + JSON.stringify(err));
}
function publish_the_twentieth_notification(err){
console.debug("====>publish the twentieth notification 20 20 err: ====>" + JSON.stringify(err));
}
describe('ActsAnsPublishControlTest', function () {
......@@ -223,7 +220,13 @@ describe('ActsAnsPublishControlTest', function () {
done();
}
notification.publish({
function publish_the_twentieth_notification(err){
console.debug("====>publish the twentieth notification 20 20 err: ====>" + JSON.stringify(err));
console.debug("====>time out start====>");
setTimeout(timeOut, 5000);
}
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -234,7 +237,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 1
}, publish_the_first_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -245,7 +248,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 2
}, publish_the_second_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -256,7 +259,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 3
}, publish_the_third_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -267,7 +270,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 4
}, publish_the_fourth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -278,7 +281,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 5
}, publish_the_fifth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -289,7 +292,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 6
}, publish_the_sixth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -300,7 +303,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 7
}, publish_the_seventh_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -311,7 +314,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 8
}, publish_the_eighth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -322,7 +325,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 9
}, publish_the_ninth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -333,7 +336,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 10
}, publish_the_tenth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -344,7 +347,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 11
}, publish_the_eleventh_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -355,7 +358,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 12
}, publish_the_twelfth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -366,7 +369,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 13
}, publish_the_thirteenth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -377,7 +380,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 14
}, publish_the_fourteenth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -388,7 +391,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 15
}, publish_the_fifteenth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -399,7 +402,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 16
}, publish_the_sixteenth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -410,7 +413,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 17
}, publish_the_seventeenth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -421,7 +424,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 18
}, publish_the_eighteenth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -432,7 +435,7 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 19
}, publish_the_nineteenth_notification);
notification.publish({
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
......@@ -443,7 +446,5 @@ describe('ActsAnsPublishControlTest', function () {
},
id: 20
}, publish_the_twentieth_notification);
console.debug("====>time out start====>");
setTimeout(timeOut, 15000);
})
})
\ No newline at end of file
......@@ -17,12 +17,12 @@ group("badgedisplayed") {
testonly = true
if (is_standard_system) {
deps = [
"badgedisplayfive:ActsAnsBadgeDisplayFiveTest",
"badgedisplayfour:ActsAnsBadgeDisplayFourTest",
"badgedisplayone:ActsAnsBadgeDisplayOneTest",
"badgedisplaysix:ActsAnsBadgeDisplaySixTest",
"badgedisplaytree:ActsAnsBadgeDisplayTreeTest",
"badgedisplaytwo:ActsAnsBadgeDisplayTwoTest",
#"badgedisplayfive:ActsAnsBadgeDisplayFiveTest",
#"badgedisplayfour:ActsAnsBadgeDisplayFourTest",
#"badgedisplayone:ActsAnsBadgeDisplayOneTest",
#"badgedisplaysix:ActsAnsBadgeDisplaySixTest",
#"badgedisplaytree:ActsAnsBadgeDisplayTreeTest",
#"badgedisplaytwo:ActsAnsBadgeDisplayTwoTest",
"localcandisplay:ActsAnsLocalCanDisplayTest",
]
}
......
{
"app": {
"bundleName": "com.neu.actsansbadgedisplaysetfivetest",
"bundleName": "com.example.actsansbadgedisplayfivetest",
"vendor": "example",
"version": {
"code": 1,
......@@ -14,7 +14,7 @@
},
"deviceConfig": {},
"module": {
"package": "com.example.actsansbadgedisplaysetfivetest",
"package": "com.example.actsansbadgedisplayfivetest",
"name": ".MyApplication",
"deviceType": [
"phone"
......@@ -36,13 +36,14 @@
]
}
],
"name": "com.example.actsansbadgedisplayfivesettest.MainAbility",
"name": "com.example.actsansbadgedisplayfivetest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"isVisible": "true",
"launchType": "standard"
"launchType": "standard",
"visible": true
}
],
"js": [
......@@ -58,4 +59,4 @@
}
]
}
}
\ No newline at end of file
}
......@@ -26,7 +26,7 @@ describe('ActsAnsBadgeDisplayFiveTest', function () {
*/
it('ActsBadgeDisplay_test_0900', 0, async function (done) {
await notify.displayBadge({
bundle:"com.neu.actsanslocalcandisplaytest"
bundle:"com.example.actsanslocalcandisplaytest"
},"",(err) => {
console.log("====>ActsBadgeDisplay_test_0900 success====>"+err)
})
......@@ -44,7 +44,7 @@ describe('ActsAnsBadgeDisplayFiveTest', function () {
it('ActsBadgeDisplay_test_1000', 0, async function (done) {
await notify.displayBadge(
{
bundle:"com.neu.actsanslocalcandisplaytest"
bundle:"com.example.actsanslocalcandisplaytest"
},"").then(console.log("====>ActsBadgeDisplay_test_1000 success====>"))
done();
setTimeout(function(){
......@@ -59,7 +59,7 @@ describe('ActsAnsBadgeDisplayFiveTest', function () {
*/
it('ActsSystemCanDisplay_test_0900', 0, async function (done) {
await notify.isBadgeDisplayed({
bundle:"com.neu.actsanslocalcandisplaytest",
bundle:"com.example.actsanslocalcandisplaytest",
},(err,data) => {
console.log("====>ActsSystemCanDisplay_test_0900 success====>"+err+data)
expect(typeof(data)).assertEqual('boolean')
......@@ -78,7 +78,7 @@ describe('ActsAnsBadgeDisplayFiveTest', function () {
it('ActsSystemCanDisplay_test_1000', 0, async function (done) {
var promise = await notify.isBadgeDisplayed(
{
bundle:"com.neu.actsanslocalcandisplaytest",
bundle:"com.example.actsanslocalcandisplaytest",
})
console.log("====>ActsSystemCanDisplay_test_1000 success====>"+promise)
expect(typeof(promise)).assertEqual('boolean')
......
{
"app": {
"bundleName": "com.neu.actsansbadgedisplaysetfourtest",
"bundleName": "com.example.actsansbadgedisplayfourtest",
"vendor": "example",
"version": {
"code": 1,
......@@ -14,7 +14,7 @@
},
"deviceConfig": {},
"module": {
"package": "com.example.actsansbadgedisplaysetfourtest",
"package": "com.example.actsansbadgedisplayfourtest",
"name": ".MyApplication",
"deviceType": [
"phone"
......@@ -36,13 +36,14 @@
]
}
],
"name": "com.example.actsansbadgedisplaysetfourtest.MainAbility",
"name": "com.example.actsansbadgedisplayfourtest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"isVisible": "true",
"launchType": "standard"
"launchType": "standard",
"visible": true
}
],
"js": [
......@@ -58,4 +59,4 @@
}
]
}
}
\ No newline at end of file
}
......@@ -26,7 +26,7 @@ describe('ActsAnsBadgeDisplayFourTest', function () {
*/
it('ActsBadgeDisplay_test_0700', 0, async function (done) {
await notify.displayBadge({
bundle:"com.neu.actsanslocalcandisplaytest"
bundle:"com.example.actsanslocalcandisplaytest"
},100,(err) => {
console.log("====>ActsBadgeDisplay_test_0700 success====>"+err)
})
......@@ -44,7 +44,7 @@ describe('ActsAnsBadgeDisplayFourTest', function () {
it('ActsBadgeDisplay_test_0800', 0, async function (done) {
await notify.displayBadge(
{
bundle:"com.neu.actsanslocalcandisplaytest"
bundle:"com.example.actsanslocalcandisplaytest"
},100).then(console.log("====>ActsBadgeDisplay_test_0800 success====>"))
done();
setTimeout(function(){
......@@ -59,7 +59,7 @@ describe('ActsAnsBadgeDisplayFourTest', function () {
*/
it('ActsSystemCanDisplay_test_0700', 0, async function (done) {
await notify.isBadgeDisplayed({
bundle:"com.neu.actsanslocalcandisplaytest",
bundle:"com.example.actsanslocalcandisplaytest",
},(err,data) => {
console.log("====>ActsSystemCanDisplay_test_0700 success====>"+err+data)
expect(typeof(data)).assertEqual('boolean')
......@@ -78,7 +78,7 @@ describe('ActsAnsBadgeDisplayFourTest', function () {
it('ActsSystemCanDisplay_test_0800', 0, async function (done) {
var promise = await notify.isBadgeDisplayed(
{
bundle:"com.neu.actsanslocalcandisplaytest",
bundle:"com.example.actsanslocalcandisplaytest",
})
console.log("====>ActsSystemCanDisplay_test_0800 success====>"+promise)
expect(typeof(promise)).assertEqual('boolean')
......
{
"app": {
"bundleName": "com.neu.actsansbadgedisplayonetest",
"bundleName": "com.example.actsansbadgedisplayonetest",
"vendor": "example",
"version": {
"code": 1,
......@@ -59,4 +59,4 @@
}
]
}
}
\ No newline at end of file
}
......@@ -26,7 +26,7 @@ describe('ActsAnsBadgeDisplayOneTest', function () {
*/
it('ActsBadgeDisplay_test_0100', 0, async function (done) {
await notify.displayBadge({
bundle:"com.neu.actsanslocalcandisplaytest"
bundle:"com.example.actsanslocalcandisplaytest"
},true,(err) => {
console.log("====>ActsBadgeDisplay_test_0100 success====>"+err)
})
......@@ -44,7 +44,7 @@ describe('ActsAnsBadgeDisplayOneTest', function () {
it('ActsBadgeDisplay_test_0200', 0, async function (done) {
await notify.displayBadge(
{
bundle:"com.neu.actsanslocalcandisplaytest"
bundle:"com.example.actsanslocalcandisplaytest"
},true).then(console.log("====>ActsBadgeDisplay_test_0200 success====>"))
done();
setTimeout(function(){
......@@ -59,7 +59,7 @@ describe('ActsAnsBadgeDisplayOneTest', function () {
*/
it('ActsSystemCanDisplay_test_0100', 0, async function (done) {
await notify.isBadgeDisplayed({
bundle:"com.neu.actsanslocalcandisplaytest",
bundle:"com.example.actsanslocalcandisplaytest",
},(err,data) => {
console.log("====>ActsSystemCanDisplay_test_0100 success====>"+err+data)
expect(typeof(data)).assertEqual('boolean')
......@@ -78,7 +78,7 @@ describe('ActsAnsBadgeDisplayOneTest', function () {
it('ActsSystemCanDisplay_test_0200', 0, async function (done) {
var promise = await notify.isBadgeDisplayed(
{
bundle:"com.neu.actsanslocalcandisplaytest",
bundle:"com.example.actsanslocalcandisplaytest",
})
console.log("====>ActsSystemCanDisplay_test_0200 success====>"+promise)
expect(typeof(promise)).assertEqual('boolean')
......
{
"app": {
"bundleName": "com.neu.actsansbadgedisplaysixtest",
"bundleName": "com.example.actsansbadgedisplaysixtest",
"vendor": "example",
"version": {
"code": 1,
......@@ -59,4 +59,4 @@
}
]
}
}
\ No newline at end of file
}
......@@ -26,7 +26,7 @@ describe('ActsAnsBadgeDisplaySixTest', function () {
*/
it('ActsBadgeDisplay_test_1100', 0, async function (done) {
await notify.displayBadge({
bundle:"com.neu.actsanslocalcandisplaytest"
bundle:"com.example.actsanslocalcandisplaytest"
},true,(err) => {
console.log("====>ActsBadgeDisplay_test_1100 success====>"+err)
})
......@@ -44,7 +44,7 @@ describe('ActsAnsBadgeDisplaySixTest', function () {
it('ActsBadgeDisplay_test_1200', 0, async function (done) {
await notify.displayBadge(
{
bundle:"com.neu.actsanslocalcandisplaytest"
bundle:"com.example.actsanslocalcandisplaytest"
},true).then(console.log("====>ActsBadgeDisplay_test_1200 success====>"))
done();
setTimeout(function(){
......
{
"app": {
"bundleName": "com.neu.actsansbadgedisplaysettreetest",
"bundleName": "com.example.actsansbadgedisplaytreetest",
"vendor": "example",
"version": {
"code": 1,
......@@ -14,7 +14,7 @@
},
"deviceConfig": {},
"module": {
"package": "com.example.actsansbadgedisplaysettreetest",
"package": "com.example.actsansbadgedisplaytreetest",
"name": ".MyApplication",
"deviceType": [
"phone"
......@@ -36,13 +36,14 @@
]
}
],
"name": "com.example.actsansbadgedisplaysettreetest.MainAbility",
"name": "com.example.actsansbadgedisplaytreetest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"isVisible": "true",
"launchType": "standard"
"launchType": "standard",
"visible": true
}
],
"js": [
......@@ -58,4 +59,4 @@
}
]
}
}
\ No newline at end of file
}
......@@ -26,7 +26,7 @@ describe('ActsAnsBadgeDisplayTreeTest', function () {
*/
it('ActsBadgeDisplay_test_0500', 0, async function (done) {
await notify.displayBadge({
bundle:"com.neu.actsanslocalcandisplaytest"
bundle:"com.example.actsanslocalcandisplaytest"
},true,(err) => {
console.log("====>ActsBadgeDisplay_test_0500 success====>"+err)
})
......@@ -44,7 +44,7 @@ describe('ActsAnsBadgeDisplayTreeTest', function () {
it('ActsBadgeDisplay_test_0600', 0, async function (done) {
await notify.displayBadge(
{
bundle:"com.neu.actsanslocalcandisplaytest"
bundle:"com.example.actsanslocalcandisplaytest"
},false).then(console.log("====>ActsBadgeDisplay_test_0600 success====>"))
done();
setTimeout(function(){
......@@ -59,7 +59,7 @@ describe('ActsAnsBadgeDisplayTreeTest', function () {
*/
it('ActsSystemCanDisplay_test_0500', 0, async function (done) {
await notify.isBadgeDisplayed({
bundle:"com.neu.actsanslocalcandisplaytest",
bundle:"com.example.actsanslocalcandisplaytest",
},(err,data) => {
console.log("====>ActsSystemCanDisplay_test_0500 success====>"+err+data)
expect(typeof(data)).assertEqual('boolean')
......@@ -78,7 +78,7 @@ describe('ActsAnsBadgeDisplayTreeTest', function () {
it('ActsSystemCanDisplay_test_0600', 0, async function (done) {
var promise = await notify.isBadgeDisplayed(
{
bundle:"com.neu.actsanslocalcandisplaytest",
bundle:"com.example.actsanslocalcandisplaytest",
})
console.log("====>ActsSystemCanDisplay_test_0600 success====>"+promise)
expect(typeof(promise)).assertEqual('boolean')
......
{
"app": {
"bundleName": "com.neu.actsansbadgedisplaysettwotest",
"bundleName": "com.example.actsansbadgedisplaytwotest",
"vendor": "example",
"version": {
"code": 1,
......@@ -14,7 +14,7 @@
},
"deviceConfig": {},
"module": {
"package": "com.example.actsansbadgedisplaysettwotest",
"package": "com.example.actsansbadgedisplaytwotest",
"name": ".MyApplication",
"deviceType": [
"phone"
......@@ -36,13 +36,14 @@
]
}
],
"name": "com.example.actsansbadgedisplaysettwotest.MainAbility",
"name": "com.example.actsansbadgedisplaytwotest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"isVisible": "true",
"launchType": "standard"
"launchType": "standard",
"visible": true
}
],
"js": [
......@@ -58,4 +59,4 @@
}
]
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册