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

!2850 XTS测试套规范整改

Merge pull request !2850 from chengxingzhen/master
......@@ -30,24 +30,6 @@ group("aafwk_standard") {
"amsabilitymanager/amsMissionSnapshotTestSingletonS:ActsAmsMissionSnapshotTestSingletonS",
"amsdatauriutils:ActsAmsDataUriUtilsTest",
"amsgetabilityprocessinfo:amsgetabilityprocessinfo",
"amsmultiapp/MultiAppPage:ActsAmsMultiPageApp",
"amsmultiapp/MultiAppPageConnectService:ActsAmsMultiPageAppConnectService",
"amsmultiapp/MultiAppPageConnect_Service:ActsAmsMultiAppPageConnectService",
"amsmultiapp/MultiAppPagePermission:ActsAmsMultiPageAppPermission",
"amsmultiapp/MultiAppPagePermission_Page:ActsAmsMultiAppPagePermission",
"amsmultiapp/MultiAppPage_PSS:ActsAmsMultiPageAppS",
"amsmultiapp/MultiAppPage_Page:ActsAmsMultiAppPage",
"amsmultiapp/MultiAppPage_Service:ActsAmsMultiAppPageService",
"amsmultiapp/MultiAppSimultaneousOnline:ActsAmsMultiAppSimultaneousOnline",
"amsmultiapp/MultiAppSimultaneousOnline_test:ActsAmsMultiAppPageClone",
"amsmultiapp/MultiAppTermination:ActsAmsMultiAppTermination",
"amsmultiapp/MultiAppTermination_test:ActsAmsMultiAppPageCloneTermination",
"amsmultiapp/amsmultiapppageexecutor:ActsAmsMultiAppPageExecutor",
"amsmultiapp/amsmultiappserviceexecutor:ActsAmsMultiAppServiceExecutor",
"amsmultiapp/amsmultiappservicestarter:ActsAmsMultiAppServiceStarter",
"amsmultiapp/amsmultiapptester:ActsAmsMultiAppTester",
"amsmultiapp/amsmultidataabilityclone:ActsAmsMultiDataAbilityClone",
"amsmultiapp/amsmultidataabilityself:ActsAmsMultiDataAbilitySelf",
"amsprocessmanageapi7:amsprocessmanageapi7",
"context:context",
"featureability:featureability",
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......@@ -32,7 +32,7 @@ export default {
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
id: 'extend'
})
core.addService('expect', expectExtend)
core.init()
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......@@ -17,7 +17,7 @@ import missionManager from '@ohos.application.missionManager'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
var abilityNameList = [
let abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
......@@ -26,7 +26,7 @@ var abilityNameList = [
"com.example.actsamscallbackfifthscene.MainAbility"
]
var bundleNameList = [
let bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
......@@ -42,10 +42,10 @@ var bundleNameList = [
describe('ActsAmsCallBackFifthScene', function () {
console.info('----ActsAmsCallBackFifthScene----');
beforeAll(async function (done) {
var maxnum = 10;
var data = await missionManager.getMissionInfos("", maxnum);
let maxnum = 10;
let data = await missionManager.getMissionInfos("", maxnum);
console.log('ActsAmsCallBackFifthScene beforeAll getMissionInfos data: ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
if (data[i].want.bundleName != 'com.example.actsamscallbackfifthscene') {
console.log("ActsAmsCallBackFifthScene, missionId: " + data[i].missionId)
missionManager.clearMission(data[i].missionId,
......@@ -117,7 +117,7 @@ describe('ActsAmsCallBackFifthScene', function () {
}
function sleep(delay) {
var start = new Date().getTime();
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
......@@ -140,7 +140,7 @@ describe('ActsAmsCallBackFifthScene', function () {
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_6600 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -165,14 +165,14 @@ describe('ActsAmsCallBackFifthScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_7000', 0, async function (done) {
var maxnum = 10;
let maxnum = 10;
missionManager.getMissionInfos("", maxnum,
(error, data) => {
console.info('Acts_Ams_test_7000 getMissionInfos error.code : \
' + error.code + ',data length [' + data.length + ']');
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(4);
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
console.info('Acts_Ams_test_7000 getMissionInfos data[' + i + "]: " + JSON.stringify(data[i]));
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -201,9 +201,9 @@ describe('ActsAmsCallBackFifthScene', function () {
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_7600', 0, async function (done) {
var maxnum = 10;
var result = await missionManager.getMissionInfos("", maxnum);
for (var i = 0; i < result.length; i++) {
let maxnum = 10;
let result = await missionManager.getMissionInfos("", maxnum);
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_7600 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
missionManager.moveMissionToFront(result[0].missionId,
......
......@@ -12,16 +12,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ import missionManager from '@ohos.application.missionManager'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
var abilityNameList = [
let abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
......@@ -27,7 +27,7 @@ var abilityNameList = [
"com.example.actsamscallbackfourthscene.MainAbility"
]
var bundleNameList = [
let bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
......@@ -45,10 +45,10 @@ var bundleNameList = [
describe('ActsAmsCallBackFourthScene', function () {
console.info('----ActsAmsCallBackFourthScene----');
beforeAll(async function (done) {
var maxnum = 10;
var data = await missionManager.getMissionInfos("", maxnum);
let maxnum = 10;
let data = await missionManager.getMissionInfos("", maxnum);
console.log('ActsAmsCallBackFourthScene beforeAll getMissionInfos data: ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
if (data[i].want.bundleName != 'com.example.actsamscallbackfourthscene') {
console.log("ActsAmsCallBackFourthScene, missionId: " + data[i].missionId)
missionManager.clearMission(data[i].missionId,
......@@ -137,7 +137,7 @@ describe('ActsAmsCallBackFourthScene', function () {
}
function sleep(delay) {
var start = new Date().getTime();
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
......@@ -160,7 +160,7 @@ describe('ActsAmsCallBackFourthScene', function () {
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_5000 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -183,14 +183,14 @@ describe('ActsAmsCallBackFourthScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_5400', 0, async function (done) {
var maxnum = 100;
let maxnum = 100;
missionManager.getMissionInfos("", maxnum,
(error, data) => {
console.info('Acts_Ams_test_5400 getMissionInfos error.code : \
' + error.code + ',data length [' + data.length + ']');
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(4);
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
console.info('Acts_Ams_test_5400 getMissionInfos data[' + i + "]: " + JSON.stringify(data[i]));
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -217,10 +217,10 @@ describe('ActsAmsCallBackFourthScene', function () {
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_5600', 0, async function (done) {
var maxnum = 30;
var result = await missionManager.getMissionInfos("", maxnum);
let maxnum = 30;
let result = await missionManager.getMissionInfos("", maxnum);
let id = 0;
for (var i = 0; i < result.length; i++) {
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_5600 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
if (result[i].want.abilityName != 'com.example.actsamscallbackfourthscene.MainAbility' &&
result[i].runningState == 0) {
......@@ -244,9 +244,9 @@ describe('ActsAmsCallBackFourthScene', function () {
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_6000', 0, async function (done) {
var maxnum = 30;
var result = await missionManager.getMissionInfos("", maxnum);
for (var i = 0; i < result.length; i++) {
let maxnum = 30;
let result = await missionManager.getMissionInfos("", maxnum);
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_6000 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
missionManager.moveMissionToFront(result[1].missionId,
......@@ -278,9 +278,9 @@ describe('ActsAmsCallBackFourthScene', function () {
* @tc.desc : delete Missions(by CallBack)
*/
it('Acts_Ams_test_11900', 0, async function (done) {
var maxnum = 30;
var result = await missionManager.getMissionInfos("", maxnum);
for (var i = 0; i < result.length; i++) {
let maxnum = 30;
let result = await missionManager.getMissionInfos("", maxnum);
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_11900 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
missionManager.clearAllMissions(
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ import missionManager from '@ohos.application.missionManager'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit'
var abilityNameList = [
let abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
......@@ -25,7 +25,7 @@ var abilityNameList = [
"com.example.actsamscallbacksecondscene.MainAbility"
]
var bundleNameList = [
let bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
......@@ -41,10 +41,10 @@ var bundleNameList = [
describe('ActsAmsCallBackSecondScene', function () {
console.info('----ActsAmsCallBackSecondScene----');
beforeAll(async function (done) {
var maxnum = 10;
var data = await missionManager.getMissionInfos("", maxnum);
let maxnum = 10;
let data = await missionManager.getMissionInfos("", maxnum);
console.log('ActsAmsCallBackSecondScene beforeAll getMissionInfos data: ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
if (data[i].want.bundleName != 'com.example.actsamscallbacksecondscene') {
console.log("ActsAmsCallBackSecondScene, missionId: " + data[i].missionId)
missionManager.clearMission(data[i].missionId,
......@@ -99,7 +99,7 @@ describe('ActsAmsCallBackSecondScene', function () {
}
function sleep(delay) {
var start = new Date().getTime();
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
......@@ -122,7 +122,7 @@ describe('ActsAmsCallBackSecondScene', function () {
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_1800 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -145,14 +145,14 @@ describe('ActsAmsCallBackSecondScene', function () {
* @tc.desc : Query Running Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_2000', 0, async function (done) {
var maxnum = 20;
let maxnum = 20;
missionManager.getMissionInfos("", maxnum,
(error, info) => {
console.info('Acts_Ams_test_2000 getMissionInfos error.code : \
' + error.code + ',data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_2000 getMissionInfos data[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -179,9 +179,9 @@ describe('ActsAmsCallBackSecondScene', function () {
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_2400', 0, async function (done) {
var maxnum = 20;
var result = await missionManager.getMissionInfos("", maxnum);
for (var i = 0; i < result.length; i++) {
let maxnum = 20;
let result = await missionManager.getMissionInfos("", maxnum);
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_2400 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
missionManager.clearMission(result[1].missionId,
......@@ -199,9 +199,9 @@ describe('ActsAmsCallBackSecondScene', function () {
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_2800', 0, async function (done) {
var maxnum = 20;
var result = await missionManager.getMissionInfos("", maxnum);
for (var i = 0; i < result.length; i++) {
let maxnum = 20;
let result = await missionManager.getMissionInfos("", maxnum);
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_2800 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
missionManager.moveMissionToFront(result[0].missionId,
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ import missionManager from '@ohos.application.missionManager'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
var abilityNameList = [
let abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
......@@ -25,7 +25,7 @@ var abilityNameList = [
"com.example.actsamscallbackthirdscene.MainAbility"
]
var bundleNameList = [
let bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
......@@ -40,10 +40,10 @@ var bundleNameList = [
describe('ActsAmsCallBackThirdScene', function () {
console.info('----ActsAmsCallBackThirdScene----');
beforeAll(async function (done) {
var maxnum = 10;
var data = await missionManager.getMissionInfos("", maxnum);
let maxnum = 10;
let data = await missionManager.getMissionInfos("", maxnum);
console.log('ActsAmsCallBackThirdScene beforeAll getMissionInfos data: ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
if (data[i].want.bundleName != 'com.example.actsamscallbackthirdscene') {
console.log("ActsAmsCallBackThirdScene, missionId: " + data[i].missionId)
missionManager.clearMission(data[i].missionId,
......@@ -92,7 +92,7 @@ describe('ActsAmsCallBackThirdScene', function () {
});
function sleep(delay) {
var start = new Date().getTime();
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
......@@ -115,7 +115,7 @@ describe('ActsAmsCallBackThirdScene', function () {
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_3400 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -138,14 +138,14 @@ describe('ActsAmsCallBackThirdScene', function () {
* @tc.desc : Query Running Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_3600', 0, async function (done) {
var maxnum = 20;
let maxnum = 20;
missionManager.getMissionInfos("", maxnum,
(error, info) => {
console.info('Acts_Ams_test_3600 getMissionInfos error.code : \
' + error.code + ',data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_3600 getMissionInfos info[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -172,9 +172,9 @@ describe('ActsAmsCallBackThirdScene', function () {
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_4400', 0, async function (done) {
var maxnum = 20;
var result = await missionManager.getMissionInfos("", maxnum);
for (var i = 0; i < result.length; i++) {
let maxnum = 20;
let result = await missionManager.getMissionInfos("", maxnum);
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_4400 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
missionManager.moveMissionToFront(result[0].missionId,
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ import missionManager from '@ohos.application.missionManager'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
var abilityNameList = [
let abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
......@@ -26,7 +26,7 @@ var abilityNameList = [
"com.example.actsamstestfifthscene.MainAbility"
]
var bundleNameList = [
let bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
......@@ -42,10 +42,10 @@ var bundleNameList = [
describe('ActsAmsTestFifthScene', function () {
console.info('----ActsAmsTestFifthScene----');
beforeAll(async function (done) {
var maxnum = 10;
var data = await missionManager.getMissionInfos("", maxnum);
let maxnum = 10;
let data = await missionManager.getMissionInfos("", maxnum);
console.log('ActsAmsTestFifthScene beforeAll getMissionInfos data: ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
if (data[i].want.bundleName != 'com.example.actsamstestfifthscene') {
console.log("ActsAmsTestFifthScene, missionId: " + data[i].missionId)
missionManager.clearMission(data[i].missionId,
......@@ -132,7 +132,7 @@ describe('ActsAmsTestFifthScene', function () {
}
function sleep(delay) {
var start = new Date().getTime();
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
......@@ -149,10 +149,10 @@ describe('ActsAmsTestFifthScene', function () {
console.info("sleep begin");
sleep(5000);
console.info("sleep end");
var info = await appManager.getProcessRunningInfos();
let info = await appManager.getProcessRunningInfos();
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_0100 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -175,14 +175,14 @@ describe('ActsAmsTestFifthScene', function () {
*/
it('Acts_Ams_test_1100', 0, async function (done) {
console.log('Acts_Ams_test_1100 begin');
var maxnum = 10;
var result = await missionManager.getMissionInfos("", maxnum).catch(err => {
let maxnum = 10;
let result = await missionManager.getMissionInfos("", maxnum).catch(err => {
console.log('Acts_Ams_test_1100 getMissionInfos failed: ' + err);
});
for (var i = 0; i < result.length; i++) {
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_1100 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
var info = await missionManager.moveMissionToFront(result[0].missionId).catch(err => {
let info = await missionManager.moveMissionToFront(result[0].missionId).catch(err => {
console.log('Acts_Ams_test_1100 moveMissionToFront failed: ' + err);
expect(err).assertEqual(0);
});
......@@ -196,12 +196,12 @@ describe('ActsAmsTestFifthScene', function () {
* @tc.desc : Query Running Ability Mission Infos(by Promise)
*/
it('Acts_Ams_test_0300', 0, async function (done) {
var maxnum = 10;
let maxnum = 10;
await missionManager.getMissionInfos("", maxnum).then(data => {
console.info('Acts_Ams_test_0300 getMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(4);
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
console.info('Acts_Ams_test_0300 getMissionInfos data[' + i + "]: " + JSON.stringify(data[i]));
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,10 +17,10 @@ import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,10 +17,10 @@ import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -18,7 +18,7 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -20,7 +20,7 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......@@ -29,7 +29,7 @@ export default {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
id: 'extend'
})
core.addService('expect', expectExtend)
core.init()
......@@ -41,5 +41,6 @@ export default {
core.execute()
},
onReady() {
console.info('onReady');
},
}
......@@ -12,13 +12,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import app from '@system.app'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......@@ -27,7 +27,7 @@ export default {
console.info('====onShow finish====<')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
id: 'extend'
})
const reportExtend = new ReportExtend(file)
core.addService('expect', expectExtend)
......
......@@ -15,7 +15,7 @@
import commonEvent from '@ohos.commonEvent'
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -15,7 +15,7 @@
import commonEvent from '@ohos.commonEvent'
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -12,13 +12,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import app from '@system.app'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......@@ -27,7 +27,7 @@ export default {
console.info('====onShow finish====<')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
id: 'extend'
})
const reportExtend = new ReportExtend(file)
core.addService('expect', expectExtend)
......
# 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("ActsAmsMultiPageApp") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAmsMultiPageApp"
}
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"
}
{
"app": {
"bundleName": "com.example.actsamsmultipageapp",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsamsmultipageapp",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"visible": true,
"name": "com.example.actsamsmultipageapp.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 file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
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)
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) 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('./MangerAbilityJsunit.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 featureAbility from '@ohos.ability.featureAbility'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
import commonEvent from '@ohos.commonEvent'
describe('ActsAmsMultiPageApp', function () {
console.info('----ActsAmsMultiPageApp----');
beforeAll(async function (done) {
await featureAbility.startAbility(
{
want:
{
bundleName: "com.example.actsamsmultiapppage",
abilityName: "com.example.actsamsmultiapppage.MainAbility",
},
},
);
});
})
# 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("ActsAmsMultiPageAppConnectService") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAmsMultiPageAppConnectService"
}
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"
}
{
"app": {
"bundleName": "com.example.actsamsmultipageappconnectservice",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsamsmultipageappconnectservice",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"visible": true,
"name": "com.example.actsamsmultipageappconnectservice.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">
MultiAppPageConnectServiceA
</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 file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
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)
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) 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('./MangerAbilityJsunit.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 bundle from "@ohos.bundle"
import featureAbility from '@ohos.ability.featureAbility'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
import commonEvent from '@ohos.commonEvent'
describe('ActsAmsMultiPageAppConnectService', function () {
console.info('----ActsAmsMultiPageAppConnectService----');
beforeAll(async function (done) {
console.info('----ActsAmsMultiPageAppConnectService----');
var connId = await featureAbility.connectAbility(
{
bundleName: "com.example.actsamsmultiapppageconnectservice",
abilityName: "com.example.actsamsmultiapppageconnectservice.MainAbility",
},
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback,
onFailed: onFailedCallback,
},
);
console.log('ActsAmsMultiPageAppConnectService ConnectAbility connId : ' + connId);
done();
function onConnectCallback(element, remote) {
console.log('ActsAmsMultiPageAppConnectService ConnectAbility onConnect element.deviceId : '
+ element.deviceId)
console.log('ActsAmsMultiPageAppConnectService ConnectAbility onConnect element.bundleName : '
+ element.bundleName)
console.log('ActsAmsMultiPageAppConnectService ConnectAbility onConnect element.abilityName : '
+ element.abilityName)
console.log('ActsAmsMultiPageAppConnectService ConnectAbility onConnect remote : ' + remote);
console.log('ActsAmsMultiPageAppConnectService ConnectAbility onConnect remote 是否为proxy:'
+ (remote instanceof rpc.RemoteProxy));
}
function onDisconnectCallback(element) {
commonEvent.publish("DISCONNECT", ()=>{console.log('disconnect finish')});
console.log('ActsAmsMultiPageAppConnectService ConnectAbility onDisconnect element.deviceId : '
+ element.deviceId)
console.log('ActsAmsMultiPageAppConnectService ConnectAbility onDisconnect element.bundleName : '
+ element.bundleName)
console.log('ActsAmsMultiPageAppConnectService ConnectAbility onDisconnect element.abilityName : '
+ element.abilityName)
}
function onFailedCallback(code) {
console.log('ActsAmsMultiPageAppConnectService ConnectAbility onFailed errCode : ' + code)
}
});
/*
* @tc.number : AMS_MultiApp_0300
* @tc.name : connectAbility : connect pageAbility
* @tc.desc : pageAbility->serviceAbility
*/
it('AMS_MultiApp_0300', 0, async function (done) {
var subscriber;
var CommonEventSubscribeInfo = {
events: ["ACTS_MultiAppPageConnectService_onConnect1",
"ACTS_MultiAppPageConnectService_onConnect2"],
};
function unsubscribe(caller, subscriber) {
commonEvent.unsubscribe(subscriber, (err, data) => {
console.debug("=ACTS_MissionSnapshot_unsubscribe (err,data)=======>"
+ (caller)
+ (" , json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,err=" + err + " ,data=" + data);
done();
});
}
commonEvent.createSubscriber(CommonEventSubscribeInfo).then(async (data) => {
console.debug("=AMS_MultiApp_0300 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,data=" + data);
subscriber = data;
await commonEvent.subscribe(subscriber, async (err, data) => {
console.debug("=AMS_MultiApp_0300 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,err=" + err + " ,data=" + data);
if (data.event == "ACTS_MultiAppPageConnectService_onConnect2")
{
console.debug("=======AMS_MultiApp_0300 Ontology=======");
expect(data.event).assertEqual("ACTS_MultiAppPageConnectService_onConnect2");
}
else if (data.event == "ACTS_MultiAppPageConnectService_onConnect1")
{
console.debug("=======AMS_MultiApp_0300 Clone=======");
expect(data.event).assertEqual("ACTS_MultiAppPageConnectService_onConnect1");
}
unsubscribe("subscribe", subscriber);
});
});
})
})
# 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_hap("ActsAmsMultiAppPageConnectService") {
hap_profile = "./entry/src/main/config.json"
hap_name = "ActsAmsMultiAppPageConnectService"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
}
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"
}
{
"app": {
"bundleName": "com.example.actsamsmultiapppageconnectservice",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsamsmultiapppageconnectservice",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"visible": true,
"name": "com.example.actsamsmultiapppageconnectservice.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "service",
"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">
MultiAppPageConnectServiceB
</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 file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
import rpc from "@ohos.rpc"
import commonEvent from '@ohos.commoneEvent'
import particleAbility from '@ohos.ability.particleAbility'
import bundle from "@ohos.bundle"
let mMyStub;
const MIN_CLONEUID = 20000000;
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish ')
},
onStart(want) {
console.debug('AMS_MultiApp ====>onStart'
+ want + " , JSON." + JSON.stringify(want));
class MyStub extends rpc.RemoteObject {
constructor(des) {
super(des);
}
onRemoteRequest(code, message, reply, option) {
console.log("AMS_MultiApp code:" + code);
if (code === 1) {
let getContextObject = rpc.IPCSkeleton.getContextObject();
let getCallingPid = rpc.IPCSkeleton.getCallingPid();
let getCallingUid = rpc.IPCSkeleton.getCallingUid();
let getCallingDeviceID = rpc.IPCSkeleton.getCallingDeviceID();
let getLocalDeviceID = rpc.IPCSkeleton.getLocalDeviceID();
let isLocalCalling = rpc.IPCSkeleton.isLocalCalling();
let remoteObject = new rpc.RemoteObject("aaa", 3);
let flushCommands = rpc.IPCSkeleton.flushCommands(remoteObject);
let resetCallingIdentity = rpc.IPCSkeleton.resetCallingIdentity();
let setCallingIdentity = rpc.IPCSkeleton.setCallingIdentity("aaa", 3);
let num = message.readInt();
let msg = message.readString();
console.log("num is " + num + "msg is " + msg);
reply.writeString("Success");
return true;
}
}
}
mMyStub = new MyStub("ServiceAbility-test");
},
async onConnect(want) {
console.info('onConnect finish')
console.info('AMS_MultiApp_0800 want'
+ JSON.stringify(want));
console.info('particleAbility--------------------------1');
var featureData = await particleAbility.getWant();
console.info('particleAbility--------------------------2');
console.info('AMS_MultiApp_0800 featureData' + featureData);
console.info('AMS_MultiApp_0800 featureData' + JSON.stringify(featureData));
console.info('AMS_MultiApp_0800 featureData-->bundleName' + featureData.bundleName);
var flag=0;
if((featureData.bundleName) == ("com.example.actsamsmultiapppageconnectservice"))
{
if ((featureData.abilityName) == ("com.example.actsamsmultiapppageconnectservice.MainAbility"))
{
flag = 1;
}
}
console.info('AMS_MultiApp_0800 flag' + JSON.stringify(flag));
var info = await particleAbility.getAbilityInfo();
console.info('AMS_MultiApp_0800 particleAbility.getAbilityInfo() '
+ JSON.stringify(info));
console.info('AMS_MultiApp_0800 particleAbility.getAbilityInfo() '
+ info);
console.info('AMS_MultiApp_0800 particleAbility.getAbilityInfo() '
+ JSON.stringify(info.applicationInfo));
bundle.getBundleInfo("com.example.actsamsmultiapppageconnectservice", 1, async(err, data) => {
console.info('AMS_MultiApp_0800 bundle.getBundleInfo '
+ JSON.stringify(data));
if (data.uid >= MIN_CLONEUID) {
console.info('AMS_MultiApp_0800 Clone info ' + JSON.stringify(info.applicationInfo));
if (info.applicationInfo.isCloned == true)
{
flag = 1;
}
} else {
console.info('AMS_MultiApp_0800 Ontology info ' + JSON.stringify(info.applicationInfo));
if (info.applicationInfo.isCloned == false)
{
flag = 2;
}
}
commonEvent.publish("ACTS_MultiAppPageConnectService_onConnect" + flag, err =>{
console.info('AMS_MultiApp resultflag' + JSON.stringify(flag));
console.debug("=ACTS_MultiAppPageConnectService_onConnect err,data=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json flag【") + JSON.stringify(flag) + ("")
+ " ,err=" + err + " ,flag=" + flag);
});
return mMyStub;
})
},
onCommand(want,restart,startId) {
console.info('onCommand finish')
commonEvent.publish("ACTS_MultiAppPageConnectService_onCommand", (err,data) =>{
console.debug("=ACTS_MultiAppPageConnectService_onCommand err,data=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,err=" + err + " ,data=" + data);
});
},
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) 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("ActsAmsMultiPageAppPermission") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAmsMultiPageAppPermission"
}
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"
}
{
"app": {
"bundleName": "com.example.actsamsmultipageapppermission",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsamsmultipageapppermission",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"visible": true,
"name": "com.example.actsamsmultipageapppermission.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">
MultiAppPagePermissionA
</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 file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
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)
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) 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('./MangerAbilityJsunit.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 featureAbility from '@ohos.ability.featureAbility'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
import commonEvent from '@ohos.commonEvent'
var subscriberInfoStartAbility = {
events: ["ACTS_StartAbility_CommonEvent"],
};
describe('ActsAmsMultiAppPermission', function () {
console.info('----ActsAmsMultiAppPermission----');
/*
* @tc.number : AMS_MultiApp_Permission_Verification_0100
* @tc.name : startAbility : start pageAbility
* @tc.desc : pageAbility start pageAbility without permission
*/
it('AMS_MultiApp_Permission_Verification_0100', 0, async function (done) {
var subscriber;
commonEvent.createSubscriber(subscriberInfoStartAbility).then(async (data) => {
console.debug("====>Create Subscriber====>");
subscriber = data;
console.debug("====>Create Subscriber====> subscriber" + subscriber);
await commonEvent.subscribe(subscriber, subscribeCallBack);
})
await featureAbility.startAbility(
{
want:
{
bundleName: "com.example.actsamsmultiapppagepermission",
abilityName: "com.example.actsamsmultiapppagepermission.MainAbility",
},
},
);
function subscribeCallBack(err, data) {
console.debug("====>subscribeCallBack====> data.event " + data.event);
expect(data.event).assertEqual("ACTS_StartAbility_CommonEvent error");
done();
}
setTimeout(()=>{
unsubscribe("subscribe", subscriber);
expect("true").assertEqual("true");
}, 5000);
function unsubscribe(caller, subscriber) {
commonEvent.unsubscribe(subscriber, (err, data) => {
console.debug("=ACTS_AmsMultiAppPermission_unsubscribe (err,data)=======>"
+ (caller)
+ (" , json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,err=" + err + " ,data=" + data);
done();
});
}
})
})
# 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_hap("ActsAmsMultiAppPagePermission") {
hap_profile = "./entry/src/main/config.json"
hap_name = "ActsAmsMultiAppPagePermission"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
}
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"
}
{
"app": {
"bundleName": "com.example.actsamsmultiapppagepermission",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsamsmultiapppagepermission",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"visible": true,
"name": "com.example.actsamsmultiapppagepermission.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 file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
import commonEvent from '@ohos.commonEvent'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish LJ')
commonEvent.publish("ACTS_StartAbility_CommonEvent", (err,data) =>{
console.debug("=ACTS_StartAbility_CommonEvent err,data=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,err=" + err + " ,data=" + data);
});
},
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) 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("ActsAmsMultiPageAppS") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAmsMultiPageAppS"
}
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"
}
{
"app": {
"bundleName": "com.example.actsamsmultipageapps",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsamsmultipageapps",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"visible": true,
"name": "com.example.actsamsmultipageapps.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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册