MangerAbilityJsunit.test.js 22.2 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 92
        expect().assertFail();
        console.debug('Acts_Ams_test=========timeout========');
        done();
    }
    
C
chensi10 已提交
93 94 95 96 97
    /*
     * @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 已提交
98
    it('Acts_Ams_test_0200', 0, async function (done) {
J
jiyong 已提交
99 100 101 102 103 104 105 106 107 108
        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 已提交
109

J
jiyong 已提交
110 111 112
                    expect(typeof (info[i].processName)).assertEqual("string");
                    expect(info[i].processName.length).assertLarger(0);
                    expect(bundleNameList.indexOf(info[i].processName)).assertLarger(-1);
C
chensi10 已提交
113

J
jiyong 已提交
114 115
                    expect(Array.isArray(info[i].pkgList)).assertEqual(true);
                    expect(info[i].pkgList.length).assertEqual(0);
C
chensi10 已提交
116

J
jiyong 已提交
117 118
                    expect(typeof (info[i].uid)).assertEqual("number");
                    expect(info[i].uid).assertLarger(0);
C
chensi10 已提交
119

J
jiyong 已提交
120 121
                    expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
                    expect(info[i].lastMemoryLevel).assertEqual(-1);
C
chensi10 已提交
122

J
jiyong 已提交
123 124
                    expect(typeof (info[i].weight)).assertEqual("number");
                    expect(info[i].weight).assertEqual(-1);
C
chensi10 已提交
125

J
jiyong 已提交
126 127 128 129 130 131
                    expect(typeof (info[i].weightReasonCode)).assertEqual("number");
                    expect(info[i].weightReasonCode).assertEqual(WeightReasonCode.REASON_UNKNOWN);
                }
                done();
            });
        setTimeout(timeout, 5000);
C
chensi10 已提交
132 133
    })

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

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

                    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 已提交
176
                done();
C
chensi10 已提交
177
            });
J
jiyong 已提交
178
        setTimeout(timeout, 5000);
C
chensi10 已提交
179 180
    })

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

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

                    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 已提交
223
                done();
C
chensi10 已提交
224
            });
J
jiyong 已提交
225
        setTimeout(timeout, 5000);
C
chensi10 已提交
226
    })
C
chensi10 已提交
227 228 229 230 231 232

    /*
     * @tc.number    : Acts_Ams_test_0800
     * @tc.name      : removeMission : Remove Mission
     * @tc.desc      : Remove Mission(by CallBack)
     */
C
chensi10 已提交
233 234 235 236
    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 已提交
237 238 239
            (error, info) => {
                console.info('Acts_Ams_test_0800 removeMission error.code \
                ' + error.code + ',data  [' + info + ']');
Z
zhaoyuan17 已提交
240
                expect(info).assertEqual(0);
J
jiyong 已提交
241
                done();
C
chensi10 已提交
242
            });
J
jiyong 已提交
243
        setTimeout(timeout, 5000);
C
chensi10 已提交
244 245
    })

C
chensi10 已提交
246 247 248 249 250
    /*
     * @tc.number    : Acts_Ams_test_1200
     * @tc.name      : moveMissionToTop : Move Mission To Top
     * @tc.desc      : Move Mission To Top(by CallBack)
     */
C
chensi10 已提交
251 252 253 254
    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 已提交
255 256 257
            (error, info) => {
                console.info('Acts_Ams_test_1200 moveMissionToTop error.code \
                ' + error.code + ',data  [' + info + ']');
C
chensi10 已提交
258
                expect(info).assertEqual(0);
J
jiyong 已提交
259
                done();
C
chensi10 已提交
260
            });
J
jiyong 已提交
261
        setTimeout(timeout, 5000);
C
chensi10 已提交
262
    })
C
chensi10 已提交
263 264 265 266 267 268

    /*
     * @tc.number    : Acts_Ams_test_1400
     * @tc.name      : removeMissions : Remove Missions
     * @tc.desc      : Remove Missions(by CallBack)
     */
C
chensi10 已提交
269 270 271
    it('Acts_Ams_test_1400', 0, async function (done) {
        var maxnum = 10;
        var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
Z
zhaoyuan17 已提交
272 273 274
        expect(result.length).assertEqual(1);
        var missionID = result[0].id + 1;
        abilitymanager.removeMissions([missionID],
C
chensi10 已提交
275 276 277
            (error, info) => {
                console.info('Acts_Ams_test_1400 removeMissions error.code \
                ' + error.code + ',data  [' + info + ']');
C
chensi10 已提交
278
                expect(info).assertLarger(0);
J
jiyong 已提交
279
                done();
C
chensi10 已提交
280
            });
J
jiyong 已提交
281
        setTimeout(timeout, 5000);
C
chensi10 已提交
282 283
    })

C
chensi10 已提交
284
    /*
Z
zhaoyuan17 已提交
285 286 287
     * @tc.number    : Acts_Ams_test_1600
     * @tc.name      : killProcessesByBundleName : Kill Processes By BundleName
     * @tc.desc      : Kill Processes By BundleName(by CallBack)
C
chensi10 已提交
288
     */
Z
zhaoyuan17 已提交
289 290
    it('Acts_Ams_test_1600', 0, async function (done) {
        abilitymanager.killProcessesByBundleName('com.ix.simulate.feature',
C
chensi10 已提交
291
            (error, info) => {
Z
zhaoyuan17 已提交
292
                console.info('Acts_Ams_test_1600 killProcessesByBundleName error.code: \
C
chensi10 已提交
293
                ' + error.code + ',data  [' + info + ']');
Z
zhaoyuan17 已提交
294
                expect(info).assertEqual(0);
J
jiyong 已提交
295
                done();
C
chensi10 已提交
296
            });
J
jiyong 已提交
297
        setTimeout(timeout, 5000);
Z
zhaoyuan17 已提交
298

C
chensi10 已提交
299 300
    })

C
chensi10 已提交
301
    /*
Z
zhaoyuan17 已提交
302 303 304
     * @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 已提交
305
     */
Z
zhaoyuan17 已提交
306 307
    it('Acts_Ams_test_8600', 0, async function (done) {
        abilitymanager.getActiveProcessInfos(
C
chensi10 已提交
308
            (error, info) => {
Z
zhaoyuan17 已提交
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
                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 已提交
328
                done();
C
chensi10 已提交
329
            });
J
jiyong 已提交
330
        setTimeout(timeout, 5000);
Z
zhaoyuan17 已提交
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349
    })

    /*
    * @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 已提交
350

Z
zhaoyuan17 已提交
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 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
                    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 已提交
439
    })
Z
zhaoyuan17 已提交
440

C
chensi10 已提交
441 442 443
})