window.promise.js 23.5 KB
Newer Older
L
lvsejunzhuang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
/*
 * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
import window from '@ohos.window'
import display from '@ohos.display'
import screen from '@ohos.screen'


describe('window_test', function() {
    var wnd;
    const FALSE_FLAG = false;
    beforeAll(function() {})
    beforeEach(function() {})
    afterEach(function() {})
    afterAll(function() {})

    /**
     * @tc.number      SUB_WMS_FAMODELSETCOLORSPACE_JSAPI_001
     * @tc.name        Test  faModelSetColorSpaceTest1.
     * @tc.desc        To verify the setting of the wide color gamut color space.
     */
    it('faModelSetColorSpaceTest1', 0, async function(done) {
        console.log('jsunittest faModelSetColorSpaceTest1 begin')
        window.getTopWindow().then(wnd => {
            console.log('jsunittest faModelSetColorSpaceTest1 wnd: ' + wnd);
            expect(wnd != null).assertTrue();
            wnd.setColorSpace(1).then(() => {
                console.log('jsunittest faModelSetColorSpaceTest1 setColorSpace WIDE_GAMUT');
                wnd.getColorSpace().then(res => {
                    expect(res == 1).assertTrue();
                    console.log('jsunittest faModelSetColorSpaceTest1 setColorSpace WIDE_GAMUT success');
                    wnd.isSupportWideGamut().then(data => {
                        expect(!!data).assertTrue();
                        console.log('ColorSpace WIDE_GAMUT SupportWideGamut');
                        done();
                    }).catch((err) => {
                        console.log('jsunittest faModelSetColorSpaceTest1 wnd.isSupportWideGamut failed, err :' + JSON.stringify(err));
                        expect().assertFail();
                        done();
                    })
                }).catch((err) => {
                    console.log('jsunittest faModelSetColorSpaceTest1 wnd.getColorSpace failed, err :' + JSON.stringify(err));
                    expect().assertFail();
                    done();
                })
            }).catch((err) => {
                console.log('jsunittest faModelSetColorSpaceTest1 wnd.setColorSpace failed, err :' + JSON.stringify(err));
                expect().assertFail();
                done();
            })
        }).catch((err) => {
            console.log('jsunittest faModelSetColorSpaceTest1 getTopWindow failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number      SUB_WMS_FAMODELSETCOLORSPACE_JSAPI_002
     * @tc.name        Test  faModelSetColorSpaceTest2.
     * @tc.desc        To verify that the color space of invaild values is set successfully.
     */
    it('faModelSetColorSpaceTest2', 0, async function(done) {
        console.log('jsunittest faModelSetColorSpaceTest2 begin');
        window.getTopWindow().then(wnd => {
            console.log('jsunittest faModelSetColorSpaceTest2 wnd: ' + wnd);
            expect(wnd != null).assertTrue();
            wnd.setColorSpace(-5).then(() => {
                console.log('jsunittest faModelSetColorSpaceTest2 setColorSpace -5');
                expect().assertFail();
                done();
            }).catch((err) => {
                console.log('jsunittest faModelSetColorSpaceTest2 wnd.setColorSpace failed, err :' + JSON.stringify(err));
87
                expect(err.code).assertEqual(130);
L
lvsejunzhuang 已提交
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 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 339 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 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 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464
                done();
            })
        }).catch((err) => {
            console.log('jsunittest faModelSetColorSpaceTest2 wnd.getTopWindow failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number      SUB_WMS_FAMODELSETWINDOWLAYOUTMODE_JSAPI_001
     * @tc.name        Test  faModelSetWindowLayoutModeTest1.
     * @tc.desc        To verify the function of setting different window modes.
     */
    it('faModelSetWindowLayoutModeTest1', 0, async function(done) {
        console.log('jsunittest faModelSetWindowLayoutModeTest1 begin');
        await display.getDefaultDisplay().then(dsp => {
            console.log('jsunittest faModelSetWindowLayoutModeTest1 getDefaultDisplay dspID :' + dsp.id);
            window.setWindowLayoutMode(0, dsp.id).then(() => {
                console.log('jsunittest faModelSetWindowLayoutModeTest1 setWindowLayoutMode WINDOW_LAYOUT_MODE_CASCADE success');
                window.setWindowLayoutMode(1, dsp.id).then(() => {
                    console.log('jsunittest faModelSetWindowLayoutModeTest1 setWindowLayoutMode WINDOW_LAYOUT_MODE_TILE success');
                    done();
                }).catch((err) => {
                    console.log('jsunittest faModelSetWindowLayoutModeTest1 setWindowLayoutMode failed, err :' + JSON.stringify(err));
                    expect().assertFail();
                    done();
                })
            }).catch((err) => {
                console.log('jsunittest faModelSetWindowLayoutModeTest1 setWindowLayoutMode failed, err :' + JSON.stringify(err));
                expect().assertFail();
                done();
            })
        }).catch((err) => {
            console.log('jsunittest faModelSetWindowLayoutModeTest1 getDefaultDisplay failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number      SUB_WMS_FAMODELSETWINDOWLAYOUTMODE_JSAPI_002
     * @tc.name        Test  faModelSetWindowLayoutModeTest2.
     * @tc.desc        To verify the function of setting the invalied window mode.
     */
    it('faModelSetWindowLayoutModeTest2', 0, async function(done) {
        console.log('jsunittest faModelSetWindowLayoutModeTest2 begin');
        display.getDefaultDisplay().then(dsp => {
            console.log('jsunittest faModelSetWindowLayoutModeTest2 getDefaultDisplay dspID :' + dsp.id);
            window.setWindowLayoutMode(-5, dsp.id).then(() => {
                console.log('jsunittest faModelSetWindowLayoutModeTest2 setWindowLayoutMode -5 success');
                expect().assertFail();
                done();
            }).catch((err) => {
                console.log('jsunittest faModelSetWindowLayoutModeTest2 setWindowLayoutMode failed, err :' + JSON.stringify(err));
                expect(err.code).assertEqual(130);
                done();
            })
        }).catch((err) => {
            console.log('jsunittest faModelSetWindowLayoutModeTest2 getDefaultDisplay failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number      SUB_WMS_FAMODELSETWINDOWLAYOUTMODE_JSAPI_003
     * @tc.name        Test  faModelSetWindowLayoutModeTest3.
     * @tc.desc        To verify the scenario where the screen ID is invaild when the window mode is set.
     */
    it('faModelSetWindowLayoutModeTest3', 0, async function(done) {
        console.log('jsunittest faModelSetWindowLayoutModeTest3 begin');
        window.setWindowLayoutMode(-5, -100).then(() => {
            console.log('jsunittest faModelSetWindowLayoutModeTest3 setWindowLayoutMode (-5,-100) success');
            expect().assertFail();
            done();
        }).catch((err) => {
            console.log('jsunittest faModelSetWindowLayoutModeTest3 setWindowLayoutMode failed, err :' + JSON.stringify(err));
            expect(err.code).assertEqual(120);
            done();
        })
    })

    /**
     * @tc.number      SUB_WMS_FAMODELSETSCREENACTIVEMODE_JSAPI_001
     * @tc.name        Test  faModelSetScreenActiveModeTest1.
     * @tc.desc        To test the function of setting screen parameters.
     */
    it('faModelSetScreenActiveModeTest1', 0, async function(done) {
        console.log('jsunittest setScreenActiveModeTest1 begin');
        screen.getAllScreen().then(scr => {
            console.log('jsunittest faModelSetScreenActiveModeTest1 getAllScreen scr' + scr);
            expect(scr[0] != null).assertTrue();
            let screen1 = scr[0];
            screen1.setScreenActiveMode(0).then(res1 => {
                console.log('jsunittest faModelSetScreenActiveModeTest1 setScreenActiveMode 0 res1 :' + res1);
                expect(res1).assertTrue();
                done();
            }).catch((err) => {
                console.log('jsunittest faModelSetScreenActiveModeTest1 setScreenActiveMode 0 failed, err :' + JSON.stringify(err));
                expect().assertFail();
                done();
            })
        }).catch((err) => {
            console.log('jsunittest faModelSetScreenActiveModeTest1 getAllScreen failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number      SUB_WMS_FAMODELSETSCREENACTIVEMODE_JSAPI_002
     * @tc.name        Test  faModelSetScreenActiveModeTest2.
     * @tc.desc        To set the function of setting screen parameters to abnormal values.
     */
    it('faModelSetScreenActiveModeTest2', 0, async function(done) {
        console.log('jsunittest faModelSetScreenActiveModeTest2 begin');
        screen.getAllScreen().then(scr => {
            console.log('jsunittest faModelSetScreenActiveModeTest2 getAllScreen scr' + scr);
            expect(scr[0] != null).assertTrue();
            let screen1 = scr[0];
            screen1.setScreenActiveMode(-5).then(res => {
                console.log('jsunittest faModelSetScreenActiveModeTest2 setScreenActiveMode -5 res :' + res);
                expect(!!res).assertFalse();
                done();
            }).catch((err) => {
                console.log('jsunittest faModelSetScreenActiveModeTest2 setScreenActiveMode -5 failed, err :' + JSON.stringify(err));
                expect(err.code).assertEqual(0);
                done();
            })
        })
    })

    /**
     * @tc.number      SUB_WMS_FAMODELISSHOWING_JSAPI_001
     * @tc.name        Test  faModelIsShowingTest1.
     * @tc.desc        To verify the function of obtaining the display status when a window is hidden and then displayed.
     */
    it('faModelIsShowingTest1', 0, async function(done) {
        console.log('jsunittest faModelIsShowingTest1 begin');
        window.getTopWindow().then(wnd => {
            console.log('jsunittest faModelIsShowingTest1 getTopWindow wnd: ' + wnd)
            expect(wnd != null).assertTrue();
            wnd.hide().then(() => {
                console.log('jsunittest faModelIsShowingTest1 wnd.hide success')
                wnd.isShowing().then(data => {
                    console.log('jsunittest faModelIsShowingTest1 wnd.isShowing data: ' + data)
                    expect(!data).assertTrue();
                    wnd.show().then(() => {
                        console.log('jsunittest faModelIsShowingTest1 wnd.show success')
                        wnd.isShowing().then(res => {
                            console.log('jsunittest faModelIsShowingTest1 wnd.isShowing res: ' + res)
                            expect(res).assertTrue();
                            done();
                        }).catch((err) => {
                            console.log('jsunittest faModelIsShowingTest1 wnd.isShowing failed, err :' + JSON.stringify(err));
                            expect().assertFail();
                            done();
                        })
                    }).catch((err) => {
                        console.log('jsunittest faModelIsShowingTest1 wnd.show failed, err :' + JSON.stringify(err));
                        expect().assertFail();
                        done();
                    })
                }).catch((err) => {
                    console.log('jsunittest faModelIsShowingTest1 wnd.isShowing failed, err :' + JSON.stringify(err));
                    expect().assertFail();
                    done();
                })
            }).catch((err) => {
                console.log('jsunittest faModelIsShowingTest1 wnd.hide failed, err :' + JSON.stringify(err));
                expect().assertFail();
                done();
            })
        }).catch((err) => {
            console.log('jsunittest faModelIsShowingTest1 getTopWindow failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number		SUB_WMS_FAMODELGETDEFALUTDISPLAY_JSAPI_001
     * @tc.name			Test getDefaultDisplayTest1.
     * @tc.desc			To test the function of obtaining the default screen.
     */
    it('faModelGetDefaultDisplayTest1', 0, async function(done) {
        console.log('jsunittest faModelGetDefaultDisplayTest1 begin')
        display.getDefaultDisplay().then(dsp => {
            console.log('jsunittest faModelGetDefaultDisplayTest1 getDefaultDisplay id :' + dsp.id)
            console.log('jsunittest faModelGetDefaultDisplayTest1 getDefaultDisplay refreshRate :' + dsp.refreshRate)
            console.log('jsunittest faModelGetDefaultDisplayTest1 getDefaultDisplay width :' + dsp.width)
            console.log('jsunittest faModelGetDefaultDisplayTest1 getDefaultDisplay height :' + dsp.height)
            expect(dsp.id != null).assertTrue();
            expect(dsp.refreshRate != null).assertTrue();
            expect(dsp.width != null).assertTrue();
            expect(dsp.height != null).assertTrue();
            done();
        }).catch((err) => {
            console.log('jsunittest faModelGetDefaultDisplayTest1 getDefaultDisplay failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number		SUB_WMS_FAMODELGETALLDISPLAY_JSAPI_001
     * @tc.name			Test faModeGetAllDisplayTest1.
     * @tc.desc			To verify the function of obtaining all screens.
     */
    it('faModelGetAllDisplayTest1', 0, async function(done) {
        console.log('jsunittest faModelGetAllDisplayTest1 begin')
        display.getAllDisplay().then(dsp => {
            console.log('jsunittest faModelGetAllDisplayTest1 getDefaultDisplay id :' + JSON.stringify(dsp))
            console.log('jsunittest faModelGetAllDisplayTest1 getDefaultDisplay id :' + dsp[0].id)
            console.log('jsunittest faModelGetAllDisplayTest1 getDefaultDisplay refreshRate :' + dsp[0].refreshRate)
            console.log('jsunittest faModelGetAllDisplayTest1 getDefaultDisplay width :' + dsp[0].width)
            console.log('jsunittest faModelGetAllDisplayTest1 getDefaultDisplay height :' + dsp[0].height)
            expect(dsp[0].id != null).assertTrue();
            expect(dsp[0].refreshRate != null).assertTrue();
            expect(dsp[0].width != null).assertTrue();
            expect(dsp[0].height != null).assertTrue();
            done();
        }).catch((err) => {
            console.log('jsunittest faModelGetDefaultDisplayTest1 getDefaultDisplay failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number		SUB_WMS_FAMODELCREATE_JSAPI_001
     * @tc.name			Test faModelGetAllDisplayTest1.
     * @tc.desc			To verify the function of creating an application subwindow.
     */
    it('faModelCreateTest1', 0, async function(done) {
        console.log('jsunittest faModelCreateTest1 begin')
        window.create('subWindow', 0).then(wnd => {
            expect(wnd != null).assertTrue();
            console.log('jsunittest faModelCreateTest1 create success wnd' + wnd);
            done();
        }).catch((err) => {
            console.log('jsunittest faModelCreateTest1 create failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number		SUB_WMS_FAMODELDESTROY_JSAPI_001
     * @tc.name			Test faModelDestroyTest1.
     * @tc.desc			Verify that a window is destroyed after being created.
     */
    it('faModelDestroyTest1', 0, async function(done) {
        console.log('jsunittest faModelDestroyTest1 begin')
        window.create('subWindow2', 0).then(wnd => {
            expect(wnd != null).assertTrue();
            console.log('jsunittest faModelDestroyTest1 create success wnd' + wnd);
            wnd.destroy().then(() => {
                console.log('jsunittest faModelDestroyTest1 destroy success ');
                window.find('subWindow2').then((data) => {
                    console.log('jsunittest faModelDestroyTest1 window.find success, window :' + JSON.stringify(data));
                    expect().assertFail();
                    done();
                }).catch((err) => {
                    console.log('jsunittest faModelDestroyTest1 find failed, err :' + JSON.stringify(err));
                    expect(err.code).assertEqual(120);
                    done();
                })
            }).catch((err) => {
                console.log('jsunittest faModelCreateTest1 destroy failed, err :' + JSON.stringify(err));
                expect().assertFail();
                done();
            })
        }).catch((err) => {
            console.log('jsunittest faModelCreateTest1 create failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number		SUB_WMS_FAMODELSETSYSTEMBARENABLE_JSAPI_001
     * @tc.name			Test faModelSetSystemBarEnableTest1.
     * @tc.desc			To verify the function of setting a scenario that is visible to the system bar.
     */
    it('faModelSetSystemBarEnableTest1', 0, async function(done) {
        console.log('jsunittest faModelSetSystemBarEnableTest1 begin')
        var names = ["status", "navigation"];
        window.getTopWindow().then(wnd => {
            expect(wnd != null).assertTrue();
            wnd.setLayoutFullScreen(true).then(() => {
                console.log('jsunittest faModelSetSystemBarEnableTest1 setLayoutFullScreen(true) success ');
                wnd.setSystemBarEnable(names).then(() => {
                    console.log('jsunittest faModelSetSystemBarEnableTest1 setSystemBarEnable success');
                    done();
                }).catch((err) => {
                    console.log('jsunittest faModelSetSystemBarEnableTest1 setSystemBarEnable failed, err :' + JSON.stringify(err));
                    expect().assertFail();
                    done();
                })
            }).catch((err) => {
                console.log('jsunittest faModelSetSystemBarEnableTest1 setLayoutFullScreen failed, err :' + JSON.stringify(err));
                expect().assertFail();
                done();
            })

        }).catch((err) => {
            console.log('jsunittest faModelSetSystemBarEnableTest1 getTopWindow failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number		SUB_WMS_FAMODELSETSYSTEMBARPROPERTIES_JSAPI_001
     * @tc.name			Test faModelSetSystemBarPropertiesTest1.
     * @tc.desc			To verify the function of setting system bar attributes.
     */
    it('faModelSetSystemBarPropertiesTest1', 0, async function(done) {
        console.log('jsunittest faModelSetSystemBarPropertiesTest1 begin')
        var SystemBarProperties = {
            statusBarColor: '#ff00ff',
            navigationBarColor: '#00ff00',
            isStatusBarLightIcon: true,
            isNavigationBarLightIcon: false,
            statusBarContentColor: '#ffffff',
            navigationBarContentColor: '#00ffff'
        };
        window.getTopWindow().then(wnd => {
            expect(wnd != null).assertTrue();
            wnd.setSystemBarProperties(SystemBarProperties).then(() => {
                console.log('jsunittest faModelSetSystemBarPropertiesTest1 setSystemBarProperties success ')
                done();
            }).catch((err) => {
                console.log('jsunittest faModelSetSystemBarPropertiesTest1 setSystemBarProperties failed, err :' + JSON.stringify(err));
                expect().assertFail();
                done();
            })
        }).catch((err) => {
            console.log('jsunittest faModelSetSystemBarPropertiesTest1 getTopWindow failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number		SUB_WMS_FAMODELMINIMIZEALL_JSAPI_001
     * @tc.name			Test faModelMinimizeAllTest1.
     * @tc.desc			To verify the function of minimizing all windows on the default screen.
     */
    it('faModelMinimizeAllTest1', 0, async function(done) {
        console.log('jsunittest faModelMinimizeAllTest1 begin')
        window.getTopWindow().then(wnd => {
            expect(wnd != null).assertTrue();
            display.getDefaultDisplay().then(dsp => {
                console.log('jsunittest faModelMinimizeAllTest1 getDefaultDisplay dspID :' + dsp.id);
                window.minimizeAll(dsp.id).then(() => {
                    console.log('jsunittest faModelMinimizeAllTest1 minimizeAll success');
                    setTimeout(() => {
                        window.getTopWindow().then((wnd) => {
                            console.log('jsunittest faModelMinimizeAllTest1 getTopWindow success');
                            expect().assertFail();
                            done();
                        }).catch((err) => {
                            console.log('jsunittest faModelMinimizeAllTest1 getTopWindow failed, err :' + JSON.stringify(err));
                            expect(err.code).assertEqual(120);
                            wnd.show().then(() => {
                                console.log('jsunittest faModelMinimizeAllTest1 show success');
                                expect(true).assertTrue();
                                done();
                            }).catch((err) => {
                                console.log('jsunittest faModelMinimizeAllTest1 show failed, err :' + JSON.stringify(err));
                                expect().assertFail();
                                done();
                            })
                        })
465
                    }, 3000)
L
lvsejunzhuang 已提交
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
                }).catch((err) => {
                    console.log('jsunittest faModelMinimizeAllTest1 minimizeAll failed, err :' + JSON.stringify(err));
                    expect().assertFail();
                    done();
                })
            }).catch((err) => {
                console.log('jsunittest faModelMinimizeAllTest1 getDefaultDisplay failed, err :' + JSON.stringify(err));
                expect().assertFail();
                done();
            })
        }).catch((err) => {
            console.log('jsunittest faModelMinimizeAllTest1 getTopWindow failed, err :' + JSON.stringify(err));
            expect().assertFail();
            done();
        })
    })

    /**
     * @tc.number		SUB_WMS_FAMODELMINIMIZEALL_JSAPI_002
     * @tc.name			Test faModelMinimizeAllTest2.
     * @tc.desc			To verify the function of minimizing all windows on an invalid screen.
     */
    it('faModelMinimizeAllTest2', 0, async function(done) {
        console.log('jsunittest faModelMinimizeAllTest2 begin')
        window.minimizeAll(-100).then(() => {
            console.log('jsunittest faModelMinimizeAllTest2 minimizeAll success');
            expect().assertFail();
            done();
        }).catch((err) => {
            console.log('jsunittest faModelMinimizeAllTest2 minimizeAll failed, err :' + JSON.stringify(err));
            expect(err.code).assertEqual(130);
            done();
        })
    })

})