未验证 提交 55bdbb89 编写于 作者: O openharmony_ci 提交者: Gitee

!3188 【窗口子系统】整改XTS用例

Merge pull request !3188 from liziqiang/master
...@@ -41,6 +41,15 @@ describe('display_test', function () { ...@@ -41,6 +41,15 @@ describe('display_test', function () {
expect(dsp.refreshRate != null).assertTrue(); expect(dsp.refreshRate != null).assertTrue();
expect(dsp.width != null).assertTrue(); expect(dsp.width != null).assertTrue();
expect(dsp.height != null).assertTrue(); expect(dsp.height != null).assertTrue();
expect(dsp.rotation != null).assertTrue();
expect(dsp.densityDPI != null).assertTrue();
expect(dsp.name).assertEqual(undefined);
expect(dsp.alive).assertEqual(undefined);
expect(dsp.state).assertEqual(undefined);
expect(dsp.densityPixels).assertEqual(undefined);
expect(dsp.scaledDensity).assertEqual(undefined);
expect(dsp.xDPI).assertEqual(undefined);
expect(dsp.yDPI).assertEqual(undefined);
done(); done();
}, (err) => { }, (err) => {
console.log('displayTest getDefaultDisplayTest1 getDefaultDisplay failed, err :' + JSON.stringify(err)); console.log('displayTest getDefaultDisplayTest1 getDefaultDisplay failed, err :' + JSON.stringify(err));
...@@ -67,6 +76,15 @@ describe('display_test', function () { ...@@ -67,6 +76,15 @@ describe('display_test', function () {
expect(data.refreshRate != null).assertTrue(); expect(data.refreshRate != null).assertTrue();
expect(data.width != null).assertTrue(); expect(data.width != null).assertTrue();
expect(data.height != null).assertTrue(); expect(data.height != null).assertTrue();
expect(data.rotation != null).assertTrue();
expect(data.densityDPI != null).assertTrue();
expect(data.name).assertEqual(undefined);
expect(data.alive).assertEqual(undefined);
expect(data.state).assertEqual(undefined);
expect(data.densityPixels).assertEqual(undefined);
expect(data.scaledDensity).assertEqual(undefined);
expect(data.xDPI).assertEqual(undefined);
expect(data.yDPI).assertEqual(undefined);
done(); done();
} }
}) })
...@@ -85,6 +103,15 @@ describe('display_test', function () { ...@@ -85,6 +103,15 @@ describe('display_test', function () {
expect(dsp[0].refreshRate != null).assertTrue(); expect(dsp[0].refreshRate != null).assertTrue();
expect(dsp[0].width != null).assertTrue(); expect(dsp[0].width != null).assertTrue();
expect(dsp[0].height != null).assertTrue(); expect(dsp[0].height != null).assertTrue();
expect(dsp[0].rotation != null).assertTrue();
expect(dsp[0].densityDPI != null).assertTrue();
expect(dsp[0].name).assertEqual(undefined);
expect(dsp[0].alive).assertEqual(undefined);
expect(dsp[0].state).assertEqual(undefined);
expect(dsp[0].densityPixels).assertEqual(undefined);
expect(dsp[0].scaledDensity).assertEqual(undefined);
expect(dsp[0].xDPI).assertEqual(undefined);
expect(dsp[0].yDPI).assertEqual(undefined);
done(); done();
}, (err) => { }, (err) => {
console.log('displayTest getAllDisplayTest1 getAllDisplay failed, err :' + JSON.stringify(err)); console.log('displayTest getAllDisplayTest1 getAllDisplay failed, err :' + JSON.stringify(err));
...@@ -110,6 +137,15 @@ describe('display_test', function () { ...@@ -110,6 +137,15 @@ describe('display_test', function () {
expect(data[0].refreshRate != null).assertTrue(); expect(data[0].refreshRate != null).assertTrue();
expect(data[0].width != null).assertTrue(); expect(data[0].width != null).assertTrue();
expect(data[0].height != null).assertTrue(); expect(data[0].height != null).assertTrue();
expect(data[0].rotation != null).assertTrue();
expect(data[0].densityDPI != null).assertTrue();
expect(data[0].name).assertEqual(undefined);
expect(data[0].alive).assertEqual(undefined);
expect(data[0].state).assertEqual(undefined);
expect(data[0].densityPixels).assertEqual(undefined);
expect(data[0].scaledDensity).assertEqual(undefined);
expect(data[0].xDPI).assertEqual(undefined);
expect(data[0].yDPI).assertEqual(undefined);
done(); done();
} }
}) })
......
...@@ -106,6 +106,9 @@ describe('window_test', function () { ...@@ -106,6 +106,9 @@ describe('window_test', function () {
expect(!data.isKeepScreenOn).assertTrue(); expect(!data.isKeepScreenOn).assertTrue();
expect(!data.isTransparent).assertTrue(); expect(!data.isTransparent).assertTrue();
expect(data.brightness != null).assertTrue(); expect(data.brightness != null).assertTrue();
expect(data.dimBehindValue).assertEqual(undefined);
expect(!data.isRoundCorner).assertTrue();
expect(!data.isPrivacyMode).assertTrue();
done(); done();
}, (err) => { }, (err) => {
console.log('windowTest getPropertiesTest1 wnd.getProperties failed, err : ' + JSON.stringify(err)); console.log('windowTest getPropertiesTest1 wnd.getProperties failed, err : ' + JSON.stringify(err));
...@@ -147,6 +150,9 @@ describe('window_test', function () { ...@@ -147,6 +150,9 @@ describe('window_test', function () {
expect(!data.isKeepScreenOn).assertTrue(); expect(!data.isKeepScreenOn).assertTrue();
expect(!data.isTransparent).assertTrue(); expect(!data.isTransparent).assertTrue();
expect(data.brightness != null).assertTrue(); expect(data.brightness != null).assertTrue();
expect(data.dimBehindValue).assertEqual(undefined);
expect(!data.isRoundCorner).assertTrue();
expect(!data.isPrivacyMode).assertTrue();
done(); done();
} }
}) })
...@@ -1883,7 +1889,7 @@ describe('window_test', function () { ...@@ -1883,7 +1889,7 @@ describe('window_test', function () {
*/ */
it('setScreenActiveMode_Test_001', 0, async function (done) { it('setScreenActiveMode_Test_001', 0, async function (done) {
console.log('screenshotTest setScreenActiveModeTest1 begin'); console.log('screenshotTest setScreenActiveModeTest1 begin');
screen.getAllScreen().then(src => { screen.getAllScreens().then(src => {
console.log('screenshotTest setScreenActiveModeTest1 getAllScreen src' + src); console.log('screenshotTest setScreenActiveModeTest1 getAllScreen src' + src);
expect(src[0] != null).assertTrue(); expect(src[0] != null).assertTrue();
let screenIndex = src[0]; let screenIndex = src[0];
...@@ -1909,7 +1915,7 @@ describe('window_test', function () { ...@@ -1909,7 +1915,7 @@ describe('window_test', function () {
*/ */
it('setScreenActiveMode_Test_002', 0, async function (done) { it('setScreenActiveMode_Test_002', 0, async function (done) {
console.log('screenshotTest setScreenActiveModeTest2 begin'); console.log('screenshotTest setScreenActiveModeTest2 begin');
screen.getAllScreen().then(src => { screen.getAllScreens().then(src => {
console.log('screenshotTest setScreenActiveModeTest2 getAllScreen src' + src); console.log('screenshotTest setScreenActiveModeTest2 getAllScreen src' + src);
expect(src[0] != null).assertTrue(); expect(src[0] != null).assertTrue();
let screenIndex = src[0]; let screenIndex = src[0];
...@@ -1943,6 +1949,22 @@ describe('window_test', function () { ...@@ -1943,6 +1949,22 @@ describe('window_test', function () {
} }
}) })
/**
* @tc.number SUB_WMS_ENUM_WINDOWTYPE_JSAPI_001
* @tc.name Test enumWindowType_Test_001.
* @tc.desc To test the enum value of WindowType.
*/
it('enumWindowType_Test_001', 0, async function (done) {
console.log('windowTest the enum value of Window begin');
try {
expect(0).assertEqual(window.WindowType.TYPE_APP);
expect(1).assertEqual(window.WindowType.TYPE_SYSTEM_ALERT);
done();
} catch (err) {
console.log('windowTest enum value of WindowType error ' + JSON.stringify(err));
}
})
/** /**
* @tc.number SUB_WMS_SETFOCUSABLE_JSAPI_001 * @tc.number SUB_WMS_SETFOCUSABLE_JSAPI_001
* @tc.name Test setFocusable_Test_001 * @tc.name Test setFocusable_Test_001
...@@ -2164,7 +2186,7 @@ describe('window_test', function () { ...@@ -2164,7 +2186,7 @@ describe('window_test', function () {
done(); done();
}) })
}, (err) => { }, (err) => {
console.log('windowTest setFocusableTest4 getTopWindow failed: err' + JSON.stringify(err)); console.log('windowTest setFocusableTest5 getTopWindow failed: err' + JSON.stringify(err));
expect().assertFail(); expect().assertFail();
done(); done();
}) })
...@@ -2187,17 +2209,17 @@ describe('window_test', function () { ...@@ -2187,17 +2209,17 @@ describe('window_test', function () {
wnd.getProperties().then(data => { wnd.getProperties().then(data => {
expect(!data.touchable).assertTrue(); expect(!data.touchable).assertTrue();
wnd.setTouchable(true).then(() => { wnd.setTouchable(true).then(() => {
console.log('windowTest setTouchableTest2 setTouchable(true) success '); console.log('windowTest setTouchableTest1 setTouchable(true) success ');
wnd.getProperties().then(data => { wnd.getProperties().then(data => {
expect(data.touchable).assertTrue(); expect(data.touchable).assertTrue();
done(); done();
}, (err) => { }, (err) => {
console.log('windowTest setTouchableTest2 getProperties failed: err' + JSON.stringify(err)); console.log('windowTest setTouchableTest1 getProperties failed: err' + JSON.stringify(err));
expect().assertFail(); expect().assertFail();
done(); done();
}) })
}, (err) => { }, (err) => {
console.log('windowTest setTouchableTest2 setTouchable failed: err' + JSON.stringify(err)); console.log('windowTest setTouchableTest1 setTouchable failed: err' + JSON.stringify(err));
expect().assertFail(); expect().assertFail();
done(); done();
}) })
...@@ -2325,7 +2347,7 @@ describe('window_test', function () { ...@@ -2325,7 +2347,7 @@ describe('window_test', function () {
} }
done(); done();
}, (err) => { }, (err) => {
console.log('windowTest setKeepScreenOnTest1 getTopWindow failed: err' + JSON.stringify(err)); console.log('windowTest setKeepScreenOnTest2 getTopWindow failed: err' + JSON.stringify(err));
expect().assertFail(); expect().assertFail();
done(); done();
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册