MangerAbilityJsunit.test.js 22.4 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 34 35 36 37 38 39 40 41 42 43 44

var abilityNameList = [
    "com.ohos.launcher.MainAbility",
    "com.example.SimulateFeatureAbilityFir",
    "com.example.actsamscallbackfirstscene.MainAbility"
]

var bundleNameList = [
    "com.ohos.launcher",
    "com.ohos.systemui",
    "com.ix.simulate.feature",
    "com.example.actsamscallbackfirstscene"
]

C
chensi10 已提交
45 46
describe('ActsAmsCallBackFirstScene', function () {
    console.info('----ActsAmsCallBackFirstScene----');
Z
zhaoyuan 已提交
47
    beforeAll(async function (done) {
Z
zhaoyuan17 已提交
48
        await featureAbility.startAbility(
C
chensi10 已提交
49 50 51 52 53 54 55 56
            {
                want:
                {
                    deviceId: "",
                    bundleName: "com.ohos.launcher",
                    abilityName: "com.ohos.launcher.MainAbility",
                    action: "action1",
                    parameters:
C
chensi10 已提交
57
                        {},
C
chensi10 已提交
58 59 60
                },
            },
        );
C
chensi10 已提交
61
        var maxnum = 10, flag = 1;
Z
zhaoyuan 已提交
62 63 64 65 66 67 68
        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 已提交
69
            }
Z
zhaoyuan 已提交
70
        };
Z
zhaoyuan17 已提交
71
        await featureAbility.startAbility(
C
chensi10 已提交
72 73 74 75 76 77 78 79
            {
                want:
                {
                    deviceId: "",
                    bundleName: "com.ix.simulate.feature",
                    abilityName: "com.example.SimulateFeatureAbilityFir",
                    action: "action1",
                    parameters:
C
chensi10 已提交
80
                        {},
C
chensi10 已提交
81 82 83
                },
            },
        );
J
jiyong 已提交
84
        setTimeout(done(), 5000);
C
chensi10 已提交
85
    });
J
jiyong 已提交
86

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

    function sleep(delay) {
        var start = (new Date()).getTime();
        while((new Date()).getTime() - start < delay) {
            continue;
        }
    }
J
jiyong 已提交
99
    
