diff --git a/graphic/BUILD.gn b/graphic/BUILD.gn
index a705da2b2fb9d2f26a93b03c011440b80e0da8ab..1f40d59efdde8def7ba0a4077293f69bcc8c43fa 100755
--- a/graphic/BUILD.gn
+++ b/graphic/BUILD.gn
@@ -1,4 +1,4 @@
-# Copyright (C) 2021 Huawei Device Co., Ltd.
+# Copyright (C) 2022 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
diff --git a/graphic/windowstandard/BUILD.gn b/graphic/windowstandard/BUILD.gn
index f4c711e6742e23fc473536ec15b23a3d1568c04c..41d89977098aea4e7882c833f07c6470f015c486 100755
--- a/graphic/windowstandard/BUILD.gn
+++ b/graphic/windowstandard/BUILD.gn
@@ -1,4 +1,4 @@
-# Copyright (C) 2021 Huawei Device Co., Ltd.
+# Copyright (C) 2022 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
diff --git a/graphic/windowstandard/src/main/js/default/app.js b/graphic/windowstandard/src/main/js/default/app.js
index 1a469fd202c18a1e070e0c088005d5bb68243a13..5f4d3ffd830e4364ac9e516e3830a32b0d19b85a 100755
--- a/graphic/windowstandard/src/main/js/default/app.js
+++ b/graphic/windowstandard/src/main/js/default/app.js
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Copyright (C) 2022 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
diff --git a/graphic/windowstandard/src/main/js/default/pages/index/index.css b/graphic/windowstandard/src/main/js/default/pages/index/index.css
index 6fda792753f2e15f22b529c7b90a82185b2770bf..72baaffcaa675bfe9f3d3d1974690ae7d05c1a4b 100755
--- a/graphic/windowstandard/src/main/js/default/pages/index/index.css
+++ b/graphic/windowstandard/src/main/js/default/pages/index/index.css
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
.container {
flex-direction: column;
justify-content: center;
diff --git a/graphic/windowstandard/src/main/js/default/pages/index/index.hml b/graphic/windowstandard/src/main/js/default/pages/index/index.hml
index f64b040a5ae394dbaa5e185e1ecd4f4556b92184..0053057b5ff7362e00db48887ee1663cffa35988 100755
--- a/graphic/windowstandard/src/main/js/default/pages/index/index.hml
+++ b/graphic/windowstandard/src/main/js/default/pages/index/index.hml
@@ -1,3 +1,19 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
+
{{ $t('strings.hello') }} {{ title }}
diff --git a/graphic/windowstandard/src/main/js/default/pages/index/index.js b/graphic/windowstandard/src/main/js/default/pages/index/index.js
index ca982fbc62e8aa6dfa8f9413b237eb321e79921d..b62903e4fe80f888a5bc0542f5536238b32b3511 100755
--- a/graphic/windowstandard/src/main/js/default/pages/index/index.js
+++ b/graphic/windowstandard/src/main/js/default/pages/index/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Copyright (C) 2022 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
diff --git a/graphic/windowstandard/src/main/js/default/test/List.test.js b/graphic/windowstandard/src/main/js/default/test/List.test.js
index 233bc3ce7ef58a2eda903d72fe19a618a17a59cd..545c0926a2e51fdaecc614bfe9de2387ef22f9e8 100755
--- a/graphic/windowstandard/src/main/js/default/test/List.test.js
+++ b/graphic/windowstandard/src/main/js/default/test/List.test.js
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Copyright (C) 2022 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
diff --git a/graphic/windowstandard/src/main/js/default/test/display.test.js b/graphic/windowstandard/src/main/js/default/test/display.test.js
index 6a7c5ec8e57c036f8129a2c73421dccf414bd508..8dd66c1c73c24af917e7c3f2a299ae8be0dfa47b 100644
--- a/graphic/windowstandard/src/main/js/default/test/display.test.js
+++ b/graphic/windowstandard/src/main/js/default/test/display.test.js
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Copyright (C) 2022 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
@@ -34,9 +34,9 @@ describe('display_test', function () {
* @tc.desc To test the function of obtaining the default screen
*/
it('getDefaultDisplay_Test_001', 0, async function (done) {
- console.log('displayTest getDefaultDisplayTest1 begin')
+ console.log('displayTest getDefaultDisplayTest1 begin');
display.getDefaultDisplay().then(dsp => {
- console.log('displayTest getDefaultDisplayTest1 getDefaultDisplay id :' + JSON.stringify(dsp))
+ console.log('displayTest getDefaultDisplayTest1 getDefaultDisplay id :' + JSON.stringify(dsp));
expect(dsp.id != null).assertTrue();
expect(dsp.refreshRate != null).assertTrue();
expect(dsp.width != null).assertTrue();
@@ -78,9 +78,9 @@ describe('display_test', function () {
* @tc.desc To verify the function of obtaining all screens.
*/
it('getAllDisplay_Test_001', 0, async function (done) {
- console.log('displayTest getAllDisplayTest1 begin')
+ console.log('displayTest getAllDisplayTest1 begin');
display.getAllDisplay().then(dsp => {
- console.log('displayTest getAllDisplayTest1 getAllDisplay id :' + JSON.stringify(dsp))
+ console.log('displayTest getAllDisplayTest1 getAllDisplay id :' + JSON.stringify(dsp));
expect(dsp[0].id != null).assertTrue();
expect(dsp[0].refreshRate != null).assertTrue();
expect(dsp[0].width != null).assertTrue();
@@ -102,11 +102,11 @@ describe('display_test', function () {
console.log('displayTest getAllDisplayTest2 begin');
display.getAllDisplay((err, data) => {
if (err.code != 0) {
- console.log('displayTest getAllDisplayTest2 getAllDisplay callback fail');
+ console.log('displayTest getAllDisplayTest2 getAllDisplay callback fail' + JSON.stringify(err));
expect().assertFail();
done();
} else {
- console.log('displayTest getAllDisplayTest2 getDefaultDisplay id :' + JSON.stringify(data));
+ console.log('displayTest getAllDisplayTest2 getAllDisplay id :' + JSON.stringify(data));
expect(data[0].refreshRate != null).assertTrue();
expect(data[0].width != null).assertTrue();
expect(data[0].height != null).assertTrue();
diff --git a/graphic/windowstandard/src/main/js/default/test/screenshot.test.js b/graphic/windowstandard/src/main/js/default/test/screenshot.test.js
index 8157b1bf248738bc47e7d11f8913e2df9121ea00..beb921871ca636dc8758b41ee4af937a70ce1884 100644
--- a/graphic/windowstandard/src/main/js/default/test/screenshot.test.js
+++ b/graphic/windowstandard/src/main/js/default/test/screenshot.test.js
@@ -1,17 +1,18 @@
/*
- * * Copyright (C) 2022 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.
+ * Copyright (C) 2022 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
- * *
+ *
+ * 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
+ * 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 display from '@ohos.display'
import screenshot from '@ohos.screenshot'
diff --git a/graphic/windowstandard/src/main/js/default/test/window.test.js b/graphic/windowstandard/src/main/js/default/test/window.test.js
index ef9ff09230bd4a831685ff4875790c0da73e2232..090703d546c77e6cb4e4bdd499162b861bb64b0d 100755
--- a/graphic/windowstandard/src/main/js/default/test/window.test.js
+++ b/graphic/windowstandard/src/main/js/default/test/window.test.js
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Copyright (C) 2022 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
@@ -17,6 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
import window from '@ohos.window'
import screen from '@ohos.screen'
const TRUE_WINDOW = true;
+const avoidAreaType = 3;
describe('window_test', function () {
var wnd;
@@ -57,8 +58,7 @@ describe('window_test', function () {
'ABOVE_APP_SYSTEM_WINDOW_END': 2116,
'SYSTEM_WINDOW_END': 2116
}
- var windowCount = 2022;
- var topWindow = null;
+ var topWindow;
const DELAY_TIME = 3000;
var listenerStatus;
@@ -111,7 +111,6 @@ describe('window_test', function () {
}
})
afterEach(function () {
- windowCount++;
})
afterAll(function () {
})
@@ -172,6 +171,10 @@ describe('window_test', function () {
done();
}
})
+ }, (err) => {
+ console.log('windowTest getPropertiesTest2 window.getTopWindow failed, err : ' + JSON.stringify(err));
+ expect().assertFail();
+ done();
})
})
@@ -243,7 +246,7 @@ describe('window_test', function () {
window.getTopWindow().then(wnd => {
console.log('windowTest getAvoidAreaTest3 window.getTopWindow wnd: ' + wnd);
expect(wnd != null).assertTrue();
- wnd.getAvoidArea(3).then((data) => {
+ wnd.getAvoidArea(avoidAreaType).then((data) => {
console.log('windowTest getAvoidAreaTest3 wnd.getAvoidArea success, data :' + JSON.stringify(data));
expect(data.rightRect != null).assertTrue();
expect(data.topRect != null).assertTrue();
@@ -329,7 +332,7 @@ describe('window_test', function () {
window.getTopWindow().then(wnd => {
console.log('windowTest getAvoidAreaTest6 window.getTopWindow wnd: ' + wnd);
expect(wnd != null).assertTrue();
- wnd.getAvoidArea(3, (err, data) => {
+ wnd.getAvoidArea(avoidAreaType, (err, data) => {
if (err.code != 0) {
console.log('windowTest getAvoidAreaTest6 wnd.getAvoidArea callback fail' + JSON.stringify(err));
expect().assertFail();
@@ -496,7 +499,7 @@ describe('window_test', function () {
})
/**
- * @tc.number SUB_WMS_SETLAYOUTFULLSCREEN_JSAPI_001
+ * @tc.number SUB_WMS_SETLAYOUTFULLSCREEN_JSAPI_002
* @tc.name Test setLayoutFullScreen_Test_002
* @tc.desc Set window and layout to full screen.
*/
@@ -925,10 +928,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_ONOFF_JSAPI_001
- * @tc.name Test OnOff_Test_001.
+ * @tc.name Test onOff_Test_001.
* @tc.desc To verify the function of enabling and disabling intercepting when the window size changes.
*/
- it('OnOff_Test_001', 0, async function (done) {
+ it('onOff_Test_001', 0, async function (done) {
console.log('windowTest OnOffTest1 begin');
window.getTopWindow((err, data) => {
if (err.code != 0) {
@@ -969,10 +972,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_ONOFF_JSAPI_002
- * @tc.name Test OnOff_Test_002
+ * @tc.name Test onOff_Test_002
* @tc.desc To verify the function of enabling and disabling lawful interception in the system and window
*/
- it('OnOff_Test_002', 0, async function (done) {
+ it('onOff_Test_002', 0, async function (done) {
console.log('windowTest OnOffTest2 begin')
window.getTopWindow((err, data) => {
if (err.code != 0) {
@@ -1013,10 +1016,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_ISSHOWING_JSAPI_001
- * @tc.name Test IsShowing_Test_001.
+ * @tc.name Test isShowing_Test_001.
* @tc.desc To verify the function of obtaining the display status when a window is hidden and then displayed.
*/
- it('IsShowing_Test_001', 0, async function (done) {
+ it('isShowing_Test_001', 0, async function (done) {
console.log('windowTest IsShowingTest1 begin');
window.create('isShow1', window.WindowType.TYPE_APP).then(wnd => {
expect(wnd != null).assertTrue();
@@ -1054,10 +1057,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_ISSHOWING_JSAPI_002
- * @tc.name Test IsShowing_Test_002.
+ * @tc.name Test isShowing_Test_002.
* @tc.desc To verify the function of obtaining the display status when a window is hidden and then displayed.
*/
- it('IsShowing_Test_002', 0, async function (done) {
+ it('isShowing_Test_002', 0, async function (done) {
console.log('windowTest IsShowingTest2 begin');
window.create('isShow2', window.WindowType.TYPE_APP, (err, data) => {
if (err.code) {
@@ -1086,7 +1089,6 @@ describe('window_test', function () {
done();
} else {
expect(res2).assertTrue();
- done();
data.destroy((err) => {
if (err.code) {
console.log('windowTest IsShowingTest2 data.show fail err ' + JSON.stringify(err));
@@ -1109,10 +1111,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_SETCOLORSPACE_JSAPI_001
- * @tc.name Test SetColorSpace_Test_001
+ * @tc.name Test setColorSpace_Test_001
* @tc.desc To verify the setting of the wide color gamut color space
*/
- it('SetColorSpace_Test_001', 0, async function (done) {
+ it('setColorSpace_Test_001', 0, async function (done) {
console.log('windowTest SetColorSpaceTest1 begin');
window.getTopWindow().then(wnd => {
console.log('windowTest SetColorSpaceTest1 wnd: ' + wnd);
@@ -1149,10 +1151,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_SETCOLORSPACE_JSAPI_002
- * @tc.name Test SetColorSpace_Test_002
+ * @tc.name Test setColorSpace_Test_002
* @tc.desc To verify that the color space of invaild values is set successfully
*/
- it('SetColorSpace_Test_002', 0, async function (done) {
+ it('setColorSpace_Test_002', 0, async function (done) {
console.log('windowTest SetColorSpaceTest2 begin');
window.getTopWindow().then(wnd => {
console.log('windowTest SetColorSpaceTest2 wnd: ' + wnd);
@@ -1175,10 +1177,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_SETCOLORSPACE_JSAPI_003
- * @tc.name Test SetColorSpace_Test_003
+ * @tc.name Test setColorSpace_Test_003
* @tc.desc To verify the setting of the wide color gamut color space
*/
- it('SetColorSpace_Test_003', 0, async function (done) {
+ it('setColorSpace_Test_003', 0, async function (done) {
console.log('windowTest SetColorSpaceTest3 begin');
window.getTopWindow().then(wnd => {
console.log('windowTest SetColorSpaceTest3 wnd: ' + wnd);
@@ -1219,10 +1221,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_SETCOLORSPACE_JSAPI_004
- * @tc.name Test SetColorSpace_Test_004
+ * @tc.name Test setColorSpace_Test_004
* @tc.desc To verify that the color space of invalid values is set successfully
*/
- it('SetColorSpace_Test_004', 0, async function (done) {
+ it('setColorSpace_Test_004', 0, async function (done) {
console.log('windowTest SetColorSpaceTest4 begin');
window.getTopWindow().then(wnd => {
console.log('windowTest SetColorSpaceTest4 wnd: ' + wnd);
@@ -1247,10 +1249,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_CREATE_JSAPI_001
- * @tc.name Test Create_Test_001.
+ * @tc.name Test create_Test_001.
* @tc.desc To verify the function of creating an application subwindow.
*/
- it('Create_Test_001', 0, async function (done) {
+ it('create_Test_001', 0, async function (done) {
console.log('windowTest CreateTest1 begin');
window.create('subWindow', window.WindowType.TYPE_APP).then(wnd => {
console.log('windowTest CreateTest1 create success wnd' + wnd);
@@ -1265,10 +1267,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_CREATE_JSAPI_001
- * @tc.name Test Create_Test_002
+ * @tc.name Test create_Test_002
* @tc.desc To verify the function of creating an application subwindow
*/
- it('Create_Test_002', 0, async function (done) {
+ it('create_Test_002', 0, async function (done) {
console.log('windowTest CreateTest2 begin');
window.create('subWindow1', window.WindowType.TYPE_APP, (err, data) => {
if (err.code != 0) {
@@ -1285,10 +1287,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_DESTROY_JSAPI_001
- * @tc.name Test Destroy_Test_001
+ * @tc.name Test destroy_Test_001
* @tc.desc Verify that a window is destroyed after being created
*/
- it('Destroy_Test_001', 0, async function (done) {
+ it('destroy_Test_001', 0, async function (done) {
console.log('windowTest DestroyTest1 begin');
window.create('subWindow2', window.WindowType.TYPE_APP).then(wnd => {
console.log('windowTest DestroyTest1 create success wnd' + wnd);
@@ -1318,10 +1320,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_DESTROY_JSAPI_002
- * @tc.name Test Destroy_Test_002
+ * @tc.name Test destroy_Test_002
* @tc.desc Verify that a window is destroyed after being created
*/
- it('Destroy_Test_002', 0, async function (done) {
+ it('destroy_Test_002', 0, async function (done) {
console.log('windowTest DestroyTest2 begin');
window.create('subWindow2', window.WindowType.TYPE_APP, (err, data) => {
if (err.code != 0) {
@@ -1356,10 +1358,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_SETSYSTEMBARENABLE_JSAPI_001
- * @tc.name Test SetSystemBarEnable_Test_001
+ * @tc.name Test setSystemBarEnable_Test_001
* @tc.desc To verify the function of setting a scenario that is visible to the system bar
*/
- it('SetSystemBarEnable_Test_001', 0, async function (done) {
+ it('setSystemBarEnable_Test_001', 0, async function (done) {
console.log('windowTest SetSystemBarEnableTest1 begin');
var names = ["status", "navigation"];
window.getTopWindow().then(wnd => {
@@ -1389,10 +1391,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_SETSYSTEMBARENABLE_JSAPI_002
- * @tc.name Test SetSystemBarEnable_Test_002
+ * @tc.name Test setSystemBarEnable_Test_002
* @tc.desc To verify the function of setting a scenario that is visible to the system bar
*/
- it('SetSystemBarEnable_Test_002', 0, async function (done) {
+ it('setSystemBarEnable_Test_002', 0, async function (done) {
console.log('windowTest SetSystemBarEnableTest2 begin');
var names = ["status", "navigation"];
window.getTopWindow((err, data) => {
@@ -1419,10 +1421,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_SETSYSTEMBARPROPERTIES_JSAPI_001
- * @tc.name Test SetSystemBarProperties_Test_001
+ * @tc.name Test setSystemBarProperties_Test_001
* @tc.desc To verify the function of setting system bar attributes
*/
- it('SetSystemBarProperties_Test_001', 0, async function (done) {
+ it('setSystemBarProperties_Test_001', 0, async function (done) {
console.log('windowTest SetSystemBarPropertiesTest1 begin');
var SystemBarProperties = {
statusBarColor: '#ff00ff',
@@ -1453,10 +1455,10 @@ describe('window_test', function () {
/**
* @tc.number SUB_WMS_SETSYSTEMBARPROPERTIES_JSAPI_002
- * @tc.name Test SetSystemBarProperties_Test_002
+ * @tc.name Test setSystemBarProperties_Test_002
* @tc.desc To verify the function of setting system bar attributes
*/
- it('SetSystemBarProperties_Test_002', 0, async function (done) {
+ it('setSystemBarProperties_Test_002', 0, async function (done) {
console.log('windowTest SetSystemBarPropertiesTest2 begin');
var SystemBarProperties = {
statusBarColor: '#ff00ff',
@@ -1928,7 +1930,8 @@ describe('window_test', function () {
done();
})
}, (err) => {
- console.log('screenshotTest getActiveModeTest1 failed: err: ' + JSON.stringify(err))
+ console.log('screenshotTest setScreenActiveModeTest1 failed: err: ' + JSON.stringify(err));
+ done();
})
})