MangerAbilityJsunit.test.js 22.5 KB
Newer Older
C
chensi10 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
 * 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.
 */
C
chensi10 已提交
15 16
import featureAbility from '@ohos.ability.featureability'
import abilitymanager from '@ohos.app.abilitymanager'
C
chensi10 已提交
17 18 19 20 21 22 23 24 25 26 27 28 29
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit'

var WeightReasonCode = {
    REASON_UNKNOWN: 0,
    WEIGHT_FOREGROUND: 100,
    WEIGHT_FOREGROUND_SERVICE: 125,
    WEIGHT_VISIBLE: 200,
    WEIGHT_PERCEPTIBLE: 230,
    WEIGHT_SERVICE: 300,
    WEIGHT_TOP_SLEEPING: 325,
    WEIGHT_CANT_SAVE_STATE: 350,
    WEIGHT_CACHED: 400,
    WEIGHT_GONE: 1000
C
chensi10 已提交
30
}
C
chensi10 已提交
31 32 33

var abilityNameList = [
    "com.ohos.launcher.MainAbility",
Z
zhaoyuan17 已提交
34
    "com.ohos.callui.ServiceAbility",
C
chensi10 已提交
35 36 37 38 39 40 41
    "com.example.SimulateFeatureAbilityFir",
    "com.example.actsamscallbackfirstscene.MainAbility"
]

var bundleNameList = [
    "com.ohos.launcher",
    "com.ohos.systemui",
Z
zhaoyuan17 已提交
42
    "com.ohos.callui",
C
chensi10 已提交
43 44 45 46
    "com.ix.simulate.feature",
    "com.example.actsamscallbackfirstscene"
]

