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

!6891 audio&camera签名文件更改回合monthly分支

Merge pull request !6891 from 秦莉文/monthly_20221018
...@@ -25,7 +25,9 @@ ohos_js_hap_suite("audio_capturer_js_hap") { ...@@ -25,7 +25,9 @@ ohos_js_hap_suite("audio_capturer_js_hap") {
part_name = "multimedia_audio_framework" part_name = "multimedia_audio_framework"
} }
ohos_js_assets("audio_capturer_js_assets") { ohos_js_assets("audio_capturer_js_assets") {
source_dir = "./src/main/js/default" js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
} }
ohos_resources("audio_capturer_resources") { ohos_resources("audio_capturer_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
......
{ {
"description": "Configuration for audio manager Tests", "description": "Configuration for audio manager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "1500000", "test-timeout": "1500000",
"package": "ohos.acts.multimedia.audio.audiocapturer", "bundle-name": "ohos.acts.multimedia.audio.audiocapturer",
"package-name": "ohos.acts.multimedia.audio.audiocapturer",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
"kits": [ "kits": [
...@@ -41,8 +42,7 @@ ...@@ -41,8 +42,7 @@
"./resource/audio/audioManager/StarWars10s-2C-22050-2SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/", "./resource/audio/audioManager/StarWars10s-2C-22050-2SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/",
"./resource/audio/audioManager/StarWars10s-2C-24000-3SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/", "./resource/audio/audioManager/StarWars10s-2C-24000-3SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/",
"./resource/audio/audioManager/StarWars10s-2C-48000-4SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/" "./resource/audio/audioManager/StarWars10s-2C-48000-4SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/"
] ]
} }
] ]
} }
\ No newline at end of file
{ {
"app": { "app": {
"apiVersion": { "bundleName": "ohos.acts.multimedia.audio.audiocapturer",
"compatible": 6, "vendor": "example",
"releaseType": "Beta1", "version": {
"target": 7 "code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 5,
"target": 5,
"releaseType": "Beta1"
}
}, },
"vendor": "acts", "deviceConfig": {},
"bundleName": "ohos.acts.multimedia.audio.audiocapturer", "module": {
"version": { "package": "ohos.acts.multimedia.audio.audiocapturer",
"code": 1000000, "name": ".entry",
"name": "1.0.0" "deviceType": [
} "tablet",
}, "default",
"deviceConfig": { "phone"
"default": { ],
"debug": true "distro": {
} "deliveryWithInstall": true,
}, "moduleName": "entry",
"module": { "moduleType": "entry"
"abilities": [
{
"iconId": 16777218,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.audio.audiocapturer.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
}
],
"deviceType": [
"tablet",
"default",
"phone",
"tablet",
"tv",
"wearable"
],
"mainAbility": "ohos.acts.multimedia.audio.audiocapturer.MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"package": "ohos.acts.multimedia.audio.audiocapturer",
"name": ".MyApplication",
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
],
"reqPermissions": [
{
"name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
}, },
{ "reqPermissions": [
"name": "ohos.permission.MICROPHONE", {
"reason": "use ohos.permission.MICROPHONE" "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name": "ohos.permission.MICROPHONE",
"reason": "use ohos.permission.MICROPHONE"
},
{
"name": "ohos.permission.MANAGE_AUDIO_CONFIG",
"reason": "use ohos.permission.MANAGE_AUDIO_CONFIG"
}
],
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"formsEnabled": false,
"name": ".MainAbility",
"srcLanguage": "js",
"srcPath": "MainAbility",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
"label": "$string:MainAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
},
{
"orientation": "unspecified",
"formsEnabled": false,
"name": ".TestAbility",
"srcLanguage": "js",
"srcPath": "TestAbility",
"icon": "$media:icon",
"description": "$string:TestAbility_desc",
"label": "$string:TestAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
}, },
{ "mainAbility": ".MainAbility",
"name": "ohos.permission.MANAGE_AUDIO_CONFIG", "srcPath": ""
"reason": "use ohos.permission.MANAGE_AUDIO_CONFIG" }
}
]
}
} }
\ 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.
*/
export default {
onCreate() {
console.info("============== AceApplication onCreate ==============");
},
onDestroy() {
console.info('=============AceApplication onDestroy=============');
}
};
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
/*
* 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.
*/
<div class="container">
<text class="title">
Hello, World!
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* 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 file from '@system.file'
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')
},
onReady() {
},
}
/*
* 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('TestApplication onCreate')
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info("TestApplication onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
},
"Files": {
}
}
\ No newline at end of file
.container { .container {
display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
left: 0px;
top: 0px;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.title { .title {
font-size: 40px; font-size: 60px;
color: #000000; text-align: center;
opacity: 0.9; width: 100%;
} height: 40%;
margin: 10px;
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
} }
@media screen and (device-type: wearable) { @media screen and (device-type: phone) and (orientation: landscape) {
.title { .title {
font-size: 28px; font-size: 60px;
color: #FFFFFF;
} }
} }
@media screen and (device-type: tv) { @media screen and (device-type: tablet) and (orientation: landscape) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title { .title {
font-size: 100px; font-size: 100px;
color: #FFFFFF;
} }
} }
\ No newline at end of file
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -14,10 +14,13 @@ ...@@ -14,10 +14,13 @@
*/ */
export default { export default {
onCreate() { data: {
console.info('AceApplication onCreate'); title: ""
}, },
onDestroy() { onInit() {
console.info('AceApplication onDestroy'); this.title = this.$t('strings.world');
} }
}; }
/*
* 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package', '-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
}
}
return targetParams.trim()
}
export default {
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
},
onRun() {
console.log('OpenHarmonyTestRunner onRun run')
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
console.info('debug value : '+debug)
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + data.stdResult);
console.info('executeShellCommand : data : ' + data.exitCode);
})
}
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Core, ExpectExtend} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
* limitations under the License. * limitations under the License.
*/ */
require('./AudioCapturer.test.js') import audioCapturer from './AudioCapturer.test.js'
export default function testsuite() {
audioCapturer()
}
{ {
"string": [ "string": [
{ {
"name": "entry_MainAbility", "name": "app_name",
"value": "entry_MainAbility" "value": "JsHelloWorld"
}, },
{ {
"name": "mainability_description", "name": "mainability_description",
"value": "JS_Empty Ability" "value": "hap sample empty page"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
} }
] ]
} }
\ No newline at end of file
...@@ -25,7 +25,9 @@ ohos_js_hap_suite("audio_capturerchangeInfo_js_hap") { ...@@ -25,7 +25,9 @@ ohos_js_hap_suite("audio_capturerchangeInfo_js_hap") {
part_name = "multimedia_audio_framework" part_name = "multimedia_audio_framework"
} }
ohos_js_assets("audio_capturerchangeInfo_js_assets") { ohos_js_assets("audio_capturerchangeInfo_js_assets") {
source_dir = "./src/main/js/default" js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
} }
ohos_resources("audio_capturerchangeInfo_resources") { ohos_resources("audio_capturerchangeInfo_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
......
{ {
"description": "Configuration for audio manager Tests", "description": "Configuration for audio manager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "1500000", "test-timeout": "1500000",
"package": "ohos.acts.multimedia.audio.audiocapturerchangeInfo", "bundle-name": "ohos.acts.multimedia.audio.audiocapturerchangeInfo",
"package-name": "ohos.acts.multimedia.audio.audiocapturerchangeInfo",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
"kits": [ "kits": [
......
{ {
"app": { "app": {
"apiVersion": { "bundleName": "ohos.acts.multimedia.audio.audiocapturerchangeInfo",
"compatible": 6, "vendor": "example",
"releaseType": "Beta1", "version": {
"target": 7 "code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 5,
"target": 5,
"releaseType": "Beta1"
}
}, },
"vendor": "acts", "deviceConfig": {},
"bundleName": "ohos.acts.multimedia.audio.audiocapturerchangeInfo", "module": {
"version": { "package": "ohos.acts.multimedia.audio.audiocapturerchangeInfo",
"code": 1000000, "name": ".entry",
"name": "1.0.0" "deviceType": [
} "tablet",
}, "default",
"deviceConfig": { "phone"
"default": { ],
"debug": true "distro": {
} "deliveryWithInstall": true,
}, "moduleName": "entry",
"module": { "moduleType": "entry"
"abilities": [
{
"iconId": 16777218,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.audio.audiocapturerchangeInfo.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
}
],
"deviceType": [
"tablet",
"default",
"phone",
"tablet",
"tv",
"wearable"
],
"mainAbility": "ohos.acts.multimedia.audio.audiocapturerchangeInfo.MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"package": "ohos.acts.multimedia.audio.audiocapturerchangeInfo",
"name": ".MyApplication",
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
],
"reqPermissions": [
{
"name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
}, },
{ "reqPermissions": [
"name": "ohos.permission.MICROPHONE", {
"reason": "use ohos.permission.MICROPHONE" "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name": "ohos.permission.MICROPHONE",
"reason": "use ohos.permission.MICROPHONE"
},
{
"name": "ohos.permission.MANAGE_AUDIO_CONFIG",
"reason": "use ohos.permission.MANAGE_AUDIO_CONFIG"
}
],
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"formsEnabled": false,
"name": ".MainAbility",
"srcLanguage": "js",
"srcPath": "MainAbility",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
"label": "$string:MainAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
},
{
"orientation": "unspecified",
"formsEnabled": false,
"name": ".TestAbility",
"srcLanguage": "js",
"srcPath": "TestAbility",
"icon": "$media:icon",
"description": "$string:TestAbility_desc",
"label": "$string:TestAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
}, },
{ "mainAbility": ".MainAbility",
"name": "ohos.permission.MANAGE_AUDIO_CONFIG", "srcPath": ""
"reason": "use ohos.permission.MANAGE_AUDIO_CONFIG" }
}
]
}
} }
\ 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.
*/
export default {
onCreate() {
console.info("============== AceApplication onCreate ==============");
},
onDestroy() {
console.info('=============AceApplication onDestroy=============');
}
};
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
/*
* 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.
*/
<div class="container">
<text class="title">
Hello, World!
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* 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 file from '@system.file'
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')
},
onReady() {
},
}
/*
* 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('TestApplication onCreate')
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info("TestApplication onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
},
"Files": {
}
}
\ No newline at end of file
.container { .container {
display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
left: 0px;
top: 0px;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.title { .title {
font-size: 40px; font-size: 60px;
color: #000000; text-align: center;
opacity: 0.9; width: 100%;
} height: 40%;
margin: 10px;
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
} }
@media screen and (device-type: wearable) { @media screen and (device-type: phone) and (orientation: landscape) {
.title { .title {
font-size: 28px; font-size: 60px;
color: #FFFFFF;
} }
} }
@media screen and (device-type: tv) { @media screen and (device-type: tablet) and (orientation: landscape) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title { .title {
font-size: 100px; font-size: 100px;
color: #FFFFFF;
} }
} }
\ No newline at end of file
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -14,10 +14,13 @@ ...@@ -14,10 +14,13 @@
*/ */
export default { export default {
onCreate() { data: {
console.info('AceApplication onCreate'); title: ""
}, },
onDestroy() { onInit() {
console.info('AceApplication onDestroy'); this.title = this.$t('strings.world');
} }
}; }
/*
* 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package', '-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
}
}
return targetParams.trim()
}
export default {
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
},
onRun() {
console.log('OpenHarmonyTestRunner onRun run')
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
console.info('debug value : '+debug)
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + data.stdResult);
console.info('executeShellCommand : data : ' + data.exitCode);
})
}
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Core, ExpectExtend} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
...@@ -14,9 +14,11 @@ ...@@ -14,9 +14,11 @@
*/ */
import audio from '@ohos.multimedia.audio'; import audio from '@ohos.multimedia.audio';
import * as audioTestBase from '../../../../../AudioTestBase' import featureAbility from '@ohos.ability.featureAbility';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from '@ohos/hypium';
import { UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection, WindowMode, PointerMatrix } from '@ohos.uitest'
export default function audioCapturerChange() {
describe('audioCapturerChange', function () { describe('audioCapturerChange', function () {
let audioStreamManager; let audioStreamManager;
let audioStreamManagerCB; let audioStreamManagerCB;
...@@ -25,20 +27,35 @@ describe('audioCapturerChange', function () { ...@@ -25,20 +27,35 @@ describe('audioCapturerChange', function () {
const audioManager = audio.getAudioManager(); const audioManager = audio.getAudioManager();
console.info(`${Tag}: Create AudioManger Object JS Framework`); console.info(`${Tag}: Create AudioManger Object JS Framework`);
async function getPermission() {
let permissions = ['ohos.permission.MICROPHONE'];
featureAbility.getContext().requestPermissionsFromUser(permissions, 0, (data) => {
console.info("request success" + JSON.stringify(data));
})
}
async function driveFn() {
console.info(`come in driveFn`)
let driver = await UiDriver.create()
console.info(`driver is ${JSON.stringify(driver)}`)
await sleep(2000)
console.info(`UiDriver start`)
let button = await driver.findComponent(BY.text('允许'))
console.info(`button is ${JSON.stringify(button)}`)
await sleep(5000)
await button.click()
}
beforeAll(async function () { beforeAll(async function () {
console.info(`AudioFrameworkTest: beforeAll: Prerequisites at the test suite level`); await getPermission();
let permissionName1 = 'ohos.permission.MICROPHONE'; sleep(2000)
let permissionName2 = 'ohos.permission.MANAGE_AUDIO_CONFIG'; await driveFn();
let permissionNameList = [permissionName1,permissionName2]; await sleep(5000);
let appName = 'ohos.acts.multimedia.audio.audiocapturerchangeInfo';
await audioTestBase.applyPermission(appName, permissionNameList);
await sleep(100);
console.info(`AudioFrameworkTest: beforeAll: END`);
await sleep(100);
audioStreamManager = audioManager.getStreamManager(); audioStreamManager = audioManager.getStreamManager();
audioStreamManagerCB = audioManager.getStreamManager(); audioStreamManagerCB = audioManager.getStreamManager();
await sleep(1000); console.info('TestLog: Start Testing AudioFrameworkTest Interfaces');
console.info(`${Tag}: beforeAll: END`);
}) })
beforeEach(async function () { beforeEach(async function () {
...@@ -1624,3 +1641,4 @@ describe('audioCapturerChange', function () { ...@@ -1624,3 +1641,4 @@ describe('audioCapturerChange', function () {
}) })
}) })
}
\ No newline at end of file
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
* limitations under the License. * limitations under the License.
*/ */
require('./AudioCapturerChangeInfo.test.js') import audioCapturerChange from './AudioCapturerChangeInfo.test.js'
export default function testsuite() {
audioCapturerChange()
}
{ {
"string": [ "string": [
{ {
"name": "entry_MainAbility", "name": "app_name",
"value": "entry_MainAbility" "value": "JsHelloWorld"
}, },
{ {
"name": "mainability_description", "name": "mainability_description",
"value": "JS_Empty Ability" "value": "hap sample empty page"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
} }
] ]
} }
\ No newline at end of file
...@@ -25,10 +25,10 @@ describe('audioRendererChange', function () { ...@@ -25,10 +25,10 @@ describe('audioRendererChange', function () {
console.info(`${Tag} : Create AudioManger Object JS Framework`); console.info(`${Tag} : Create AudioManger Object JS Framework`);
beforeAll(async function () { beforeAll(async function () {
audioStreamManager = AUDIOMANAGER.getStreamManager(); audioStreamManager = AUDIOMANAGER.getStreamManager();
audioStreamManagerCB = AUDIOMANAGER.getStreamManager(); audioStreamManagerCB = AUDIOMANAGER.getStreamManager();
await sleep(1000); await sleep(1000);
console.info(`${Tag} : beforeAll: Prerequisites at the test suite level`); console.info(`${Tag} : beforeAll: Prerequisites at the test suite level`);
}) })
......
/*
* 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 abilityAccessCtrl from '@ohos.abilityAccessCtrl';
import bundle from '@ohos.bundle';
import account from '@ohos.account.osAccount';
// apply permission for test hap
export async function applyPermission(applictionName, permissionNames) {
let userId = await account.getAccountManager().getOsAccountLocalIdFromProcess();
console.info(`userid is :${userId}`)
let appInfo = await bundle.getApplicationInfo(applictionName, 0, userId);
let atManager = abilityAccessCtrl.createAtManager();
if (atManager != null) {
let tokenID = appInfo.accessTokenId;
console.info(`[permission] case accessTokenID is ${tokenID}`);
for (let i = 0; i < permissionNames.length; i++) {
await atManager.grantUserGrantedPermission(tokenID, permissionNames[i], 1).then((result) => {
console.info(`[permission] case grantUserGrantedPermission success : ${result}`);
}).catch((err) => {
console.info(`[permission] case grantUserGrantedPermission failed : ${err}`);
});
}
} else {
console.info(`[permission] case apply permission failed, createAtManager failed`);
}
}
\ No newline at end of file
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
{ {
"type": "ShellKit", "type": "ShellKit",
"run-command": [ "run-command": [
"hilog -Q pidoff",
"mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.audio.audiointerrupt/haps/entry/files/", "mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.audio.audiointerrupt/haps/entry/files/",
"mkdir -p /data/app/el2/100/base/com.example.audiorenderinterrupt/haps/entry/files/", "mkdir -p /data/app/el2/100/base/com.example.audiorenderinterrupt/haps/entry/files/",
"chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.audio.audiointerrupt/haps/entry", "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.audio.audiointerrupt/haps/entry",
......
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
} }
], ],
"deviceType": [ "deviceType": [
"default", "tablet",
"tablet" "default"
], ],
"mainAbility": "ohos.acts.multimedia.audio.audiointerrupt.MainAbility", "mainAbility": "ohos.acts.multimedia.audio.audiointerrupt.MainAbility",
"distro": { "distro": {
...@@ -67,52 +67,6 @@ ...@@ -67,52 +67,6 @@
"autoDesignWidth": true "autoDesignWidth": true
} }
} }
], ]
"reqPermissions": [
{
"name": "ohos.permission.GET_BUNDLE_INFO",
"reason": "use ohos.permission.GET_BUNDLE_INFO"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason": "use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"name": "ohos.permission.MEDIA_LOCATION",
"reason": "use ohos.permission.MEDIA_LOCATION"
},
{
"name": "ohos.permission.READ_MEDIA",
"reason": "use ohos.permission.READ_MEDIA"
},
{
"name": "ohos.permission.WRITE_MEDIA",
"reason": "use ohos.permission.WRITE_MEDIA"
},
{
"name": "ohos.permission.MICROPHONE",
"reason": "use ohos.permission.MICROPHONE"
},
{
"name": "ohos.permission.ACCESS_NOTIFICATION_POLICY",
"reason": "use ohos.permission.ACCESS_NOTIFICATION_POLICY"
},
{
"name": "ohos.permission.MODIFY_AUDIO_SETTINGS",
"reason": "use ohos.permission.MODIFY_AUDIO_SETTINGS"
},
{
"name": "ohos.permission.MANAGE_AUDIO_CONFIG",
"reason": "use ohos.permission.MANAGE_AUDIO_CONFIG"
}
]
} }
} }
\ No newline at end of file
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
"name": ".entry", "name": ".entry",
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"deviceType": [ "deviceType": [
"default", "tablet",
"tablet" "default"
], ],
"distro": { "distro": {
"deliveryWithInstall": true, "deliveryWithInstall": true,
...@@ -68,4 +68,4 @@ ...@@ -68,4 +68,4 @@
} }
] ]
} }
} }
\ No newline at end of file
...@@ -25,7 +25,9 @@ ohos_js_hap_suite("audio_manager_js_hap") { ...@@ -25,7 +25,9 @@ ohos_js_hap_suite("audio_manager_js_hap") {
part_name = "multimedia_audio_framework" part_name = "multimedia_audio_framework"
} }
ohos_js_assets("audio_manager_js_assets") { ohos_js_assets("audio_manager_js_assets") {
source_dir = "./src/main/js/default" js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
} }
ohos_resources("audio_manager_resources") { ohos_resources("audio_manager_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
......
{ {
"description": "Configuration for audio manager Tests", "description": "Configuration for audio manager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "1500000", "test-timeout": "1500000",
"package": "ohos.acts.multimedia.audio.audiomanager", "bundle-name": "ohos.acts.multimedia.audio.audiomanager",
"package-name": "ohos.acts.multimedia.audio.audiomanager",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
"kits": [ "kits": [
......
{ {
"app": { "app": {
"apiVersion": { "bundleName": "ohos.acts.multimedia.audio.audiomanager",
"compatible": 6, "vendor": "example",
"releaseType": "Beta1", "version": {
"target": 7 "code": 1,
}, "name": "1.0"
"vendor": "acts", },
"bundleName": "ohos.acts.multimedia.audio.audiomanager", "apiVersion": {
"version": { "compatible": 5,
"code": 1000000, "target": 5,
"name": "1.0.0" "releaseType": "Beta1"
}
},
"deviceConfig": {
"default": {
"debug": true
}
},
"module": {
"abilities": [
{
"iconId": 16777218,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.audio.audiomanager.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
}
],
"deviceType": [
"tablet",
"default",
"phone",
"tablet",
"tv",
"wearable"
],
"mainAbility": "ohos.acts.multimedia.audio.audiomanager.MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"package": "ohos.acts.multimedia.audio.audiomanager",
"name": ".MyApplication",
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
],
"reqPermissions": [
{
"name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name": "ohos.permission.MICROPHONE",
"reason": "use ohos.permission.MICROPHONE"
},
{
"name": "ohos.permission.ACCESS_NOTIFICATION_POLICY",
"reason": "use ohos.permission.ACCESS_NOTIFICATION_POLICY"
},
{
"name": "ohos.permission.MODIFY_AUDIO_SETTINGS",
"reason": "use ohos.permission.MODIFY_AUDIO_SETTINGS"
},
{
"name": "ohos.permission.MANAGE_AUDIO_CONFIG",
"reason": "use ohos.permission.MANAGE_AUDIO_CONFIG"
} }
] },
} "deviceConfig": {},
"module": {
"package": "ohos.acts.multimedia.audio.audiomanager",
"name": ".entry",
"deviceType": [
"tablet",
"default",
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"reqPermissions": [
{
"name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name": "ohos.permission.MICROPHONE",
"reason": "use ohos.permission.MICROPHONE"
},
{
"name": "ohos.permission.ACCESS_NOTIFICATION_POLICY",
"reason": "use ohos.permission.ACCESS_NOTIFICATION_POLICY"
},
{
"name": "ohos.permission.MODIFY_AUDIO_SETTINGS",
"reason": "use ohos.permission.MODIFY_AUDIO_SETTINGS"
},
{
"name": "ohos.permission.MANAGE_AUDIO_CONFIG",
"reason": "use ohos.permission.MANAGE_AUDIO_CONFIG"
}
],
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"formsEnabled": false,
"name": ".MainAbility",
"srcLanguage": "js",
"srcPath": "MainAbility",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
"label": "$string:MainAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
},
{
"orientation": "unspecified",
"formsEnabled": false,
"name": ".TestAbility",
"srcLanguage": "js",
"srcPath": "TestAbility",
"icon": "$media:icon",
"description": "$string:TestAbility_desc",
"label": "$string:TestAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
},
"mainAbility": ".MainAbility",
"srcPath": ""
}
} }
\ 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.
*/
export default {
onCreate() {
console.info("============== AceApplication onCreate ==============");
},
onDestroy() {
console.info('=============AceApplication onDestroy=============');
}
};
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
/*
* 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.
*/
<div class="container">
<text class="title">
Hello, World!
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* 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 file from '@system.file'
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')
},
onReady() {
},
}
/*
* 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('TestApplication onCreate')
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info("TestApplication onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
},
"Files": {
}
}
\ No newline at end of file
.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;
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
\ 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.
*/
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
/*
* 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package', '-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
}
}
return targetParams.trim()
}
export default {
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
},
onRun() {
console.log('OpenHarmonyTestRunner onRun run')
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
console.info('debug value : '+debug)
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + data.stdResult);
console.info('executeShellCommand : data : ' + data.exitCode);
})
}
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Core, ExpectExtend} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
...@@ -13,5 +13,12 @@ ...@@ -13,5 +13,12 @@
* limitations under the License. * limitations under the License.
*/ */
require('./AudioFramework.test.js') import audioFramework from './AudioFramework.test.js'
require('./AudioManagerApi9.test.js') import audioManagerApi9 from './AudioManagerApi9.test.js'
export default function testsuite() {
audioFramework()
audioManagerApi9()
}
{ {
"string": [ "string": [
{ {
"name": "entry_MainAbility", "name": "app_name",
"value": "entry_MainAbility" "value": "JsHelloWorld"
}, },
{ {
"name": "mainability_description", "name": "mainability_description",
"value": "JS_Empty Ability" "value": "hap sample empty page"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
} }
] ]
} }
\ No newline at end of file
...@@ -25,7 +25,9 @@ ohos_js_hap_suite("audio_voip_js_hap") { ...@@ -25,7 +25,9 @@ ohos_js_hap_suite("audio_voip_js_hap") {
part_name = "multimedia_audio_framework" part_name = "multimedia_audio_framework"
} }
ohos_js_assets("audio_voip_js_assets") { ohos_js_assets("audio_voip_js_assets") {
source_dir = "./src/main/js/default" js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
} }
ohos_resources("audio_voip_resources") { ohos_resources("audio_voip_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
......
{ {
"description": "Configuration for audio manager Tests", "description": "Configuration for audio manager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "550000", "test-timeout": "550000",
"package": "ohos.acts.multimedia.audio.audiovoip", "shell-timeout": "60000",
"shell-timeout": "60000" "testcase-timeout": 60000,
"bundle-name": "ohos.acts.multimedia.audio.audiovoip",
"package-name": "ohos.acts.multimedia.audio.audiovoip"
}, },
"kits": [ "kits": [
{ {
......
...@@ -19,29 +19,42 @@ ...@@ -19,29 +19,42 @@
}, },
"module": { "module": {
"abilities": [ "abilities": [
{ {
"iconId": 16777218, "skills": [
"skills": [ {
{ "entities": [
"entities": [ "entity.system.home"
"entity.system.home" ],
], "actions": [
"actions": [ "action.system.home"
"action.system.home" ]
] }
} ],
], "orientation": "unspecified",
"descriptionId": 16777217, "formsEnabled": false,
"visible": true, "name": ".MainAbility",
"labelId": 16777216, "srcLanguage": "js",
"icon": "$media:icon", "srcPath": "MainAbility",
"name": "ohos.acts.multimedia.audio.audiovoip.MainAbility", "icon": "$media:icon",
"description": "$string:mainability_description", "description": "$string:MainAbility_desc",
"label": "$string:entry_MainAbility", "label": "$string:MainAbility_label",
"type": "page", "type": "page",
"homeAbility": true, "visible": true,
"launchType": "standard" "launchType": "standard"
} },
{
"orientation": "unspecified",
"formsEnabled": false,
"name": ".TestAbility",
"srcLanguage": "js",
"srcPath": "TestAbility",
"icon": "$media:icon",
"description": "$string:TestAbility_desc",
"label": "$string:TestAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
}
], ],
"deviceType": [ "deviceType": [
"tablet", "tablet",
...@@ -51,7 +64,7 @@ ...@@ -51,7 +64,7 @@
"tv", "tv",
"wearable" "wearable"
], ],
"mainAbility": "ohos.acts.multimedia.audio.audiovoip.MainAbility", "mainAbility": ".MainAbility",
"distro": { "distro": {
"moduleType": "entry", "moduleType": "entry",
"installationFree": false, "installationFree": false,
...@@ -59,7 +72,8 @@ ...@@ -59,7 +72,8 @@
"moduleName": "entry" "moduleName": "entry"
}, },
"package": "ohos.acts.multimedia.audio.audiovoip", "package": "ohos.acts.multimedia.audio.audiovoip",
"name": ".MyApplication", "name": ".entry",
"srcPath":"",
"js": [ "js": [
{ {
"pages": [ "pages": [
...@@ -70,6 +84,16 @@ ...@@ -70,6 +84,16 @@
"designWidth": 720, "designWidth": 720,
"autoDesignWidth": true "autoDesignWidth": true
} }
},
{
"pages": [
"pages/index/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
} }
], ],
"reqPermissions": [ "reqPermissions": [
...@@ -82,9 +106,13 @@ ...@@ -82,9 +106,13 @@
"reason": "use ohos.permission.MICROPHONE" "reason": "use ohos.permission.MICROPHONE"
}, },
{ {
"name": "ohos.permission.MANAGE_AUDIO_CONFIG", "name": "ohos.permission.MANAGE_AUDIO_CONFIG",
"reason": "use ohos.permission.MANAGE_AUDIO_CONFIG" "reason": "use ohos.permission.MANAGE_AUDIO_CONFIG"
} }
] ],
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
}
} }
} }
\ 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('TestApplication onCreate');
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('TestApplication onDestroy');
}
};
/*
* 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 {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish');
},
onHide() {
console.info('onHide finish');
},
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import audioVoip from './AudioVOIP.test.js'
require('./AudioVOIP.test.js') export default function testsuite() {
audioVoip()
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册