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

!3421 misc锁屏、壁纸用例

Merge pull request !3421 from 高曦/master
...@@ -20,5 +20,7 @@ group("miscservices") { ...@@ -20,5 +20,7 @@ group("miscservices") {
"TimeTest_js:ActsTimeJSApiTest", "TimeTest_js:ActsTimeJSApiTest",
"TimerTest_js:ActsTimerJSApiTest", "TimerTest_js:ActsTimerJSApiTest",
"actspasteboardjsapitest:ActsPasteBoardJSApiTest", "actspasteboardjsapitest:ActsPasteBoardJSApiTest",
"screenlock_js:ActsScreenLockJSApiTest",
"wallpaper_js:ActsWallpaperJSApiTest",
] ]
} }
...@@ -17,7 +17,6 @@ import inputmethodEngineJsunit from './InputmethodEngineJsunit.test.ets'; ...@@ -17,7 +17,6 @@ import inputmethodEngineJsunit from './InputmethodEngineJsunit.test.ets';
import inputRequestJsunit from './InputRequestJsunit.test.ets'; import inputRequestJsunit from './InputRequestJsunit.test.ets';
import requestJsunit from './RequestJsunit.test.ets'; import requestJsunit from './RequestJsunit.test.ets';
import requestDownloadJsunit from './RequestDownloadTaskJsunit.test.ets'; import requestDownloadJsunit from './RequestDownloadTaskJsunit.test.ets';
import screenLockJsunit from './ScreenLockJsunit.test.ets';
export default function testsuite() { export default function testsuite() {
inputmethohJsunit(); inputmethohJsunit();
...@@ -25,5 +24,4 @@ export default function testsuite() { ...@@ -25,5 +24,4 @@ export default function testsuite() {
inputRequestJsunit(); inputRequestJsunit();
requestDownloadJsunit(); requestDownloadJsunit();
requestJsunit(); requestJsunit();
screenLockJsunit();
} }
\ No newline at end of file
// @ts-nocheck
/**
* 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, it, expect} from 'hypium/index';
import screenLock from '@ohos.screenLock';
export default function screenLockJsunit() {
describe('screenLockTest', function () {
console.log("************* screenLock Test start*************");
/*
* @tc.number : MiscServices_ScreenLock_isScreenLocked_0100
* @tc.name : isScreenLocked
* @tc.desc : Checks whether the screen is currently locked.
*/
it('MiscServices_ScreenLock_isScreenLocked_0100', 0, async function (done) {
let caseName = "MiscServices_ScreenLock_isScreenLocked_0100";
try {
screenLock.isScreenLocked((error, data) => {
if (error) {
console.error(caseName + 'Operation failed. Cause:' + JSON.stringify(error));
return;
}
console.info(caseName + 'Operation successful. Data: ' + JSON.stringify(data));
expect(true).assertTrue();
done();
})
} catch (err) {
console.info(caseName + 'catch error: ' + err);
expect(true).assertTrue();
done();
}
done();
});
/*
* @tc.number : MiscServices_ScreenLock_isScreenLocked_0200
* @tc.name : isScreenLocked
* @tc.desc : Checks whether the screen is currently locked.
*/
it('MiscServices_ScreenLock_isScreenLocked_0200', 0, async function (done) {
let caseName = "MiscServices_ScreenLock_isScreenLocked_0200";
try {
screenLock.isScreenLocked().then((data) => {
console.info(caseName + 'Operation successful. Data: ' + JSON.stringify(data));
expect(true).assertTrue();
done();
}).catch((error) => {
console.error(caseName + 'Operation failed. Cause: ' + JSON.stringify(error));
done();
})
} catch (err) {
console.info(caseName + 'catch error: ' + err);
expect(true).assertTrue();
done();
}
done();
});
/*
* @tc.number : MiscServices_ScreenLock_isSecureMode_0100
* @tc.name : isSecureMode
* @tc.desc : Checks whether the screen lock of the current device is secure.
*/
it('MiscServices_ScreenLock_isSecureMode_0100', 0, async function (done) {
let caseName = "MiscServices_ScreenLock_isSecureMode_0100";
try {
screenLock.isSecureMode((error, data) => {
if (error) {
console.error(caseName + 'Operation failed. Cause:' + JSON.stringify(error));
return;
}
console.info(caseName + 'Operation successful. Data: ' + JSON.stringify(data));
expect(true).assertTrue();
done();
})
} catch (err) {
console.info(caseName + 'catch error: ' + err);
expect(true).assertTrue();
done();
}
done();
});
/*
* @tc.number : MiscServices_ScreenLock_isSecureMode_0200
* @tc.name : isSecureMode
* @tc.desc : Checks whether the screen lock of the current device is secure.
*/
it('MiscServices_ScreenLock_isSecureMode_0200', 0, async function (done) {
let caseName = "MiscServices_ScreenLock_isSecureMode_0200";
try {
screenLock.isSecureMode().then((data) => {
console.info(caseName + 'Operation successful. Data: ' + JSON.stringify(data));
expect(true).assertTrue();
done();
}).catch((error) => {
console.error(caseName + 'Operation failed. Cause: ' + JSON.stringify(error));
done();
})
} catch (err) {
console.info(caseName + 'catch error: ' + err);
expect(true).assertTrue();
done();
}
done();
});
/*
* @tc.number : MiscServices_ScreenLock_unlockScreen_0100
* @tc.name : unlockScreen
* @tc.desc : Unlocks the screen.
*/
it('MiscServices_ScreenLock_unlockScreen_0100', 0, async function (done) {
let caseName = "MiscServices_ScreenLock_unlockScreen_0100"
try {
screenLock.unlockScreen((error, data) => {
if (error) {
console.error(caseName + 'Operation failed. Cause:' + JSON.stringify(error));
return;
}
console.info(caseName + 'Operation successful. Data: ' + JSON.stringify(data));
expect(true).assertTrue();
done();
})
} catch (err) {
console.info(caseName + 'catch error: ' + err);
expect(true).assertTrue();
done();
}
done();
});
/*
* @tc.number : MiscServices_ScreenLock_unlockScreen_0200
* @tc.name : unlockScreen
* @tc.desc : Unlocks the screen.
*/
it('MiscServices_ScreenLock_unlockScreen_0200', 0, async function (done) {
let caseName = "MiscServices_ScreenLock_unlockScreen_0200";
try {
screenLock.unlockScreen().then((data) => {
console.info(caseName + 'Operation successful. Data: ' + JSON.stringify(data));
expect(true).assertTrue();
done();
}).catch((error) => {
console.error(caseName + 'Operation failed. Cause: ' + JSON.stringify(error));
done();
})
} catch (err) {
console.info(caseName + 'catch error: ' + err);
expect(true).assertTrue();
done();
}
done();
});
}
\ No newline at end of file
# 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsScreenLockJSApiTest") {
hap_profile = "./src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsScreenLockJSApiTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for screenlock js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "600000",
"package": "com.ohos.screenlock",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsScreenLockJSApiTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.ohos.screenlock",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 8,
"target": 8,
"releaseType": "Release"
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.screenlock",
"name": ".MyApplication",
"deviceType": [
"phone",
"tablet",
"tv",
"wearable"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "com.ohos.screenlock.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
/*
* 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
/*
* 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
background-color: green;
color: #000000;
opacity: 0.9;
}
.button{
margin-top: 50px;
background-color: green;
font-size: 25px;
color: white;
padding: 10px;
}
<!--
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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* 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 app from '@system.app'
import file from '@system.file'
import {Core} from 'deccjsunit/index'
export default {
data: {title: ""},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
}
\ No newline at end of file
/*
* 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.
*/
require('./screenlock_service_test.js');
require('./screenlock_service_test_promise.js');
// @ts-nocheck
/*
* 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 screenLock from '@ohos.app.screenlockability';
import {describe, expect, it} from 'deccjsunit/index'
const SLEEP_TIME = 1000;
describe('ScreenLockServicePromiseTest', function () {
console.log("-----------------------ScreenlockPromiseTest is starting-----------------------");
function sleep(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
return;
}
}
/*
* @tc.number ScreenLock_Test_Promise_0100
* @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test
* @tc.level 0
*/
it("ScreenLock_Test_Promise_0100", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0100-------------------");
var isScreenLocked = true;
try {
screenLock.test_setScreenLocked(isScreenLocked).then((data) => {
console.log("ScreenLock_Test_Promise_0100 test_setScreenLocked result is " + data);
expect(data == true).assertTrue();
screenLock.isScreenLocked().then((data) => {
console.log("ScreenLock_Test_Promise_0100 isScreenLocked result is " + data);
expect(data == true).assertTrue();
done();
})
})
} catch (error) {
console.log("ScreenLock_Test_Promise_0100 test_setScreenLocked : error = " + error);
expect(true).assertTrue();
done();
}
console.info("------------------end ScreenLock_Test_Promise_0100-------------------");
});
/*
* @tc.number ScreenLock_Test_Promise_0200
* @tc.name Set to unlocked screen, query the lock screen state is unlocked state
* @tc.desc Function test
* @tc.level 0
*/
it("ScreenLock_Test_Promise_0200", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0200-------------------");
var isScreenLocked = false;
try {
screenLock.test_setScreenLocked(isScreenLocked).then((data) => {
console.log("ScreenLock_Test_Promise_0200 test_setScreenLocked result is " + data);
expect(data == true).assertTrue();
screenLock.isScreenLocked().then((data) => {
console.log("ScreenLock_Test_Promise_0200 isScreenLocked result is " + data);
expect(data == false).assertTrue();
done();
});
});
} catch (error) {
console.log("ScreenLock_Test_Promise_0200 test_setScreenLocked : error = " + error);
expect(true).assertTrue();
done();
}
console.info("------------------end ScreenLock_Test_Promise_0200-------------------");
});
/*
* @tc.number ScreenLock_Test_Promise_0300
* @tc.name Query whether a password has been set, and return the password that has not been set
* @tc.desc Function test
* @tc.level 0
*/
it("ScreenLock_Test_Promise_0300", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0300-------------------");
try {
screenLock.isSecureMode().then((data) => {
console.log("ScreenLock_Test_Promise_0300 isScreenLocked result is " + data);
expect(data == false).assertTrue();
done();
});
} catch (error) {
console.log("ScreenLock_Test_Promise_0300 isScreenLocked TRUE: error = " + error);
expect(true).assertTrue();
done();
}
console.info("------------------end ScreenLock_Test_Promise_0300-------------------");
});
/*
* @tc.number ScreenLock_Test_Promise_0400
* @tc.name Request to unlock the device screen, unlock successfully
* @tc.desc Function test
* @tc.level 0
*/
it("ScreenLock_Test_Promise_0400", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0400-------------------");
try {
var isScreenLocked = true;
screenLock.test_setScreenLocked(isScreenLocked).then((data) => {
console.log("ScreenLock_Test_Promise_0400: test_setScreenLocked1 " + data + " result is successfull");
});
sleep(SLEEP_TIME);
screenLock.unlockScreen().then(() => {
console.log("ScreenLock_Test_Promise_0400: send unlockScreen issue success");
});
sleep(SLEEP_TIME);
var unlockScreenResult = 0;
var eventType = 'unlockScreenResult';
screenLock.sendScreenLockEvent(eventType, unlockScreenResult).then((data) => {
console.log("ScreenLock_Test_Promise_0400: sendScreenLockEvent result is " + data);
expect(data == true).assertTrue();
});
sleep(SLEEP_TIME);
screenLock.isScreenLocked().then((data) => {
console.log("ScreenLock_Test_Promise_0400: isScreenLocked result is " + data);
expect(data == false).assertTrue();
});
sleep(SLEEP_TIME);
screenLock.test_setScreenLocked(isScreenLocked).then((data) => {
console.log("ScreenLock_Test_Promise_0400: test_setScreenLocked2 " + data + " result is successfull");
done();
});
} catch (error) {
console.info("Screenlock_Test_1400: error = " + error);
expect(true).assertTrue();
done();
}
console.info("------------------end ScreenLock_Test_Promise_0400-------------------");
});
/*
* @tc.number ScreenLock_Test_Promise_0500
* @tc.name Request to unlock device screen, unlock failed
* @tc.desc Function test
* @tc.level 0
*/
it("ScreenLock_Test_Promise_0500", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0500-------------------");
try {
var isScreenLocked = true;
screenLock.test_setScreenLocked(isScreenLocked).then((data) => {
console.log("ScreenLock_Test_Promise_0500: test_setScreenLocked " + data + " result is successfull");
});
sleep(SLEEP_TIME);
screenLock.unlockScreen().then(() => {
console.log("ScreenLock_Test_Promise_0500: send unlockScreen issue success");
});
sleep(SLEEP_TIME);
var unlockScreenResult = 1;
var eventType = 'unlockScreenResult';
screenLock.sendScreenLockEvent(eventType, unlockScreenResult).then((data) => {
console.log("ScreenLock_Test_Promise_0500: sendScreenLockEvent result is " + data);
expect(data == true).assertTrue();
});
sleep(SLEEP_TIME);
screenLock.isScreenLocked().then((data) => {
console.log("ScreenLock_Test_Promise_0500: isScreenLocked result is " + data);
expect(data == true).assertTrue();
done();
});
} catch (error) {
console.info("logMessage ScreenLock_Test_Promise_0500: error = " + error);
expect(true).assertTrue();
done();
}
console.info("------------------end ScreenLock_Test_Promise_0500-------------------");
});
})
\ No newline at end of file
{
"string": [
{
"name": "entry_MainAbility",
"value": "screenLock"
},
{
"name": "mainability_description",
"value": "JS_Empty screenLock"
}
]
}
\ No newline at end of file
# 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsWallpaperJSApiTest") {
hap_profile = "./src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsWallpaperJSApiTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for wallpaper js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "600000",
"package": "com.xts.wpxts",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsWallpaperJSApiTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.xts.wpxts",
"vendor": "xts",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 8,
"target": 8,
"releaseType": "Release"
}
},
"deviceConfig": {},
"module": {
"package": "com.xts.wpxts",
"name": ".MyApplication",
"deviceType": [
"phone",
"tablet",
"tv",
"wearable"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "com.xts.wpxts.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
],
"reqPermissions": [
{
"name": "ohos.permission.SET_WALLPAPER"
},
{
"name": "ohos.permission.GET_WALLPAPER"
},
{
"name": "ohos.permission.READ_USER_STORAGE"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
/*
* 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.
*/
require("./Wallpaper/WallpaperJsunit.test.js")
\ No newline at end of file
/*
* 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
/*
* 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<!--
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 th`e specific language governing permissions and
limitations under the License.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* 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 {Core, ExpectExtend} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
console.log("test start")
require('../../../Test/List.test.js')
core.execute()
this.title = this.$t('strings.start');
console.log("test end")
},
onReady() {
}
}
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册