C
chensi10 已提交
47 48
describe('ActsAmsCallBackFirstScene', function () {
    console.info('----ActsAmsCallBackFirstScene----');
Z
zhaoyuan 已提交
49
    beforeAll(async function (done) {
Z
zhaoyuan17 已提交
50
        await featureAbility.startAbility(
C
chensi10 已提交
51 52 53 54 55 56 57 58
            {
                want:
                {
                    deviceId: "",
                    bundleName: "com.ohos.launcher",
                    abilityName: "com.ohos.launcher.MainAbility",
                    action: "action1",
                    parameters:
C
chensi10 已提交
59
                        {},
C
chensi10 已提交
60 61 62
                },
            },
        );
C
chensi10 已提交
63
        var maxnum = 10, flag = 1;
Z
zhaoyuan 已提交
64 65 66 67 68 69 70
        var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
        console.log('queryRecentAbilityMissionInfos data  ' + JSON.stringify(data));
        for (var i = 0; i < data.length; i++) {
            if (data[i].baseAbility.bundleName != 'com.example.actsamscallbackfirstscene' &&
                data[i].topAbility.bundleName != 'com.example.actsamscallbackfirstscene') {
                var info = abilitymanager.removeMission(data[i].id);
                console.log(' removeMission data  [' + info + ']');
C
chensi10 已提交
71
            }
Z
zhaoyuan 已提交
72
        };
Z
zhaoyuan17 已提交
73
        await featureAbility.startAbility(
C
chensi10 已提交
74 75 76 77 78 79 80 81
            {
                want:
                {
                    deviceId: "",
                    bundleName: "com.ix.simulate.feature",
                    abilityName: "com.example.SimulateFeatureAbilityFir",
                    action: "action1",
                    parameters:
C
chensi10 已提交
82
                        {},
C
chensi10 已提交
83 84 85
                },
            },
        );
J
jiyong 已提交
86
        setTimeout(done(), 5000);
C
chensi10 已提交
87
    });
J
jiyong 已提交
88

Z
zhaoyuan17 已提交
89
    function timeout(done) {
J
jiyong 已提交
90 91 92 93
        expect().assertFail();
        console.debug('Acts_Ams_test=========timeout========');
        done();
    }
Z
zhaoyuan17 已提交
94 95 96

    function sleep(delay) {
        var start = (new Date()).getTime();
Z
zhaoyuan17 已提交
97
        while ((new Date()).getTime() - start < delay) {
Z
zhaoyuan17 已提交
98 99 100
            continue;
        }
    }
Z
zhaoyuan17 已提交
101

C
chensi10 已提交
102 103 104 105 106
    /*
     * @tc.number    : Acts_Ams_test_0200
     * @tc.name      : getAllRunningProcesses : Get All Running Processes Info
     * @tc.desc      : Get All Running Processes Info(by CallBack)
     */
C
chensi10 已提交
107
    it('Acts_Ams_test_0200', 0, async function (done) {
Z
zhaoyuan17 已提交
108 109 110
        console.info("sleep begin");
        sleep(5000);
        console.info("sleep end");
J
jiyong 已提交
111 112 113 114 115 116
        abilitymanager.getAllRunningProcesses(
            (error, info) => {
                console.info('getAllRunningProcesses error.code \
                ' + error.code + ', data length [' + info.length + ']');
                console.info('Acts_Ams_test_0200 getAllRunningProcesses data ' + JSON.stringify(info));
                expect(Array.isArray(info)).assertEqual(true);
Z
zhaoyuan17 已提交
117
                expect(info.length).assertEqual(5);
J
jiyong 已提交
118 119 120
                for (var i = 0; i < info.length; i++) {
                    expect(typeof (info[i].pid)).assertEqual("number");
                    expect(info[i].pid).assertLarger(0);
C
chensi10 已提交
121

J
jiyong 已提交
122 123 124
                    expect(typeof (info[i].processName)).assertEqual("string");
                    expect(info[i].processName.length).assertLarger(0);
                    expect(bundleNameList.indexOf(info[i].processName)).assertLarger(-1);
C
chensi10 已提交
125

J
jiyong 已提交
126 127
                    expect(Array.isArray(info[i].pkgList)).assertEqual(true);
                    expect(info[i].pkgList.length).assertEqual(0);
C
chensi10 已提交
128

J
jiyong 已提交
129 130
                    expect(typeof (info[i].uid)).assertEqual("number");
                    expect(info[i].uid).assertLarger(0);
C
chensi10 已提交
131

J
jiyong 已提交
132 133
                    expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
                    expect(info[i].lastMemoryLevel).assertEqual(-1);
C
chensi10 已提交
134

J
jiyong 已提交
135 136
                    expect(typeof (info[i].weight)).assertEqual("number");
                    expect(info[i].weight).assertEqual(-1);
C
chensi10 已提交
137

J
jiyong 已提交
138 139 140 141 142 143
                    expect(typeof (info[i].weightReasonCode)).assertEqual("number");
                    expect(info[i].weightReasonCode).assertEqual(WeightReasonCode.REASON_UNKNOWN);
                }
                done();
            });
        setTimeout(timeout, 5000);
C
chensi10 已提交
144 145
    })

C
chensi10 已提交
146 147 148 149 150
    /*
    * @tc.number    : Acts_Ams_test_0400
    * @tc.name      : queryRunningAbilityMissionInfos : Query Running Ability Mission Infos
    * @tc.desc      : Query Running Ability Mission Infos(by CallBack)
    */
C
chensi10 已提交
151 152 153
    it('Acts_Ams_test_0400', 0, async function (done) {
        var maxnum = 10;
        abilitymanager.queryRunningAbilityMissionInfos(maxnum,
C
chensi10 已提交
154 155
            (error, info) => {
                console.info('queryRecentAbilityMissionInfos error.code : \
Z
zhaoyuan 已提交
156
                ' + error.code + ',data length [' + info.length + ']');
C
chensi10 已提交
157
                console.info('Acts_Ams_test_0400 queryRunningAbilityMissionInfos info ' + JSON.stringify(info));
C
chensi10 已提交
158
                expect(Array.isArray(info)).assertEqual(true);
C
chensi10 已提交
159
                expect(info.length).assertEqual(2);
C
chensi10 已提交
160 161 162 163 164 165
                for (var i = 0; i < info.length; i++) {
                    expect(typeof (info[i].id)).assertEqual("number");
                    expect(info[i].id).assertLarger(0);

                    expect(typeof (info[i].baseAbility)).assertEqual("object");
                    expect(typeof (info[i].baseAbility.deviceId)).assertEqual("string");
C
chensi10 已提交
166
                    expect(info[i].baseAbility.deviceId.length).assertEqual(0);
C
chensi10 已提交
167 168
                    expect(typeof (info[i].baseAbility.bundleName)).assertEqual("string");
                    expect(info[i].baseAbility.bundleName.length).assertLarger(0);
C
chensi10 已提交
169
                    expect(bundleNameList.indexOf(info[i].baseAbility.bundleName)).assertLarger(-1);
C
chensi10 已提交
170 171
                    expect(typeof (info[i].baseAbility.abilityName)).assertEqual("string");
                    expect(info[i].baseAbility.abilityName.length).assertLarger(0);
C
chensi10 已提交
172
                    expect(abilityNameList.indexOf(info[i].baseAbility.abilityName)).assertLarger(-1);
C
chensi10 已提交
173 174 175

                    expect(typeof (info[i].topAbility)).assertEqual("object");
                    expect(typeof (info[i].topAbility.deviceId)).assertEqual("string");
C
chensi10 已提交
176
                    expect(info[i].topAbility.deviceId.length).assertEqual(0);
C
chensi10 已提交
177 178
                    expect(typeof (info[i].topAbility.bundleName)).assertEqual("string");
                    expect(info[i].topAbility.bundleName.length).assertLarger(0);
C
chensi10 已提交
179
                    expect(bundleNameList.indexOf(info[i].topAbility.bundleName)).assertLarger(-1);
C
chensi10 已提交
180 181
                    expect(typeof (info[i].topAbility.abilityName)).assertEqual("string");
                    expect(info[i].topAbility.abilityName.length).assertLarger(0);
C
chensi10 已提交
182
                    expect(abilityNameList.indexOf(info[i].topAbility.abilityName)).assertLarger(-1);
C
chensi10 已提交
183 184 185 186 187

                    expect(typeof (info[i].missionDescription)).assertEqual("object");
                    expect(typeof (info[i].missionDescription.label)).assertEqual("string");
                    expect(typeof (info[i].missionDescription.iconPath)).assertEqual("string");
                }
J
jiyong 已提交
188
                done();
C
chensi10 已提交
189
            });
J
jiyong 已提交
190
        setTimeout(timeout, 5000);
C
chensi10 已提交
191 192
    })

C
chensi10 已提交
193 194 195 196 197
    /*
     * @tc.number    : Acts_Ams_test_0600
     * @tc.name      : queryRecentAbilityMissionInfos : Query Recent Ability Mission Infos
     * @tc.desc      : Query Recent Ability Mission Infos(by CallBack)
     */
C
chensi10 已提交
198
    it('Acts_Ams_test_0600', 0, async function (done) {
C
chensi10 已提交
199 200 201 202
        var maxnum = 10, flag = 1;
        abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag,
            (error, info) => {
                console.info('queryRunningAbilityMissionInfos error.code : \
Z
zhaoyuan 已提交
203
                ' + error.code + ',data length [' + info.length + ']');
C
chensi10 已提交
204
                console.info('Acts_Ams_test_0600 queryRecentAbilityMissionInfos info ' + JSON.stringify(info));
C
chensi10 已提交
205
                expect(Array.isArray(info)).assertEqual(true);
C
chensi10 已提交
206
                expect(info.length).assertEqual(2);
C
chensi10 已提交
207 208 209 210 211 212
                for (var i = 0; i < info.length; i++) {
                    expect(typeof (info[i].id)).assertEqual("number");
                    expect(info[i].id).assertLarger(0);

                    expect(typeof (info[i].baseAbility)).assertEqual("object");
                    expect(typeof (info[i].baseAbility.deviceId)).assertEqual("string");
C
chensi10 已提交
213
                    expect(info[i].baseAbility.deviceId.length).assertEqual(0);
C
chensi10 已提交
214 215
                    expect(typeof (info[i].baseAbility.bundleName)).assertEqual("string");
                    expect(info[i].baseAbility.bundleName.length).assertLarger(0);
C
chensi10 已提交
216
                    expect(bundleNameList.indexOf(info[i].baseAbility.bundleName)).assertLarger(-1);
C
chensi10 已提交
217 218
                    expect(typeof (info[i].baseAbility.abilityName)).assertEqual("string");
                    expect(info[i].baseAbility.abilityName.length).assertLarger(0);
C
chensi10 已提交
219
                    expect(abilityNameList.indexOf(info[i].baseAbility.abilityName)).assertLarger(-1);
C
chensi10 已提交
220 221 222

                    expect(typeof (info[i].topAbility)).assertEqual("object");
                    expect(typeof (info[i].topAbility.deviceId)).assertEqual("string");
C
chensi10 已提交
223
                    expect(info[i].topAbility.deviceId.length).assertEqual(0);
C
chensi10 已提交
224 225
                    expect(typeof (info[i].topAbility.bundleName)).assertEqual("string");
                    expect(info[i].topAbility.bundleName.length).assertLarger(0);
C
chensi10 已提交
226
                    expect(bundleNameList.indexOf(info[i].topAbility.bundleName)).assertLarger(-1);
C
chensi10 已提交
227 228
                    expect(typeof (info[i].topAbility.abilityName)).assertEqual("string");
                    expect(info[i].topAbility.abilityName.length).assertLarger(0);
C
chensi10 已提交
229
                    expect(abilityNameList.indexOf(info[i].topAbility.abilityName)).assertLarger(-1);
C
chensi10 已提交
230 231 232 233 234

                    expect(typeof (info[i].missionDescription)).assertEqual("object");
                    expect(typeof (info[i].missionDescription.label)).assertEqual("string");
                    expect(typeof (info[i].missionDescription.iconPath)).assertEqual("string");
                }
J
jiyong 已提交
235
                done();
C
chensi10 已提交
236
            });
J
jiyong 已提交
237
        setTimeout(timeout, 5000);
C
chensi10 已提交
238
    })
C
chensi10 已提交
239 240

    /*
Z
zhaoyuan17 已提交
241 242 243
     * @tc.number    : Acts_Ams_test_8600
     * @tc.name      : getActiveProcessInfos : Get All Active Processes Info
     * @tc.desc      : Get All Active Processes Info(by CallBack)
C
chensi10 已提交
244
     */
Z
zhaoyuan17 已提交
245 246
    it('Acts_Ams_test_8600', 0, async function (done) {
        abilitymanager.getActiveProcessInfos(
C
chensi10 已提交
247
            (error, info) => {
Z
zhaoyuan17 已提交
248 249 250 251
                console.info('getActiveProcessInfos error.code \
                ' + error.code + ', data length [' + info.length + ']');
                console.info('Acts_Ams_test_8600 getActiveProcessInfos data ' + JSON.stringify(info));
                expect(Array.isArray(info)).assertEqual(true);
Z
zhaoyuan17 已提交
252
                expect(info.length).assertEqual(5);
Z
zhaoyuan17 已提交
253 254 255 256 257 258 259 260 261 262 263 264 265 266
                for (var i = 0; i < info.length; i++) {
                    expect(typeof (info[i].pid)).assertEqual("number");
                    expect(info[i].pid).assertLarger(0);

                    expect(typeof (info[i].processName)).assertEqual("string");
                    expect(info[i].processName.length).assertLarger(0);
                    expect(bundleNameList.indexOf(info[i].processName)).assertLarger(-1);

                    expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
                    expect(info[i].bundleNames.length).assertEqual(0);

                    expect(typeof (info[i].uid)).assertEqual("number");
                    expect(info[i].uid).assertLarger(0);
                }
J
jiyong 已提交
267
                done();
C
chensi10 已提交
268
            });
J
jiyong 已提交
269
        setTimeout(timeout, 5000);
Z
zhaoyuan17 已提交
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
    })

    /*
    * @tc.number    : Acts_Ams_test_9600
    * @tc.name      : getActiveAbilityMissionInfos : Get Active Ability Mission Infos
    * @tc.desc      : Get Active Ability Mission Infos(by CallBack)
    */
    it('Acts_Ams_test_9600', 0, async function (done) {
        var maxnum = 10;
        abilitymanager.getActiveAbilityMissionInfos(maxnum,
            (error, info) => {
                console.info('queryRecentAbilityMissionInfos error.code : \
                ' + error.code + ',data length [' + info.length + ']');
                console.info('Acts_Ams_test_9600 getActiveAbilityMissionInfos info ' + JSON.stringify(info));
                expect(Array.isArray(info)).assertEqual(true);
Z
zhaoyuan17 已提交
285
                expect(info.length).assertEqual(2);
Z
zhaoyuan17 已提交
286 287 288
                for (var i = 0; i < info.length; i++) {
                    expect(typeof (info[i].missionId)).assertEqual("number");
                    expect(info[i].missionId).assertLarger(0);
C
chensi10 已提交
289

Z
zhaoyuan17 已提交
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
                    expect(typeof (info[i].bottomAbility)).assertEqual("object");
                    expect(typeof (info[i].bottomAbility.deviceId)).assertEqual("string");
                    expect(info[i].bottomAbility.deviceId.length).assertEqual(0);
                    expect(typeof (info[i].bottomAbility.bundleName)).assertEqual("string");
                    expect(info[i].bottomAbility.bundleName.length).assertLarger(0);
                    expect(bundleNameList.indexOf(info[i].bottomAbility.bundleName)).assertLarger(-1);
                    expect(typeof (info[i].bottomAbility.abilityName)).assertEqual("string");
                    expect(info[i].bottomAbility.abilityName.length).assertLarger(0);
                    expect(abilityNameList.indexOf(info[i].bottomAbility.abilityName)).assertLarger(-1);
                    expect(typeof (info[i].bottomAbility.uri)).assertEqual("string");
                    expect(info[i].bottomAbility.uri.length).assertEqual(0);
                    expect(typeof (info[i].bottomAbility.shortName)).assertEqual("string");
                    expect(info[i].bottomAbility.shortName.length).assertEqual(0);

                    expect(typeof (info[i].topAbility)).assertEqual("object");
                    expect(typeof (info[i].topAbility.deviceId)).assertEqual("string");
                    expect(info[i].topAbility.deviceId.length).assertEqual(0);
                    expect(typeof (info[i].topAbility.bundleName)).assertEqual("string");
                    expect(info[i].topAbility.bundleName.length).assertLarger(0);
                    expect(bundleNameList.indexOf(info[i].topAbility.bundleName)).assertLarger(-1);
                    expect(typeof (info[i].topAbility.abilityName)).assertEqual("string");
                    expect(info[i].topAbility.abilityName.length).assertLarger(0);
                    expect(abilityNameList.indexOf(info[i].topAbility.abilityName)).assertLarger(-1);
                    expect(typeof (info[i].topAbility.uri)).assertEqual("string");
                    expect(info[i].topAbility.uri.length).assertEqual(0);
                    expect(typeof (info[i].topAbility.shortName)).assertEqual("string");
                    expect(info[i].topAbility.shortName.length).assertEqual(0);

                    expect(typeof (info[i].windowMode)).assertEqual("number");
                    expect(info[i].windowMode).assertEqual(0);
                }
                done();
            });
        setTimeout(timeout, 5000);
    })

    /*
    * @tc.number    : Acts_Ams_test_10600
    * @tc.name      : getPreviousAbilityMissionInfos : Get Previous Ability Mission Infos
    * @tc.desc      : Get Previous Ability Mission Infos(by CallBack)
    */
    it('Acts_Ams_test_10600', 0, async function (done) {
        var maxnum = 10;
        abilitymanager.getPreviousAbilityMissionInfos(maxnum,
            (error, info) => {
                console.info('queryRecentAbilityMissionInfos error.code : \
                ' + error.code + ',data length [' + info.length + ']');
                console.info('Acts_Ams_test_10600 getPreviousAbilityMissionInfos info ' + JSON.stringify(info));
                expect(Array.isArray(info)).assertEqual(true);
Z
zhaoyuan17 已提交
339
                expect(info.length).assertEqual(2);
Z
zhaoyuan17 已提交
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377
                for (var i = 0; i < info.length; i++) {
                    expect(typeof (info[i].missionId)).assertEqual("number");
                    expect(info[i].missionId).assertLarger(0);

                    expect(typeof (info[i].bottomAbility)).assertEqual("object");
                    expect(typeof (info[i].bottomAbility.deviceId)).assertEqual("string");
                    expect(info[i].bottomAbility.deviceId.length).assertEqual(0);
                    expect(typeof (info[i].bottomAbility.bundleName)).assertEqual("string");
                    expect(info[i].bottomAbility.bundleName.length).assertLarger(0);
                    expect(bundleNameList.indexOf(info[i].bottomAbility.bundleName)).assertLarger(-1);
                    expect(typeof (info[i].bottomAbility.abilityName)).assertEqual("string");
                    expect(info[i].bottomAbility.abilityName.length).assertLarger(0);
                    expect(abilityNameList.indexOf(info[i].bottomAbility.abilityName)).assertLarger(-1);
                    expect(typeof (info[i].bottomAbility.uri)).assertEqual("string");
                    expect(info[i].bottomAbility.uri.length).assertEqual(0);
                    expect(typeof (info[i].bottomAbility.shortName)).assertEqual("string");
                    expect(info[i].bottomAbility.shortName.length).assertEqual(0);

                    expect(typeof (info[i].topAbility)).assertEqual("object");
                    expect(typeof (info[i].topAbility.deviceId)).assertEqual("string");
                    expect(info[i].topAbility.deviceId.length).assertEqual(0);
                    expect(typeof (info[i].topAbility.bundleName)).assertEqual("string");
                    expect(info[i].topAbility.bundleName.length).assertLarger(0);
                    expect(bundleNameList.indexOf(info[i].topAbility.bundleName)).assertLarger(-1);
                    expect(typeof (info[i].topAbility.abilityName)).assertEqual("string");
                    expect(info[i].topAbility.abilityName.length).assertLarger(0);
                    expect(abilityNameList.indexOf(info[i].topAbility.abilityName)).assertLarger(-1);
                    expect(typeof (info[i].topAbility.uri)).assertEqual("string");
                    expect(info[i].topAbility.uri.length).assertEqual(0);
                    expect(typeof (info[i].topAbility.shortName)).assertEqual("string");
                    expect(info[i].topAbility.shortName.length).assertEqual(0);

                    expect(typeof (info[i].windowMode)).assertEqual("number");
                    expect(info[i].windowMode).assertEqual(0);
                }
                done();
            });
        setTimeout(timeout, 5000);
C
chensi10 已提交
378
    })
Z
zhaoyuan17 已提交
379

Z
zhaoyuan17 已提交
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451
    /*
     * @tc.number    : Acts_Ams_test_1400
     * @tc.name      : removeMissions : Remove Missions
     * @tc.desc      : Remove Missions(by CallBack)
     */
    it('Acts_Ams_test_1400', 0, async function (done) {
        var maxnum = 10;
        var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
        var missionID = result[0].id + 100;
        abilitymanager.removeMissions([missionID],
            (error, info) => {
                console.info('Acts_Ams_test_1400 removeMissions error.code \
                ' + error.code + ',data  [' + info + ']');
                expect(info).assertLarger(0);
                done();
            });
        setTimeout(timeout, 5000);
    })

    /*
     * @tc.number    : Acts_Ams_test_0800
     * @tc.name      : removeMission : Remove Mission
     * @tc.desc      : Remove Mission(by CallBack)
     */
    it('Acts_Ams_test_0800', 0, async function (done) {
        var maxnum = 10;
        var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
        abilitymanager.removeMission(result[0].id,
            (error, info) => {
                console.info('Acts_Ams_test_0800 removeMission error.code \
                ' + error.code + ',data  [' + info + ']');
                expect(info).assertEqual(0);
                done();
            });
        setTimeout(timeout, 5000);
    })

    /*
    * @tc.number    : Acts_Ams_test_1600
    * @tc.name      : killProcessesByBundleName : Kill Processes By BundleName
    * @tc.desc      : Kill Processes By BundleName(by CallBack)
    */
    it('Acts_Ams_test_1600', 0, async function (done) {
        abilitymanager.killProcessesByBundleName('com.ix.simulate.feature',
            (error, info) => {
                console.info('Acts_Ams_test_1600 killProcessesByBundleName error.code: \
                    ' + error.code + ',data  [' + info + ']');
                expect(info).assertEqual(0);
                done();
            });
        setTimeout(timeout, 5000);

    })

    /*
     * @tc.number    : Acts_Ams_test_1200
     * @tc.name      : moveMissionToTop : Move Mission To Top
     * @tc.desc      : Move Mission To Top(by CallBack)
     */
    it('Acts_Ams_test_1200', 0, async function (done) {
        var maxnum = 10;
        var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
        abilitymanager.moveMissionToTop(result[0].id,
            (error, info) => {
                console.info('Acts_Ams_test_1200 moveMissionToTop error.code \
                ' + error.code + ',data  [' + info + ']');
                expect(info).assertEqual(0);
                done();
            });
        setTimeout(timeout, 5000);
    })

C
chensi10 已提交
452 453 454
})