From 48c83607f40e1e67465a938295d3d0b763531623 Mon Sep 17 00:00:00 2001 From: hu0475 Date: Mon, 17 Jul 2023 19:54:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90graphic=E5=AD=90=E7=B3=BB?= =?UTF-8?q?=E7=BB=9FDisplay=E6=A8=A1=E5=9D=97=E7=9A=84=E8=B7=A8=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E6=B5=8B=E8=AF=95=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hu0475 --- .../src/main/ets/test/Display.test.ets | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/graphic/crossplatform/graphicDisplayetstest/src/main/ets/test/Display.test.ets b/graphic/crossplatform/graphicDisplayetstest/src/main/ets/test/Display.test.ets index eeaefc87a..a352ad1b5 100644 --- a/graphic/crossplatform/graphicDisplayetstest/src/main/ets/test/Display.test.ets +++ b/graphic/crossplatform/graphicDisplayetstest/src/main/ets/test/Display.test.ets @@ -41,19 +41,16 @@ export default function DisplayTest() { console.info('displayTest getDefaultDisplaySyncTest1 begin'); try { var dsp = display.getDefaultDisplaySync(); + console.error('getDefaultDisplaySync message ' + JSON.stringify(dsp)); + console.log("testGetDefaultDisplaySync001 1"); expect(dsp.id != null).assertTrue(); - expect(dsp.refreshRate != null).assertTrue(); + console.log("testGetDefaultDisplaySync001 2"); expect(dsp.width != null).assertTrue(); + console.log("testGetDefaultDisplaySync001 3"); expect(dsp.height != null).assertTrue(); - expect(dsp.rotation != null).assertTrue(); - expect(dsp.densityDPI != null).assertTrue(); - expect(dsp.name != null).assertTrue(); - expect(dsp.alive).assertTrue(); - expect(dsp.state != null).assertTrue(); - expect(dsp.densityPixels != null).assertTrue(); - expect(dsp.scaledDensity != null).assertTrue(); - expect(dsp.xDPI != null).assertTrue(); - expect(dsp.yDPI != null).assertTrue(); + console.log("testGetDefaultDisplaySync001 4"); + expect(dsp.orientation != null).assertTrue(); + console.log("testGetDefaultDisplaySync001 5"); done(); } catch (err) { console.error('getDefaultDisplaySyncTest1 error ' + JSON.stringify(err)); @@ -72,10 +69,15 @@ export default function DisplayTest() { */ it('testDisplay_Orientation001', 0, async function (done) { var dsp = display.getDefaultDisplaySync(); + console.log("testDisplay_Orientation001 1"); expect(dsp.id != null).assertTrue(); + console.log("testDisplay_Orientation001 2"); expect(dsp.width != null).assertTrue(); + console.log("testDisplay_Orientation001 3"); expect(dsp.height != null).assertTrue(); + console.log("testDisplay_Orientation001 4"); expect(dsp.orientation != null).assertTrue(); + console.log("testDisplay_Orientation001 5"); done(); }); @@ -89,10 +91,15 @@ export default function DisplayTest() { */ it('testOrientation001', 0, async function (done) { var dsp = display.getDefaultDisplaySync(); - expect(dsp.orientation == 0).assertTrue(); - expect(dsp.orientation != 1).assertTrue(); - expect(dsp.orientation != 2).assertTrue(); - expect(dsp.orientation != 3).assertTrue(); + console.log("testOrientation001 1...orientation:" + dsp.orientation); + expect(dsp.orientation == 0).assertTrue(); + console.log("testOrientation001 2"); + expect(dsp.orientation != 1).assertTrue(); + console.log("testOrientation001 3"); + expect(dsp.orientation != 2).assertTrue(); + console.log("testOrientation001 4"); + expect(dsp.orientation != 3).assertTrue(); + console.log("testOrientation001 5"); done(); }); -- GitLab