提交 d7307120 编写于 作者: 耿文广

新增校验fingerprint字段的XTS用例

Signed-off-by: N耿文广 <gengwenguang@huawei.com>
......@@ -31,6 +31,7 @@ group("aafwk_standard") {
"amsdisplayIdtest:amsdisplayIdtest",
"amsgetabilityprocessinfo:amsgetabilityprocessinfo",
"context:context",
"fa:fa",
"featureability:featureability",
"formmanager:formmanager",
"killprocesswithaccountstage:killprocesswithaccountstage",
......
......@@ -24,7 +24,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_GetIdSync_0100', 0, function (done) {
console.log('dataUriUtils getIdSync start1');
var result = dataUriUtils.getIdSync("com.ix.dataUriUtils/1221");
var result = dataUriUtils.getId("com.ix.dataUriUtils/1221");
console.log('dataUriUtils getIdSync URI : ' + result);
expect(typeof(result)).assertEqual("number");
......@@ -40,7 +40,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_GetIdSync_0200', 0, function (done) {
console.log('dataUriUtils getIdSync start2 ');
var result = dataUriUtils.getIdSync("com.ix.dataUriUtils1221");
var result = dataUriUtils.getId("com.ix.dataUriUtils1221");
console.log('dataUriUtils getIdSync URI : ' + result);
expect(typeof(result)).assertEqual("number");
......@@ -57,7 +57,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_GetIdSync_0300', 0, function (done) {
console.log('dataUriUtils getIdSync start3 ');
var result = dataUriUtils.getIdSync("com.ix.dataUriUtils/11234567890");
var result = dataUriUtils.getId("com.ix.dataUriUtils/11234567890");
console.log('dataUriUtils getIdSync URI : ' + result);
expect(typeof(result)).assertEqual("number");
......@@ -74,7 +74,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_GetIdSync_0400', 0, function (done) {
console.log('dataUriUtils getIdSync start4 ');
var result = dataUriUtils.getIdSync("com.ix.dataUriUtils");
var result = dataUriUtils.getId("com.ix.dataUriUtils");
console.log('dataUriUtils getIdSync URI : ' + result);
expect(typeof(result)).assertEqual("number");
......@@ -91,7 +91,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_GetIdSync_0500', 0, function (done) {
console.log('dataUriUtils getIdSync start5 ');
var result = dataUriUtils.getIdSync("com.ix.dataUriUtils/-777");
var result = dataUriUtils.getId("com.ix.dataUriUtils/-777");
console.log('dataUriUtils getIdSync URI : ' + result);//-777
expect(typeof(result)).assertEqual("number");
......@@ -109,7 +109,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_AttachIdSync_0100',0, function (done) {
console.log('dataUriUtils attachIdSync start1 ');
var idint = 1122;
var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils",idint);
var result = dataUriUtils.attachId("com.ix.dataUriUtils",idint);
console.log('dataUriUtils attachIdSync URI :' + result)
expect(typeof(result)).assertEqual("string");
......@@ -127,7 +127,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_AttachIdSync_0200',0, function (done) {
console.log('dataUriUtils attachIdSync start2 ');
var idint = 0;
var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils/777",idint);
var result = dataUriUtils.attachId("com.ix.dataUriUtils/777",idint);
console.log('dataUriUtils attachIdSync URI :' + result)
expect(typeof(result)).assertEqual("string");
......@@ -145,7 +145,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_AttachIdSync_0300',0, function (done) {
console.log('dataUriUtils attachIdSync start3 ');
var idint = 456789;
var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils/123",idint);
var result = dataUriUtils.attachId("com.ix.dataUriUtils/123",idint);
console.log('dataUriUtils attachIdSync URI :' + result)
expect(typeof(result)).assertEqual("string");
......@@ -163,7 +163,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_AttachIdSync_0400',0, function (done) {
console.log('dataUriUtils attachIdSync start4 ');
var idint = 123456789011;
var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils",idint);
var result = dataUriUtils.attachId("com.ix.dataUriUtils",idint);
console.log('dataUriUtils attachIdSync URI :' + result)
expect(typeof(result)).assertEqual("string");
......@@ -181,7 +181,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_AttachIdSync_0500',0, function (done) {
console.log('dataUriUtils attachIdSync start5 ');
var idint = -1;
var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils",idint);
var result = dataUriUtils.attachId("com.ix.dataUriUtils",idint);
console.log('dataUriUtils attachIdSync URI :' + result)
expect(typeof(result)).assertEqual("string");
......@@ -198,7 +198,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_DeleteIdSync_0100',0, function (done) {
console.log('dataUriUtils deleteIdSync start1 ');
var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils");
var result = dataUriUtils.deleteId("com.ix.dataUriUtils");
console.log('dataUriUtils deleteIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -215,7 +215,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_DeleteIdSync_0200',0, function (done) {
console.log('dataUriUtils deleteIdSync start2 ');
var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils/1122");
var result = dataUriUtils.deleteId("com.ix.dataUriUtils/1122");
console.log('dataUriUtils deleteIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -232,7 +232,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_DeleteIdSync_0300',0, function (done) {
console.log('dataUriUtils deleteIdSync start3 ');
var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils1122");
var result = dataUriUtils.deleteId("com.ix.dataUriUtils1122");
console.log('dataUriUtils deleteIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -249,7 +249,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_DeleteIdSync_0400',0, function (done) {
console.log('dataUriUtils deleteIdSync start4 ');
var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils/-1");
var result = dataUriUtils.deleteId("com.ix.dataUriUtils/-1");
console.log('dataUriUtils deleteIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -266,7 +266,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_DeleteIdSync_0500',0, function (done) {
console.log('dataUriUtils deleteIdSync start5 ');
var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils/1122/2211");
var result = dataUriUtils.deleteId("com.ix.dataUriUtils/1122/2211");
console.log('dataUriUtils deleteIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -284,7 +284,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_UpdateIdSync_0100',0, function (done) {
console.log('dataUriUtils updateIdSync start1 ');
var idint = 1122;
var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils",idint);
var result = dataUriUtils.updateId("com.ix.dataUriUtils",idint);
console.log('updateIdSync updateIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -302,7 +302,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_UpdateIdSync_0200',0, function (done) {
console.log('dataUriUtils updateIdSync start2 ');
var idint = 1122;
var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils/",idint)
var result = dataUriUtils.updateId("com.ix.dataUriUtils/",idint)
console.log('updateIdSync updateIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -320,7 +320,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_UpdateIdSync_0300',0, function (done) {
console.log('dataUriUtils updateIdSync start3 ');
var idint = 3344;
var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils/-1",idint)
var result = dataUriUtils.updateId("com.ix.dataUriUtils/-1",idint)
console.log('updateIdSync updateIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -338,7 +338,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_UpdateIdSync_0400',0, function (done) {
console.log('dataUriUtils updateIdSync start4 ');
var idint = 5566;
var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils/123456789011",idint)
var result = dataUriUtils.updateId("com.ix.dataUriUtils/123456789011",idint)
console.log('updateIdSync updateIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -360,7 +360,7 @@ describe('ActsDataUriUtilsTest', function () {
expect(typeof(idint)).assertEqual("number");
console.log('dataUriUtils updateIdSync start666 ');
var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils/1122",idint)
var result = dataUriUtils.updateId("com.ix.dataUriUtils/1122",idint)
console.log('updateIdSync updateIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
expect(result).assertEqual("com.ix.dataUriUtils/0");
......
# 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")
group("fa") {
testonly = true
if (is_standard_system) {
deps = [
"faapplicationinfo:ActsApplicationinfoTest",
"faconfigurationconstant:ActsConfigurationconstantTest",
"facoverapi:ActsCoverapiTest",
"faequeryabilitybywant:ActsEqueryabilitybywantTest",
]
}
}
# 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("ActsApplicationinfoTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsApplicationinfoTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js"
hap_profile = "entry/src/main/config.json"
js2abc = true
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "com.example.applicationinfo",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsApplicationinfoTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.applicationinfo",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.applicationinfo",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"srcPath": "MainAbility2",
"name": ".MainAbility2",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability2",
"formsEnabled": false,
"label": "$string:entry_MainAbility2",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index"
],
"name": ".MainAbility2",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ 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("Application onCreate");
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }} {{text}}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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} from 'deccjsunit/index'
export default {
data: {
title: "",
text: ""
},
onInit() {
this.title = this.$t('strings.world');
this.text = "MainAbility 1111"
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test.js')
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.
*/
export default {
onCreate() {
console.info("ApplicationMainAbility2 onCreate");
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 commonEvent from '@ohos.commonEvent'
import featureAbility from '@ohos.ability.featureAbility'
let event = ''
let commonEventPublishData = ''
function PublishCallBackOne() {
console.info("====>Publish CallBack SUB_AA_OpenHarmony_Want_0200_CommonEvent====>");
}
function PublishCallBackTwo() {
console.info("====>Publish CallBack SUB_AA_OpenHarmony_Want_0300_CommonEvent====>");
}
export default {
data: {
title: ''
},
onInit() {
this.title = this.$t('strings.world ApplicationMainAbility2');
},
onShow() {
console.info('======Start MainAbility2 onShow======');
featureAbility.getWant(
(err, data) => {
if (data.uri == '{true,true,false}'){
console.info("SUB_AA_OpenHarmony_Want_0200_StartAbility" + JSON
.stringify(data) + JSON.stringify(err));
event = data.uri
commonEventPublishData = {
data: event,
}
commonEvent.publish('SUB_AA_OpenHarmony_Want_0200_CommonEvent',
commonEventPublishData, PublishCallBackOne);
}
if (data.type == 'MIMETYPE'){
console.info("SUB_AA_OpenHarmony_Want_0300_StartAbility" + JSON
.stringify(data) + JSON.stringify(err));
event = data.type
commonEventPublishData = {
data: event,
}
commonEvent.publish('SUB_AA_OpenHarmony_Want_0300_CommonEvent',
commonEventPublishData, PublishCallBackTwo);
}
}
)
},
onReady() {
console.info('ApplicationInfo MainAbility2 onReady');
},
}
\ No newline at end of file
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "description_mainability",
"value": "JS_Empty Ability"
},
{
"name": "description_mainability2",
"value": "JS_Empty Ability"
},
{
"name": "entry_MainAbility2",
"value": "entry_MainAbility2"
}
]
}
\ No newline at end of file
/*
* 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.
*/
import commonEvent from '@ohos.commonevent'
import featureAbility from '@ohos.ability.featureability'
import formBindingData from '@ohos.application.formBindingData'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
var getCallingBundleUri = {
events: ['SUB_AA_OpenHarmony_Want_0200_CommonEvent']
}
var getCallingBundleType = {
events: ['SUB_AA_OpenHarmony_Want_0300_CommonEvent']
}
describe('ApplicationInfoTest', function () {
var TAG = '';-
/*
* @tc.number SUB_AA_OpenHarmony_FormBase_1000
* @tc.name Validate formbindingdata creation data
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_FormBase_1000', 0, async function (done) {
console.info('------------start SUB_AA_OpenHarmony_FormBase_1000-------------');
TAG = 'SUB_AA_OpenHarmony_FormBase_1000';
var dataObj = {
temperature:"11c",
"time":"11:00",
"test":11,
"test3":true
}
var result = formBindingData.createFormBindingData(dataObj)
console.log(TAG + " result is : " + JSON.stringify(result))
expect(JSON.stringify(result)).
assertEqual(JSON.stringify({"data":"{\"temperature\":\"11c\",\"time\":\"11:00\",\"test\":11,\"test3\":true}"}));
done();
console.info('------------end SUB_AA_OpenHarmony_FormBase_1000-------------');
});
/*
* @tc.number SUB_AA_OpenHarmony_Want_0200
* @tc.name Switching the mission in the launcherlist to the foreground is not supported
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_Want_0200', 0, async function (done) {
console.info('------------start SUB_AA_OpenHarmony_Want_0200-------------');
TAG = 'SUB_AA_OpenHarmony_Want_0200';
var Subscriber = '';
function SubscribeCallBackUri(err, data) {
console.info(TAG + ' Subscribe CallBack data:' + JSON.stringify(data) + JSON.stringify(err));
expect(data.data == '{true,true,false}').assertTrue();
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
done();
}
function UnSubscribeCallback() {
console.debug(TAG + "====>UnSubscribe CallBack====>");
done();
}
commonEvent.createSubscriber(getCallingBundleUri).then(async (data) => {
console.info(TAG + '====>Create Subscriber====');
Subscriber = data;
console.info(TAG + '====>Create Subscriber====' + JSON.stringify(data) );
await commonEvent.subscribe(Subscriber, SubscribeCallBackUri);
});
featureAbility.startAbility({
want: {
abilityName: 'com.example.applicationinfo.MainAbility2',
bundleName: 'com.example.applicationinfo',
uri: '{true,true,false}'
}
}, (err, data) => {
console.info(TAG + ':startAbility success , err:' + JSON.stringify(err) + ',data:' + JSON.stringify(data));
});
console.info('------------end SUB_AA_OpenHarmony_Want_0200-------------');
});
/*
* @tc.number SUB_AA_OpenHarmony_Want_0300
* @tc.name Switching the mission in the launcherlist to the foreground is not supported
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_Want_0300', 0, async function (done) {
console.info('------------start SUB_AA_OpenHarmony_Want_0300-------------');
TAG = 'SUB_AA_OpenHarmony_Want_0300';
var Subscriber = '';
function SubscribeCallBackType(err, data) {
console.info(TAG + ' Subscribe CallBack data:' + JSON.stringify(data) + JSON.stringify(err));
expect(data.data == 'MIMETYPE').assertTrue();
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
done();
}
function UnSubscribeCallback() {
console.debug(TAG + "====>UnSubscribe CallBack====>");
done();
}
commonEvent.createSubscriber(getCallingBundleType).then(async (data) => {
console.info(TAG + '====>Create Subscriber====>');
Subscriber = data;
await commonEvent.subscribe(Subscriber, SubscribeCallBackType);
});
featureAbility.startAbility({
want: {
abilityName: 'com.example.applicationinfo.MainAbility2',
bundleName: 'com.example.applicationinfo',
type: 'MIMETYPE',
}
}, (err, data) => {
console.info(TAG + ':startAbility success , err:' + JSON.stringify(err) + ',data:' + JSON.stringify(data));
});
console.info('------------end SUB_AA_OpenHarmony_Want_0300-------------');
})
})
\ 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('./ApplicationInfoJsunit.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.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsConfigurationconstantTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsConfigurationconstantTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "com.example.configuration",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsConfigurationconstantTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.configuration",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.configuration",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"visible": true,
"name": "com.example.configuration.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"isVisible": "true",
"launchType": "singleton"
}
],
"reqPermissions": [
{
"name": "ohos.permission.GET_BUNDLE_INFO",
"reason": "need use ohos.permission.INSTALL_BUNDLE"
},
{
"name": "ohos.permission.UPDATE_CONFIGURATION",
"reason": "need use ohos.permission.INSTALL_BUNDLE"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ 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 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{title}}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
let once = true
export default {
data: {
title: ''
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
if (once) {
once = false
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)
this.timeout = 10000
require('../../../test/List.test')
core.execute()
}
},
onReady() {
console.info('onReady');
},
}
{
"string": [
{
"name": "app_name",
"value": "JsHelloWorld"
},
{
"name": "mainability_description",
"value": "hap sample empty page"
}
]
}
\ No newline at end of file
/*
* 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.
*/
import ConfigurationConstant from '@ohos.application.ConfigurationConstant'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe('ConfigurationTest', function () {
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100
* @tc.name colorMode is "ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100-------------");
expect(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT).assertEqual(1);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200
* @tc.name colorMode is "ConfigurationConstant.ColorMode.COLOR_MODE_DARK"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200-------------");
expect(ConfigurationConstant.ColorMode.COLOR_MODE_DARK).assertEqual(0);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300
* @tc.name colorMode is "ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300-------------");
expect(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET).assertEqual(-1);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100
* @tc.name Direction is "ConfigurationConstant.Direction.DIRECTION_VERTICAL"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100-------------");
expect(ConfigurationConstant.Direction.DIRECTION_VERTICAL).assertEqual(0);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200
* @tc.name Direction is "ConfigurationConstant.Direction.DIRECTION_HORIZONTAL"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200-------------");
expect(ConfigurationConstant.Direction.DIRECTION_HORIZONTAL).assertEqual(1);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300
* @tc.name Direction is "ConfigurationConstant.Direction.DIRECTION_NOT_SET"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300-------------");
expect(ConfigurationConstant.Direction.DIRECTION_NOT_SET).assertEqual(-1);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_SDPI"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_SDPI).assertEqual(120);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_MDPI"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_MDPI).assertEqual(160);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_LDPI"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_LDPI).assertEqual(240);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XLDPI"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XLDPI).assertEqual(320);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXLDPI"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXLDPI).assertEqual(480);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXXLDPI"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXXLDPI).assertEqual(640);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_NOT_SET"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_NOT_SET).assertEqual(0);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700-------------");
});
})
\ 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('./JsConfiguration.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.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsCoverapiTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsCoverapiTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "com.example.coverapi",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsCoverapiTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.coverapi",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.coverapi",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"visible": true,
"name": "com.example.coverapi.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"isVisible": "true",
"launchType": "singleton"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ 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 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{title}}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
let once = true
export default {
data: {
title: ''
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
if (once) {
once = false
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)
this.timeout = 10000
require('../../../test/List.test')
core.execute()
}
},
onReady() {
console.info('onReady');
},
}
{
"string": [
{
"name": "app_name",
"value": "JsHelloWorld"
},
{
"name": "mainability_description",
"value": "hap sample empty page"
}
]
}
\ No newline at end of file
/*
* 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.
*/
import appManager from '@ohos.application.appManager';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index";
describe('CoverApiTest', function () {
/*
* @tc.number SUB_AA_OpenHarmony_CoverApi_0500
* @tc.name whether the system is under stability test
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_CoverApi_0500', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_CoverApi_0500-------------");
appManager.isRunningInStabilityTest()
.then((data) => {
console.info('SUB_AA_OpenHarmony_CoverApi_0500 successful. data: ' + JSON.stringify(data));
expect(data == false).assertTrue();
done();
}).catch((error) => {
console.error('SUB_AA_OpenHarmony_CoverApi_0500 failed. error: ' + JSON.stringify(error));
expect().assertFalse();
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.
*/
require('./JsCoverApi.test')
\ 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("ActsEqueryabilitybywantTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsEqueryabilitybywantTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js"
hap_profile = "entry/src/main/config.json"
js2abc = true
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "com.example.abilitydisable",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsEqueryabilitybywantTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.abilitydisable",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.abilitydisable",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"srcPath": "MainAbility2",
"name": ".MainAbility2",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability2",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"srcPath": "MainAbility3",
"name": ".MainAbility3",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability3",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"srcPath": "MainAbility4",
"name": ".MainAbility4",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability4",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"srcPath": "ServiceAbility",
"name": ".ServiceAbility",
"icon": "$media:icon",
"srcLanguage": "js",
"description": "$string:description_serviceability",
"type": "service"
}
],
"js": [
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility2",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility3",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility4",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ 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("Application onCreate");
},
onDestroy() {
console.info("Application onDestroy");
},
onForgeGround(){
console.info("Application onForgeGround");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong1';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
console.info('onShow start1')
core.init()
console.info('onShow start2')
const configService = core.getDefaultService('config')
console.info('onShow start3')
configService.setConfig(this)
console.info('onShow start4')
require('../../../test/List.test')
console.info('onShow start5')
core.execute()
}
}
/*
* 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 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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("Application onCreate");
setTimeout(()=>{
this.content.terminateSelf().then((data)=>{
console.log("Application terminateSelf data:" + JSON.stringify(data) )
}).catch((error)=>{
console.log("Application terminateSelf data:" + JSON.stringify(error) )
})
},4000)
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong2';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
}
/*
* 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 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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 abilityFeatureAbility from '@ohos.ability.featureAbility';
export default {
onCreate() {
console.info("Application onCreate MainAbility3");
setTimeout(()=>{
abilityFeatureAbility.terminateSelf().then((data)=>{
console.log("Application terminateSelf data:" + JSON.stringify(data) )
}).catch((error)=>{
console.log("Application terminateSelf data:" + JSON.stringify(error) )
})
},4000)
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong3';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
}
/*
* 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 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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("Application onCreate");
setTimeout(()=>{
this.content.terminateSelf().then((data)=>{
console.log("Application terminateSelf data:" + JSON.stringify(data) )
}).catch((error)=>{
console.log("Application terminateSelf data:" + JSON.stringify(error) )
})
},4000)
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong4';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
}
/*
* 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 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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 {
onStart(want) {
console.info('ServiceAbility onStart');
},
onStop() {
console.info('ServiceAbility onStop');
},
onConnect(want) {
console.info('ServiceAbility onConnect');
return {};
},
onReconnect(want) {
console.info('ServiceAbility onReconnect');
},
onDisconnect() {
console.info('ServiceAbility onDisconnect');
},
onCommand(want, restart, startId) {
console.info('ServiceAbility onCommand');
},
onForeground(){
console.info('ServiceAbility onForeground');
},
};
\ No newline at end of file
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "description_mainability",
"value": "JS_Empty Ability"
},
{
"name": "description_mainability2",
"value": "JS_Empty Ability"
},
{
"name": "entry_MainAbility2",
"value": "entry_MainAbility2"
},
{
"name": "description_mainability3",
"value": "JS_Empty Ability"
},
{
"name": "entry_MainAbility3",
"value": "entry_MainAbility3"
},
{
"name": "description_mainability4",
"value": "JS_Empty Ability"
},
{
"name": "entry_MainAbility4",
"value": "entry_MainAbility4"
},
{
"name": "description_serviceability",
"value": "hap sample empty service"
}
]
}
\ No newline at end of file
/*
* 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.
*/
import bundleManager from '@ohos.bundle';
import account from "@ohos.account.osAccount"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
let userId;
describe('AbilityDisable', function () {
/*
* @tc.number SUB_AA_OpenHarmony_EqueryAbilityByWant_0100
* @tc.name Call queryAbilityByWant to get moduleName
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_EqueryAbilityByWant_0100", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_EqueryAbilityByWant_0100-------------------");
let accountManager = account.getAccountManager();
let bundleFlags=bundleManager.BundleFlag.GET_ABILITY_INFO_WITH_PERMISSION;
await accountManager.getOsAccountLocalIdFromProcess().then((data)=>{
console.log("success get userId:" + JSON.stringify(data));
userId = data;
}).catch((err)=>{
console.log("+++++++++++++" + JSON.stringify(err));
})
let want={
bundleName:"com.example.abilitydisable",
abilityName:"com.example.abilitydisable.MainAbility"
};
bundleManager.queryAbilityByWant(want,bundleFlags,userId,(err, data) => {
console.log('SUB_AA_OpenHarmony_Clear_0100 queryAbilityByWant errCode : '
+ JSON.stringify(err) + " data: " + JSON.stringify(data));
for(var i=0;i<data.length;i++){
console.log("data[i]['moduleName']"+data[i]['moduleName']);
expect(data[i]['moduleName'] == "entry").assertTrue();
}
})
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_EqueryAbilityByWant_0200
* @tc.name Call queryAbilityByWant to get the URI
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_EqueryAbilityByWant_0200", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_EqueryAbilityByWant_0200-------------------");
let bundleFlags=bundleManager.BundleFlag.GET_ABILITY_INFO_WITH_PERMISSION;
let accountManager = account.getAccountManager();
await accountManager.getOsAccountLocalIdFromProcess().then((data)=>{
console.log("success get userId:" + JSON.stringify(data));
userId = data;
}).catch((err)=>{
console.log("+++++++++++++" + JSON.stringify(err));
})
let want={
bundleName:"com.example.abilitydisable",
abilityName:"com.example.abilitydisable.MainAbility"
};
bundleManager.queryAbilityByWant(want,bundleFlags,userId,(err, data) => {
console.log('SUB_AA_OpenHarmony_EqueryAbilityByWant_0200 queryAbilityByWant errCode : '
+ JSON.stringify(err) + " data: " + JSON.stringify(data));
for(var i=0;i<data.length;i++){
console.log("data[i]['uri']"+data[i]['uri']);
expect(data[i]['uri'] == "").assertTrue();
}
})
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_EqueryAbilityByWant_0300
* @tc.name Call getapplicationInfo to get the name
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_EqueryAbilityByWant_0300", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_EqueryAbilityByWant_0300-------------------");
let bundleName="com.example.abilitydisable";
let accountManager = account.getAccountManager();
let bundleFlags=bundleManager.BundleFlag.GET_ABILITY_INFO_WITH_PERMISSION;
await accountManager.getOsAccountLocalIdFromProcess().then((data)=>{
console.log("success get userId:" + JSON.stringify(data));
userId = data;
}).catch((err)=>{
console.log("+++++++++++++" + JSON.stringify(err));
})
bundleManager.getApplicationInfo(bundleName, bundleFlags,userId,(err, data) => {
console.log('SUB_AA_OpenHarmony_EqueryAbilityByWant_0300 getapplicationInfo errCode : '
+ JSON.stringify(err) + " data: " + JSON.stringify(data));
expect(data['name']).assertEqual("com.example.abilitydisable");
})
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.
*/
require('./JsAbilityDisable.test.js')
\ No newline at end of file
......@@ -53,7 +53,7 @@
"launchType": "singleton",
"process": "processTestAbility",
"permissions": ["ohos.permission.ACCELEROMETER"],
"deviceCapability": ["screen_support","audio_support"],
"deviceCapability": ["ability_base","ability_runtime"],
"uri": "uriTest",
"visible": true
}
......
......@@ -388,6 +388,28 @@ export default function applicationBundleJsunit() {
});
});
/**
* @tc.number: getApplicationInfo_1800
* @tc.name: getApplicationInfo : Obtains based on a given bundle name and flag.
* @tc.desc: Check whether fingerprint gets
*/
it('getApplicationInfo_1800', 0, async function (done) {
await Bundle.getApplicationInfo(BUNDLE_NAME,
Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_CERTIFICATE_FINGERPRINT).then((data) => {
expect(data.fingerprint).assertFail("8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5");
}).catch((error) => {
expect(error).assertEqual(1);
});
Bundle.getApplicationInfo(BUNDLE_NAME,
Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_CERTIFICATE_FINGERPRINT, (error, data) => {
expect(data.fingerprint).assertFail("8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5");
if(error){
expect(err).assertEqual(1);
}
done();
});
});
function expectData(msg, data) {
expect(typeof (data)).assertEqual('object');
expect(typeof (data.name)).assertEqual('string');
......@@ -408,6 +430,7 @@ export default function applicationBundleJsunit() {
expect(typeof (data.enabled)).assertEqual('boolean');
expect(typeof (data.uid)).assertEqual('number');
expect(typeof (data.entityType)).assertEqual('string');
expect(typeof (data.fingerprint)).assertEqual('string');
expect(typeof (data.removable)).assertEqual('boolean');
expect(Array.isArray(data.permissions)).assertEqual(true);
expect(Array.isArray(data.moduleSourceDirs)).assertEqual(true);
......
......@@ -90,7 +90,7 @@ describe('ActsBundleManagerTest', function () {
}
expect(datainfo.entryModuleName).assertEqual("entry");
expect(datainfo.isSilentInstallation.length).assertEqual(0);
expect(datainfo.minCompatibleVersionCode).assertEqual(0);
expect(datainfo.minCompatibleVersionCode).assertEqual(1);
expect(datainfo.entryInstallationFree).assertEqual(false);
for (let j = 0; j < datainfo.appInfo.moduleInfos.length; j++) {
expect(datainfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry");
......@@ -153,7 +153,7 @@ describe('ActsBundleManagerTest', function () {
}
expect(datainfo.entryModuleName).assertEqual("entry");
expect(datainfo.isSilentInstallation.length).assertEqual(0);
expect(datainfo.minCompatibleVersionCode).assertEqual(0);
expect(datainfo.minCompatibleVersionCode).assertEqual(1);
expect(datainfo.entryInstallationFree).assertEqual(false);
for (let j = 0; j < datainfo.appInfo.moduleInfos.length; j++) {
expect(datainfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry");
......@@ -232,7 +232,7 @@ describe('ActsBundleManagerTest', function () {
expect(datainfo.updateTime).assertLarger(0);
expect(datainfo.uid).assertLarger(0);
expect(datainfo.entryModuleName).assertEqual("entry");
expect(datainfo.minCompatibleVersionCode).assertEqual(0);
expect(datainfo.minCompatibleVersionCode).assertEqual(1);
expect(datainfo.entryInstallationFree).assertEqual(false);
expect(datainfo.reqPermissions.length).assertEqual(0);
expect(datainfo.reqPermissionStates.length).assertEqual(0);
......@@ -276,7 +276,7 @@ describe('ActsBundleManagerTest', function () {
expect(datainfo.updateTime).assertLarger(0);
expect(datainfo.uid).assertLarger(0);
expect(datainfo.entryModuleName).assertEqual("entry");
expect(datainfo.minCompatibleVersionCode).assertEqual(0);
expect(datainfo.minCompatibleVersionCode).assertEqual(1);
expect(datainfo.entryInstallationFree).assertEqual(false);
expect(datainfo.reqPermissions.length).assertEqual(0);
expect(datainfo.reqPermissionStates.length).assertEqual(0);
......@@ -502,7 +502,7 @@ describe('ActsBundleManagerTest', function () {
}
expect(dataInfo.entryModuleName).assertEqual("entry");
expect(dataInfo.isSilentInstallation.length).assertEqual(0);
expect(dataInfo.minCompatibleVersionCode).assertEqual(0);
expect(dataInfo.minCompatibleVersionCode).assertEqual(1);
expect(dataInfo.entryInstallationFree).assertEqual(false);
for (let j = 0; j < dataInfo.appInfo.moduleInfos.length; j++) {
expect(dataInfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry");
......@@ -551,7 +551,7 @@ describe('ActsBundleManagerTest', function () {
}
expect(dataInfo.entryModuleName).assertEqual("entry");
expect(dataInfo.isSilentInstallation.length).assertEqual(0);
expect(dataInfo.minCompatibleVersionCode).assertEqual(0);
expect(dataInfo.minCompatibleVersionCode).assertEqual(1);
expect(dataInfo.entryInstallationFree).assertEqual(false);
for (let j = 0; j < dataInfo.appInfo.moduleInfos.length; j++) {
expect(dataInfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册