C
chensi10 已提交
100 101 102 103 104
    /*
     * @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 已提交
105
    it('Acts_Ams_test_0200', 0, async function (done) {
Z
zhaoyuan17 已提交
106 107 108
        console.info("sleep begin");
        sleep(5000);
        console.info("sleep end");
J
jiyong 已提交
109 110 111 112 113 114 115 116 117 118
        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);
                expect(info.length).assertEqual(4);
                for (var i = 0; i < info.length; i++) {
                    expect(typeof (info[i].pid)).assertEqual("number");
                    expect(info[i].pid).assertLarger(0);
C
chensi10 已提交
119

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

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

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

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

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

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

C
chensi10 已提交
144 145 146 147 148
    /*
    * @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 已提交
149 150 151
    it('Acts_Ams_test_0400', 0, async function (done) {
        var maxnum = 10;
        abilitymanager.queryRunningAbilityMissionInfos(maxnum,
C
chensi10 已提交
152 153
            (error, info) => {
                console.info('queryRecentAbilityMissionInfos error.code : \
Z
zhaoyuan 已提交
154
                ' + error.code + ',data length [' + info.length + ']');
C
chensi10 已提交
155
                console.info('Acts_Ams_test_0400 queryRunningAbilityMissionInfos info ' + JSON.stringify(info));
C
chensi10 已提交
156
                expect(Array.isArray(info)).assertEqual(true);
C
chensi10 已提交
157
                expect(info.length).assertEqual(2);
C
chensi10 已提交
158 159 160 161 162 163
                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 已提交
164
                    expect(info[i].baseAbility.deviceId.length).assertEqual(0);
C
chensi10 已提交
165 166
                    expect(typeof (info[i].baseAbility.bundleName)).assertEqual("string");
                    expect(info[i].baseAbility.bundleName.length).assertLarger(0);
C
chensi10 已提交
167
                    expect(bundleNameList.indexOf(info[i].baseAbility.bundleName)).assertLarger(-1);
C
chensi10 已提交
168 169
                    expect(typeof (info[i].baseAbility.abilityName)).assertEqual("string");
                    expect(info[i].baseAbility.abilityName.length).assertLarger(0);
C
chensi10 已提交
170
                    expect(abilityNameList.indexOf(info[i].baseAbility.abilityName)).assertLarger(-1);
C
chensi10 已提交
171 172 173

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

                    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 已提交
186
                done();
C
chensi10 已提交
187
            });
J
jiyong 已提交
188
        setTimeout(timeout, 5000);
C
chensi10 已提交
189 190
    })

C
chensi10 已提交
191 192 193 194 195
    /*
     * @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 已提交
196
    it('Acts_Ams_test_0600', 0, async function (done) {
C
chensi10 已提交
197 198 199 200
        var maxnum = 10, flag = 1;
        abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag,
            (error, info) => {
                console.info('queryRunningAbilityMissionInfos error.code : \
Z
zhaoyuan 已提交
201
                ' + error.code + ',data length [' + info.length + ']');
C
chensi10 已提交
202
                console.info('Acts_Ams_test_0600 queryRecentAbilityMissionInfos info ' + JSON.stringify(info));
C
chensi10 已提交
203
                expect(Array.isArray(info)).assertEqual(true);
C
chensi10 已提交
204
                expect(info.length).assertEqual(2);
C
chensi10 已提交
205 206 207 208 209 210
                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 已提交
211
                    expect(info[i].baseAbility.deviceId.length).assertEqual(0);
C
chensi10 已提交
212 213
                    expect(typeof (info[i].baseAbility.bundleName)).assertEqual("string");
                    expect(info[i].baseAbility.bundleName.length).assertLarger(0);
C
chensi10 已提交
214
                    expect(bundleNameList.indexOf(info[i].baseAbility.bundleName)).assertLarger(-1);
C
chensi10 已提交
215 216
                    expect(typeof (info[i].baseAbility.abilityName)).assertEqual("string");
                    expect(info[i].baseAbility.abilityName.length).assertLarger(0);
C
chensi10 已提交
217
                    expect(abilityNameList.indexOf(info[i].baseAbility.abilityName)).assertLarger(-1);
C
chensi10 已提交
218 219 220

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

                    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 已提交
233
                done();
C
chensi10 已提交
234
            });
J
jiyong 已提交
235
        setTimeout(timeout, 5000);
C
chensi10 已提交
236
    })
C
chensi10 已提交
237 238 239 240 241 242

    /*
     * @tc.number    : Acts_Ams_test_0800
     * @tc.name      : removeMission : Remove Mission
     * @tc.desc      : Remove Mission(by CallBack)
     */
C
chensi10 已提交
243 244 245 246
    it('Acts_Ams_test_0800', 0, async function (done) {
        var maxnum = 10;
        var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
        abilitymanager.removeMission(result[0].id,
C
chensi10 已提交
247 248 249
            (error, info) => {
                console.info('Acts_Ams_test_0800 removeMission error.code \
                ' + error.code + ',data  [' + info + ']');
Z
zhaoyuan17 已提交
250
                expect(info).assertEqual(0);
J
jiyong 已提交
251
                done();
C
chensi10 已提交
252
            });
J
jiyong 已提交
253
        setTimeout(timeout, 5000);
C
chensi10 已提交
254 255
    })

C
chensi10 已提交
256 257 258 259 260
    /*
     * @tc.number    : Acts_Ams_test_1200
     * @tc.name      : moveMissionToTop : Move Mission To Top
     * @tc.desc      : Move Mission To Top(by CallBack)
     */
