From d7a581ca72d5e3ae428c4073dfb7131534fcb5ae Mon Sep 17 00:00:00 2001 From: hk_js Date: Mon, 25 Jul 2022 15:57:30 +0800 Subject: [PATCH] add display interface test case about window Signed-off-by: hk_js --- .../src/main/js/test/display.test.js | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/graphic/windowstandard/src/main/js/test/display.test.js b/graphic/windowstandard/src/main/js/test/display.test.js index 61c7eb6ab..fb969b960 100644 --- a/graphic/windowstandard/src/main/js/test/display.test.js +++ b/graphic/windowstandard/src/main/js/test/display.test.js @@ -152,6 +152,36 @@ describe('display_test', function () { }) }) + /** + * @tc.number SUB_WMS_GETDEFALUTDISPLAYSYNC_JSAPI_001 + * @tc.name Test getDefaultDisplaySYNC_Test_001 + * @tc.desc To test the sync function of obtaining the default display + */ + it('getDefaultDisplaySync_Test_001', 0, async function (done) { + console.info('displayTest getDefaultDisplaySyncTest1 begin'); + try { + var dsp = display.getDefaultDisplaySync(); + console.info('displayTest getDefaultDisplaySyncTest1: ' + JSON.stringify(dsp)); + expect(dsp.id != null).assertTrue(); + expect(dsp.refreshRate != null).assertTrue(); + expect(dsp.width != null).assertTrue(); + expect(dsp.height != null).assertTrue(); + expect(dsp.rotation != null).assertTrue(); + expect(dsp.densityDPI != null).assertTrue(); + expect(dsp.name != null).assertTrue(); + expect(dsp.alive).assertEqual(undefined); + expect(dsp.state).assertEqual(undefined); + expect(dsp.densityPixels != null).assertTrue(); + expect(dsp.scaledDensity !=null).assertTrue(); + expect(dsp.xDPI).assertEqual(undefined); + expect(dsp.yDPI).assertEqual(undefined); + done(); + } catch (err) { + console.error('getDefaultDisplaySyncTest1 error ' + JSON.stringify(err)); + expect.assertFail(); + done(); + } + }) /** * @tc.number SUB_WMS_ENUM_WINDOWDisplayState_JSAPI_001 -- GitLab