C
chensi10 已提交
261 262 263 264
    it('Acts_Ams_test_1200', 0, async function (done) {
        var maxnum = 10;
        var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
        abilitymanager.moveMissionToTop(result[0].id,
C
chensi10 已提交
265 266 267
            (error, info) => {
                console.info('Acts_Ams_test_1200 moveMissionToTop error.code \
                ' + error.code + ',data  [' + info + ']');
C
chensi10 已提交
268
                expect(info).assertEqual(0);
J
jiyong 已提交
269
                done();
C
chensi10 已提交
270
            });
J
jiyong 已提交
271
        setTimeout(timeout, 5000);
C
chensi10 已提交
272
    })
C
chensi10 已提交
273 274 275 276 277 278

    /*
     * @tc.number    : Acts_Ams_test_1400
     * @tc.name      : removeMissions : Remove Missions
     * @tc.desc      : Remove Missions(by CallBack)
     */
C
chensi10 已提交
279 280 281
    it('Acts_Ams_test_1400', 0, async function (done) {
        var maxnum = 10;
        var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
Z
zhaoyuan17 已提交
282 283 284
        expect(result.length).assertEqual(1);
        var missionID = result[0].id + 1;
        abilitymanager.removeMissions([missionID],
C
chensi10 已提交
285 286 287
            (error, info) => {
                console.info('Acts_Ams_test_1400 removeMissions error.code \
                ' + error.code + ',data  [' + info + ']');
C
chensi10 已提交
288
                expect(info).assertLarger(0);
J
jiyong 已提交
289
                done();
C
chensi10 已提交
290
            });
J
jiyong 已提交
291
        setTimeout(timeout, 5000);
C
chensi10 已提交
292 293
    })

C
chensi10 已提交
294
    /*
Z
zhaoyuan17 已提交
295 296 297
     * @tc.number    : Acts_Ams_test_1600
     * @tc.name      : killProcessesByBundleName : Kill Processes By BundleName
     * @tc.desc      : Kill Processes By BundleName(by CallBack)
C
chensi10 已提交
298
     */
Z
zhaoyuan17 已提交
299 300
    it('Acts_Ams_test_1600', 0, async function (done) {
        abilitymanager.killProcessesByBundleName('com.ix.simulate.feature',
C
chensi10 已提交
301
            (error, info) => {
Z
zhaoyuan17 已提交
302
                console.info('Acts_Ams_test_1600 killProcessesByBundleName error.code: \
C
chensi10 已提交
303
                ' + error.code + ',data  [' + info + ']');
Z
zhaoyuan17 已提交
304
                expect(info).assertEqual(0);
J
jiyong 已提交
305
                done();
C
chensi10 已提交
306
            });
J
jiyong 已提交
307
        setTimeout(timeout, 5000);
Z
zhaoyuan17 已提交
308

C
chensi10 已提交
309 310
    })

C
chensi10 已提交
311
    /*
Z
zhaoyuan17 已提交
312 313 314
     * @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 已提交
315
     */
Z
zhaoyuan17 已提交
316 317
    it('Acts_Ams_test_8600', 0, async function (done) {
        abilitymanager.getActiveProcessInfos(
C
chensi10 已提交
318
            (error, info) => {
Z
zhaoyuan17 已提交
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337
                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);
                expect(info.length).assertEqual(3);
                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 已提交
338
                done();
C
chensi10 已提交
339
            });
J
jiyong 已提交
340
        setTimeout(timeout, 5000);
Z
zhaoyuan17 已提交
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359
    })

    /*
    * @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);
                expect(info.length).assertEqual(1);
                for (var i = 0; i < info.length; i++) {
                    expect(typeof (info[i].missionId)).assertEqual("number");
                    expect(info[i].missionId).assertLarger(0);
C
chensi10 已提交
360

Z
zhaoyuan17 已提交
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 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
                    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);
                expect(info.length).assertEqual(1);
                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 已提交
449
    })
Z
zhaoyuan17 已提交
450

C
chensi10 已提交
451 452 453
})