提交 2f5c1c5a 编写于 作者: Y yuxiaoya2

Merge branch 'master' of https://gitee.com/yuxiaoya2/xts_acts

...@@ -18,8 +18,10 @@ group("actssupportfunction") { ...@@ -18,8 +18,10 @@ group("actssupportfunction") {
if (is_standard_system) { if (is_standard_system) {
deps = [ deps = [
"actssupportfunctiontest:ActsSupportFunctionTest", "actssupportfunctiontest:ActsSupportFunctionTest",
"faonandoffscreen:FaOnAndOffScreen",
"fasupportfunction:fasupportfunction", "fasupportfunction:fasupportfunction",
"fasupportfunctionthree:fasupportfunctionthree", "fasupportfunctionthree:fasupportfunctionthree",
"stageonandoffscreen:StageOnAndOffScreen",
"stagesupportfunction:StageSupportFunction", "stagesupportfunction:StageSupportFunction",
] ]
} }
......
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
"FaSupportFunction.hap", "FaSupportFunction.hap",
"FaSupportFunctionTwo.hap", "FaSupportFunctionTwo.hap",
"FaSupportFunctionThree.hap", "FaSupportFunctionThree.hap",
"StageSupportFunction.hap" "StageSupportFunction.hap",
"FaOnAndOffScreen.hap",
"StageOnAndOffScreen.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
......
...@@ -15,9 +15,11 @@ ...@@ -15,9 +15,11 @@
import abilityIsTerminatingTest from './AbilityIsTerminating.test'; import abilityIsTerminatingTest from './AbilityIsTerminating.test';
import faSetDisplayOrientation from './FaSetDisplayOrientation.test'; import faSetDisplayOrientation from './FaSetDisplayOrientation.test';
import faShowOnLock from './FaShowOnLock.test'; import faShowOnLock from './FaShowOnLock.test';
import onAndOffScreenTest from './OnAndOffScreenTest.test';
export default function testsuite() { export default function testsuite() {
abilityIsTerminatingTest(); abilityIsTerminatingTest();
faSetDisplayOrientation(); faSetDisplayOrientation();
faShowOnLock(); faShowOnLock();
onAndOffScreenTest();
} }
\ No newline at end of file
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap_assist_suite("FaOnAndOffScreen") {
hap_name = "FaOnAndOffScreen"
hap_profile = "./entry/src/main/config.json"
testonly = true
deps = [
":faonandoffscreen_resources",
":faonandoffscreen_ts_assets",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_js_assets("faonandoffscreen_ts_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_resources("faonandoffscreen_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"app": {
"bundleName": "ohos.acts.aafwk.test.faonandoffscreen",
"vendor": "huawei",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 9,
"target": 9
}
},
"deviceConfig": {},
"module": {
"package": "ohos.acts.aafwk.test.faonandoffscreen",
"name": ".entry",
"mainAbility": ".MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"formsEnabled": false,
"name": ".MainAbility",
"srcLanguage": "ets",
"srcPath": "MainAbility",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
"label": "$string:MainAbility_label",
"type": "page",
"visible": true,
"launchType": "singleton"
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import ability_featureAbility from '@ohos.ability.featureAbility';
import commonEvent from '@ohos.commonEvent';
var TAG1 = "Fa:FaOnAndOffScreen:MainAbility:";
var listPush1 = "FaOnAndOffScreen_MainAbility_";
var lifeList = [];
export default {
onCreate() {
console.log(TAG1 + 'onCreate');
lifeList.push('onCreate');
},
onDestroy() {
console.log(TAG1 + 'onDestroy');
},
onActive() {
console.log(TAG1 + 'onActive');
lifeList.push('onActive');
commonEvent.publish(listPush1 + "onActive", (err) => {
console.log(TAG1 + listPush1 + "onActive");
});
},
onInactive() {
console.log(TAG1 + 'onInactive');
lifeList.push('onInactive');
},
onShow() {
console.log(TAG1 + 'onShow');
lifeList.push('onShow');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "onShow", options, (err) => {
console.log(TAG1 + listPush1 + "onShow");
});
},
onHide() {
console.log(TAG1 + 'onHide');
lifeList.push('onHide');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "onHide", options, (err) => {
console.log(TAG1 + listPush1 + "onHide");
});
},
onNewWant(want) {
console.log(TAG1 + 'onNewWant');
}
}
\ 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.
*/
@Entry
@Component
struct Index {
@State message: string = 'Hello World FaOnAndOffScreen 1'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Row() {
Button() {
Text('FaOnAndOffScreen_MainAbility1')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('30%')
.height('5%')
.onClick(()=>{
})
}
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
{
"color": [
{
"name": "white",
"value": "#FFFFFF"
}
]
}
\ No newline at end of file
{
"string": [
{
"name": "entry_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "FaOnAndOffScreen"
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "ohos.acts.aafwk.test.stageonandoffscreen",
"vendor": "huawei",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name",
"distributedNotificationEnabled": true,
"debug": false,
"description" : "$string:app_name",
"keepAlive" : true,
"singleUser": true,
"minAPIVersion": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
{
"string": [
{
"name": "app_name",
"value": "actsfstageonandoffscreen"
}
]
}
# 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("//test/xts/tools/build/suite.gni")
ohos_hap_assist_suite("StageOnAndOffScreen") {
hap_name = "StageOnAndOffScreen"
hap_profile = "entry/src/main/module.json"
testonly = true
deps = [
":stageonandoffscreen_js_assets",
":stageonandoffscreen_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("stageonandoffscreen_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("stageonandoffscreen_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("stageonandoffscreen_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":stageonandoffscreen_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
/*
* 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 AbilityStage from "@ohos.application.AbilityStage";
var TAG0 = 'StageOnAndOffScreen:AbilityStage:';
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log(TAG0 + "onCreate")
}
}
\ No newline at end of file
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Ability from '@ohos.application.Ability';
import commonEvent from '@ohos.commonEvent';
var TAG1 = 'StageOnAndOffScreen:MainAbility:';
var listPush1 = "StageOnAndOffScreen_MainAbility_";
var lifeList = [];
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log(TAG1 + 'onCreate');
lifeList.push('onCreate');
}
onDestroy() {
console.log(TAG1 + 'onDestroy');
}
onWindowStageCreate(windowStage) {
console.log(TAG1 + 'onWindowStageCreate');
windowStage.loadContent("pages/index", (err, data) => {
if (err.code) {
console.log(TAG1 + 'Failed to load the content. Cause:' + JSON.stringify(err));
return;
}
console.log(TAG1 + 'Succeeded in loading the content. Data: ' + JSON.stringify(data));
});
}
onWindowStageDestroy() {
console.log(TAG1 + 'onWindowStageDestroy');
}
onForeground() {
console.log(TAG1 + 'onForeground');
lifeList.push('onForeground');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "onForeground", options, (err) => {
console.log(TAG1 + listPush1 + "onForeground");
});
}
onBackground() {
console.log(TAG1 + 'onBackground');
lifeList.push('onBackground');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "onBackground", options, (err) => {
console.log(TAG1 + listPush1 + "onBackground");
});
}
};
/*
* 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 Ability from '@ohos.application.Ability';
import commonEvent from '@ohos.commonEvent';
var TAG2 = 'StageOnAndOffScreen:MainAbility2:';
var listPush2 = "StageOnAndOffScreen_MainAbility2_";
export default class MainAbility2 extends Ability {
onCreate(want, launchParam) {
console.log(TAG2 + 'onCreate');
commonEvent.publish(listPush2 + "onCreate", (err) => {
console.log(TAG2 + listPush2 + "onCreate");
});
}
onDestroy() {
console.log(TAG2 + 'onDestroy');
commonEvent.publish(listPush2 + "onDestroy", (err) => {
console.log(TAG2 + listPush2 + "onDestroy");
});
}
onWindowStageCreate(windowStage) {
console.log(TAG2 + 'onWindowStageCreate');
commonEvent.publish(listPush2 + "onWindowStageCreate", (err) => {
console.log(TAG2 + listPush2 + "onWindowStageCreate");
});
windowStage.loadContent("pages/second", (err, data) => {
if (err.code) {
console.log(TAG2 + 'Failed to load the content. Cause:' + JSON.stringify(err));
return;
}
console.log(TAG2 + 'Succeeded in loading the content. Data: ' + JSON.stringify(data));
});
}
onWindowStageDestroy() {
console.log(TAG2 + 'onWindowStageDestroy');
commonEvent.publish(listPush2 + "onWindowStageDestroy", (err) => {
console.log(TAG2 + listPush2 + "onWindowStageDestroy");
});
}
onForeground() {
console.log(TAG2 + 'onForeground');
commonEvent.publish(listPush2 + "onForeground", (err) => {
console.log(TAG2 + listPush2 + "onForeground");
});
setTimeout(async () => {
let wantNum = {
bundleName: "ohos.acts.aafwk.test.stageonandoffscreen",
abilityName: "MainAbility3"
}
this.context.startAbility(wantNum).then((data) => {
console.log(TAG2 + "startAbility data = " + JSON.stringify(data));
}).catch((error) => {
console.log(TAG2 + "startAbility error = " + JSON.stringify(error));
})
}, 1000);
}
onBackground() {
console.log(TAG2 + 'onBackground');
commonEvent.publish(listPush2 + "onBackground", (err) => {
console.log(TAG2 + listPush2 + "onBackground");
});
}
};
/*
* 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 Ability from '@ohos.application.Ability';
import commonEvent from '@ohos.commonEvent';
var TAG3 = 'StageOnAndOffScreen:MainAbility3:';
var listPush3 = "StageOnAndOffScreen_MainAbility3_";
export default class MainAbility3 extends Ability {
onCreate(want, launchParam) {
console.log(TAG3 + 'onCreate');
}
onDestroy() {
console.log(TAG3 + 'onDestroy');
}
onWindowStageCreate(windowStage) {
console.log(TAG3 + 'onWindowStageCreate');
windowStage.loadContent("pages/third", (err, data) => {
if (err.code) {
console.log(TAG3 + 'Failed to load the content. Cause:' + JSON.stringify(err));
return;
}
console.log(TAG3 + 'Succeeded in loading the content. Data: ' + JSON.stringify(data));
});
}
onWindowStageDestroy() {
console.log(TAG3 + 'onWindowStageDestroy');
}
onForeground() {
console.log(TAG3 + 'onForeground');
commonEvent.publish(listPush3 + "onForeground", (err) => {
console.log(TAG3 + listPush3 + "onForeground");
});
}
onBackground() {
console.log(TAG3 + 'onBackground');
commonEvent.publish(listPush3 + "onBackground", (err) => {
console.log(TAG3 + listPush3 + "onBackground");
});
}
};
/*
* 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.
*/
@Entry
@Component
struct Index {
@State message: string = 'Hello World StageOnAndOffScreen 1'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Row() {
Button() {
Text('StageOnAndOffScreen_MainAbility1')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('30%')
.height('5%')
.onClick(()=>{
})
}
}
.width('100%')
}
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct Second {
@State message: string = 'Hello World StageOnAndOffScreen 2'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Row() {
Button() {
Text('StageOnAndOffScreen_MainAbility2')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('30%')
.height('5%')
.onClick(()=>{
})
}
}
.width('100%')
}
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct Third {
@State message: string = 'Hello World StageOnAndOffScreen 3'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Row() {
Button() {
Text('StageOnAndOffScreen_MainAbility3')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('30%')
.height('5%')
.onClick(()=>{
})
}
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
{
"module": {
"name": "entry",
"type": "entry",
"srcEntrance": "./ets/Application/MyAbilityStage.ts",
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
"phone"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:white",
"visible": true,
"launchType": "singleton",
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
},
{
"name": "MainAbility2",
"srcEntrance": "./ets/MainAbility2/MainAbility2.ts",
"description": "$string:MainAbility2_desc",
"icon": "$media:icon",
"label": "$string:MainAbility2_label",
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:white",
"visible": true,
"launchType": "singleton"
},
{
"name": "MainAbility3",
"srcEntrance": "./ets/MainAbility3/MainAbility3.ts",
"description": "$string:MainAbility3_desc",
"icon": "$media:icon",
"label": "$string:MainAbility3_label",
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:white",
"visible": true,
"launchType": "singleton"
}
]
}
}
\ No newline at end of file
{
"color": [
{
"name": "white",
"value": "#FFFFFF"
}
]
}
\ No newline at end of file
{
"string": [
{
"name": "entry_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "StageOnAndOffScreen"
},
{
"name": "MainAbility2_desc",
"value": "description"
},
{
"name": "MainAbility2_label",
"value": "label"
},
{
"name": "MainAbility3_desc",
"value": "description"
},
{
"name": "MainAbility3_label",
"value": "label"
}
]
}
\ No newline at end of file
...@@ -179,7 +179,8 @@ struct Index { ...@@ -179,7 +179,8 @@ struct Index {
let webPageHeight=this.controller.getPageHeight()+"" let webPageHeight=this.controller.getPageHeight()+""
setTimeout(()=>{ setTimeout(()=>{
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{ this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
Utils.emitEvent(webPageHeight==res,124) console.info("getPageHeight==>"+res)
Utils.emitEventTwo(res,webPageHeight,124)
}}) }})
},3000) },3000)
break; break;
...@@ -235,4 +236,4 @@ struct Index { ...@@ -235,4 +236,4 @@ struct Index {
} }
} }
} }
} }
\ No newline at end of file
...@@ -60,4 +60,59 @@ export default class Utils { ...@@ -60,4 +60,59 @@ export default class Utils {
console.info("webFlag emit action state err: " + JSON.stringify(err)); console.info("webFlag emit action state err: " + JSON.stringify(err));
} }
} }
static registerEventTwo(testCaseName,eventId,done){
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.actualValue).assertLarger(backData.data.expectedValue-100);
expect(backData.data.actualValue).assertLess(backData.data.expectedValue-(-100));
console.info(`[${testCaseName}] END`);
done()
}
let innerEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(innerEvent,callBack)
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
}
static emitEventTwo(expectedValue,actualValue,eventId){
try {
let backData = {
data: {
"expectedValue":expectedValue,
"actualValue":actualValue
}
}
let backEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
console.info("webFlag start to emit action state");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("webFlag emit action state err: " + JSON.stringify(err));
}
}
static registerContainEvent(testCaseName,expectedValue,eventId,done){
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.ACTION).assertContain(expectedValue);
console.info(`[${testCaseName}] END`);
done()
}
let innerEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(innerEvent,callBack)
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
}
} }
...@@ -19,7 +19,7 @@ import Utils from './Utils.ets'; ...@@ -19,7 +19,7 @@ import Utils from './Utils.ets';
let emitKey = "emitUserAgent"; let emitKey = "emitUserAgent";
export default function webJsunit() { export default function webJsunit() {
describe('ActsAceWebDevTest', function () { describe('ActsAceWebDevTest', function () {
beforeEach(async function () { beforeEach(async function (done) {
await Utils.sleep(2000); await Utils.sleep(2000);
console.info("web beforeEach start"); console.info("web beforeEach start");
done(); done();
...@@ -70,7 +70,7 @@ export default function webJsunit() { ...@@ -70,7 +70,7 @@ export default function webJsunit() {
*/ */
it('onUrlLoadIntercept',0,async function(done){ it('onUrlLoadIntercept',0,async function(done){
emitKey="emitOnRenderExited"; emitKey="emitOnRenderExited";
Utils.registerEvent("onUrlLoadIntercept","https://www.gitee.com",104,done); Utils.registerEvent("onUrlLoadIntercept","https://gitee.com/",104,done);
sendEventByKey('webcomponent',10,''); sendEventByKey('webcomponent',10,'');
}) })
/* /*
...@@ -100,7 +100,7 @@ export default function webJsunit() { ...@@ -100,7 +100,7 @@ export default function webJsunit() {
*/ */
it('loadUrl',0,async function(done){ it('loadUrl',0,async function(done){
emitKey="emitRunJavaScript"; emitKey="emitRunJavaScript";
Utils.registerEvent("loadUrl","基于Git的代码托管和研发协作平台--Gitee | Software Development and Collaboration Platform",110,done); Utils.registerContainEvent("loadUrl","代码托管和研发协作平台",110,done);
sendEventByKey('webcomponent',10,''); sendEventByKey('webcomponent',10,'');
}) })
/* /*
...@@ -168,7 +168,7 @@ export default function webJsunit() { ...@@ -168,7 +168,7 @@ export default function webJsunit() {
*/ */
it('getPageHeight',0,async function(done){ it('getPageHeight',0,async function(done){
emitKey="emitGetRequestFocus"; emitKey="emitGetRequestFocus";
Utils.registerEvent("getPageHeight","true",124,done); Utils.registerEventTwo("getPageHeight",124,done);
sendEventByKey('webcomponent',10,''); sendEventByKey('webcomponent',10,'');
}) })
/* /*
......
...@@ -29,14 +29,13 @@ ...@@ -29,14 +29,13 @@
] ]
}] }]
}], }],
"requestPermissions": [{ "requestPermissions": [
"name": "ohos.permission.SYSTEM_FLOAT_WINDOW", {
"reason": "need use ohos.permission.SYSTEM_FLOAT_WINDOW" "name": "ohos.permission.LOCATION"
}, },
{ {
"name": "ohos.permission.CAPTURE_SCREEN", "name": "ohos.permission.INTERNET"
"reason": "need use ohos.permission.SYSTEM_FLOAT_WINDOW"
} }
] ]
} }
} }
\ No newline at end of file
...@@ -5,9 +5,15 @@ ...@@ -5,9 +5,15 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>index</title> <title>index</title>
<style>
#pageHeight{
height:1300px
}
</style>
</head> </head>
<body> <body>
<div id="container">首页</div> <div id="container">首页</div>
<div id="pageHeight"></div>
</body> </body>
<script> <script>
function getUserAgent(){ function getUserAgent(){
...@@ -24,4 +30,4 @@ ...@@ -24,4 +30,4 @@
return height return height
} }
</script> </script>
</html> </html>
\ No newline at end of file
{ {
"app": { "app": {
"bundleName": "com.example.myapplication", "bundleName": "com.example.accessibilityxts",
"vendor": "huawei", "vendor": "huawei",
"versionCode": 1000000, "versionCode": 1000000,
"versionName": "1.0.0", "versionName": "1.0.0",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"driver": { "driver": {
"type": "OHJSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "600000", "test-timeout": "600000",
"bundle-name": "com.example.myapplication", "bundle-name": "com.example.accessibilityxts",
"module-name": "phone", "module-name": "phone",
"shell-timeout": "600000", "shell-timeout": "600000",
"testcase-timeout": 70000 "testcase-timeout": 70000
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
{ {
"type": "ShellKit", "type": "ShellKit",
"teardown-command":[ "teardown-command":[
"bm uninstall -n com.example.myapplication", "bm uninstall -n com.example.accessibilityxts",
"bm uninstall -n com.example.acetest" "bm uninstall -n com.example.acetest"
] ]
} }
......
...@@ -643,7 +643,7 @@ export class ElementTest { ...@@ -643,7 +643,7 @@ export class ElementTest {
console.info('ElementTest executeAttributeValuePromiseTriggerAction ' + caseName + ' start'); console.info('ElementTest executeAttributeValuePromiseTriggerAction ' + caseName + ' start');
let event = new accessibility.EventInfo({}); let event = new accessibility.EventInfo({});
event.type = 'click'; event.type = 'click';
event.bundleName = 'com.example.myapplication'; event.bundleName = 'com.example.accessibilityxts';
event.triggerAction = 'click'; event.triggerAction = 'click';
await accessibility.sendEvent(event); await accessibility.sendEvent(event);
console.info('ElementTest executeAttributeValuePromiseTriggerAction ' + caseName + ' sendEvent finish'); console.info('ElementTest executeAttributeValuePromiseTriggerAction ' + caseName + ' sendEvent finish');
...@@ -914,7 +914,7 @@ export class ElementTest { ...@@ -914,7 +914,7 @@ export class ElementTest {
console.info('ElementTest executeAttributeValueCallbackTriggerAction ' + caseName + ' start'); console.info('ElementTest executeAttributeValueCallbackTriggerAction ' + caseName + ' start');
let event = new accessibility.EventInfo({}); let event = new accessibility.EventInfo({});
event.type = 'click'; event.type = 'click';
event.bundleName = 'com.example.myapplication'; event.bundleName = 'com.example.accessibilityxts';
event.triggerAction = 'click'; event.triggerAction = 'click';
await accessibility.sendEvent(event); await accessibility.sendEvent(event);
console.info('ElementTest executeAttributeValueCallbackTriggerAction ' + caseName + ' sendEvent finish'); console.info('ElementTest executeAttributeValueCallbackTriggerAction ' + caseName + ' sendEvent finish');
......
...@@ -59,7 +59,7 @@ export default class OpenHarmonyTestRunner implements TestRunner { ...@@ -59,7 +59,7 @@ export default class OpenHarmonyTestRunner implements TestRunner {
onAbilityCreate: onAbilityCreateCallback, onAbilityCreate: onAbilityCreateCallback,
}; };
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a com.example.myapplication.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName var cmd = 'aa start -d 0 -a com.example.accessibilityxts.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"] var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true') if (debug == 'true')
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"uiSyntax": "ets", "uiSyntax": "ets",
"pages": "$profile:main_pages", "pages": "$profile:main_pages",
"abilities": [{ "abilities": [{
"name": "com.example.myapplication.MainAbility", "name": "com.example.accessibilityxts.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts", "srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:phone_entry_main", "description": "$string:phone_entry_main",
"icon": "$media:icon", "icon": "$media:icon",
......
{ {
"app": { "app": {
"bundleName": "com.example.myapplication", "bundleName": "com.example.accessibilityxts",
"vendor": "huawei", "vendor": "huawei",
"versionCode": 1000000, "versionCode": 1000000,
"versionName": "1.0.0", "versionName": "1.0.0",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"driver": { "driver": {
"type": "OHJSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "180000", "test-timeout": "180000",
"bundle-name": "com.example.myapplication", "bundle-name": "com.example.accessibilityxts",
"module-name": "phone", "module-name": "phone",
"shell-timeout": "600000", "shell-timeout": "600000",
"testcase-timeout": 70000 "testcase-timeout": 70000
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
{ {
"type": "ShellKit", "type": "ShellKit",
"teardown-command":[ "teardown-command":[
"bm uninstall -n com.example.myapplication", "bm uninstall -n com.example.accessibilityxts",
"bm uninstall -n com.example.acetest" "bm uninstall -n com.example.acetest"
] ]
} }
......
...@@ -59,7 +59,7 @@ export default class OpenHarmonyTestRunner implements TestRunner { ...@@ -59,7 +59,7 @@ export default class OpenHarmonyTestRunner implements TestRunner {
onAbilityCreate: onAbilityCreateCallback, onAbilityCreate: onAbilityCreateCallback,
}; };
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a com.example.myapplication.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName var cmd = 'aa start -d 0 -a com.example.accessibilityxts.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"] var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true') if (debug == 'true')
......
...@@ -17,7 +17,7 @@ import accessibility from '@ohos.accessibility' ...@@ -17,7 +17,7 @@ import accessibility from '@ohos.accessibility'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
export default function abilityTest() { export default function abilityTest() {
let targetBundleName = 'com.example.myapplication'; let targetBundleName = 'com.example.accessibilityxts';
let subScriber = undefined; let subScriber = undefined;
let isConnected: boolean = false; let isConnected: boolean = false;
let events: Array<any> = []; let events: Array<any> = [];
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"uiSyntax": "ets", "uiSyntax": "ets",
"pages": "$profile:main_pages", "pages": "$profile:main_pages",
"abilities": [{ "abilities": [{
"name": "com.example.myapplication.MainAbility", "name": "com.example.accessibilityxts.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts", "srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:phone_entry_main", "description": "$string:phone_entry_main",
"icon": "$media:icon", "icon": "$media:icon",
......
{ {
"app": { "app": {
"bundleName": "com.example.myapplication", "bundleName": "com.example.accessibilityxts",
"vendor": "huawei", "vendor": "huawei",
"versionCode": 1000000, "versionCode": 1000000,
"versionName": "1.0.0", "versionName": "1.0.0",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"driver": { "driver": {
"type": "OHJSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "180000", "test-timeout": "180000",
"bundle-name": "com.example.myapplication", "bundle-name": "com.example.accessibilityxts",
"module-name": "phone", "module-name": "phone",
"shell-timeout": "600000", "shell-timeout": "600000",
"testcase-timeout": 70000 "testcase-timeout": 70000
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
{ {
"type": "ShellKit", "type": "ShellKit",
"teardown-command":[ "teardown-command":[
"bm uninstall -n com.example.myapplication", "bm uninstall -n com.example.accessibilityxts",
"bm uninstall -n com.example.acetest" "bm uninstall -n com.example.acetest"
] ]
} }
......
...@@ -59,7 +59,7 @@ export default class OpenHarmonyTestRunner implements TestRunner { ...@@ -59,7 +59,7 @@ export default class OpenHarmonyTestRunner implements TestRunner {
onAbilityCreate: onAbilityCreateCallback, onAbilityCreate: onAbilityCreateCallback,
}; };
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a com.example.myapplication.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName var cmd = 'aa start -d 0 -a com.example.accessibilityxts.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"] var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true') if (debug == 'true')
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"uiSyntax": "ets", "uiSyntax": "ets",
"pages": "$profile:main_pages", "pages": "$profile:main_pages",
"abilities": [{ "abilities": [{
"name": "com.example.myapplication.MainAbility", "name": "com.example.accessibilityxts.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts", "srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:phone_entry_main", "description": "$string:phone_entry_main",
"icon": "$media:icon", "icon": "$media:icon",
......
{ {
"app": { "app": {
"bundleName": "com.example.myapplication", "bundleName": "com.example.accessibilityxts",
"vendor": "huawei", "vendor": "huawei",
"versionCode": 1000000, "versionCode": 1000000,
"versionName": "1.0.0", "versionName": "1.0.0",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"driver": { "driver": {
"type": "OHJSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "360000", "test-timeout": "360000",
"bundle-name": "com.example.myapplication", "bundle-name": "com.example.accessibilityxts",
"module-name": "phone", "module-name": "phone",
"shell-timeout": "600000", "shell-timeout": "600000",
"testcase-timeout": 70000 "testcase-timeout": 70000
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
{ {
"type": "ShellKit", "type": "ShellKit",
"teardown-command":[ "teardown-command":[
"bm uninstall -n com.example.myapplication", "bm uninstall -n com.example.accessibilityxts",
"bm uninstall -n com.example.acetest" "bm uninstall -n com.example.acetest"
] ]
} }
......
...@@ -59,7 +59,7 @@ export default class OpenHarmonyTestRunner implements TestRunner { ...@@ -59,7 +59,7 @@ export default class OpenHarmonyTestRunner implements TestRunner {
onAbilityCreate: onAbilityCreateCallback, onAbilityCreate: onAbilityCreateCallback,
}; };
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a com.example.myapplication.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName var cmd = 'aa start -d 0 -a com.example.accessibilityxts.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"] var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true') if (debug == 'true')
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"uiSyntax": "ets", "uiSyntax": "ets",
"pages": "$profile:main_pages", "pages": "$profile:main_pages",
"abilities": [{ "abilities": [{
"name": "com.example.myapplication.MainAbility", "name": "com.example.accessibilityxts.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts", "srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:phone_entry_main", "description": "$string:phone_entry_main",
"icon": "$media:icon", "icon": "$media:icon",
......
{ {
"app": { "app": {
"bundleName": "com.example.myapplication", "bundleName": "com.example.accessibilityxts",
"vendor": "huawei", "vendor": "huawei",
"versionCode": 1000000, "versionCode": 1000000,
"versionName": "1.0.0", "versionName": "1.0.0",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"driver": { "driver": {
"type": "OHJSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "180000", "test-timeout": "180000",
"bundle-name": "com.example.myapplication", "bundle-name": "com.example.accessibilityxts",
"module-name": "phone", "module-name": "phone",
"shell-timeout": "180000", "shell-timeout": "180000",
"testcase-timeout": 70000 "testcase-timeout": 70000
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
{ {
"type": "ShellKit", "type": "ShellKit",
"teardown-command":[ "teardown-command":[
"bm uninstall -n com.example.myapplication", "bm uninstall -n com.example.accessibilityxts",
"bm uninstall -n com.example.acetest" "bm uninstall -n com.example.acetest"
] ]
} }
......
...@@ -59,7 +59,7 @@ export default class OpenHarmonyTestRunner implements TestRunner { ...@@ -59,7 +59,7 @@ export default class OpenHarmonyTestRunner implements TestRunner {
onAbilityCreate: onAbilityCreateCallback, onAbilityCreate: onAbilityCreateCallback,
}; };
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a com.example.myapplication.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName var cmd = 'aa start -d 0 -a com.example.accessibilityxts.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"] var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true') if (debug == 'true')
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"uiSyntax": "ets", "uiSyntax": "ets",
"pages": "$profile:main_pages", "pages": "$profile:main_pages",
"abilities": [{ "abilities": [{
"name": "com.example.myapplication.MainAbility", "name": "com.example.accessibilityxts.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts", "srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:phone_entry_main", "description": "$string:phone_entry_main",
"icon": "$media:icon", "icon": "$media:icon",
......
...@@ -25,7 +25,7 @@ struct Index { ...@@ -25,7 +25,7 @@ struct Index {
onPageShow() { onPageShow() {
console.info(`TargetApp onPageShow start`); console.info(`TargetApp onPageShow start`);
config.enableAbility( config.enableAbility(
'com.example.myapplication/AccessibilityExtAbility', 'com.example.accessibilityxts/AccessibilityExtAbility',
["retrieve", "touchGuide", "gesture"] ["retrieve", "touchGuide", "gesture"]
).then(() => { ).then(() => {
console.info('TargetApp enableAbility finish'); console.info('TargetApp enableAbility finish');
...@@ -59,7 +59,7 @@ struct Index { ...@@ -59,7 +59,7 @@ struct Index {
return; return;
} }
config.disableAbility("com.example.myapplication/AccessibilityExtAbility").then(() => { config.disableAbility("com.example.accessibilityxts/AccessibilityExtAbility").then(() => {
console.info(`TargetApp disableAccAbility finish`); console.info(`TargetApp disableAccAbility finish`);
this.isEnable = false; this.isEnable = false;
}); });
......
...@@ -13,7 +13,11 @@ ...@@ -13,7 +13,11 @@
* limitations under the License. * limitations under the License.
*/ */
import bluetoothhostTest from './BluetoothBle.test.js' import bluetoothBLETest from './BleGattManager.test.js'
import bluetoothBLETest1 from './BleService.test.js'
import bluetoothBLETest2 from './BleAdvertiser.test.js'
export default function testsuite() { export default function testsuite() {
bluetoothhostTest() bluetoothBLETest()
bluetoothBLETest1()
bluetoothBLETest2()
} }
...@@ -17,4 +17,4 @@ ...@@ -17,4 +17,4 @@
"cleanup-apps": true "cleanup-apps": true
} }
] ]
} }
\ No newline at end of file
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import bluetooth from '@ohos.bluetooth';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
export default function bluetoothhostTest2() {
describe('bluetoothhostTest2', function() {
function sleep(delay) {
return new Promise(resovle => setTimeout(resovle, delay))
}
async function tryToEnableBt() {
let sta = bluetooth.getState();
switch(sta){
case 0:
bluetooth.enableBluetooth();
await sleep(5000);
let sta1 = bluetooth.getState();
console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1));
break;
case 1:
console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta));
await sleep(3000);
break;
case 2:
console.info('[bluetooth_js] bt turn on:'+ JSON.stringify(sta));
break;
case 3:
bluetooth.enableBluetooth();
await sleep(3000);
let sta2 = bluetooth.getState();
console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2));
break;
default:
console.info('[bluetooth_js] enable success');
}
}
beforeAll(function () {
console.info('beforeAll called')
})
beforeEach(async function(done) {
console.info('beforeEach called')
await tryToEnableBt()
done()
})
afterEach(function () {
console.info('afterEach called')
})
afterAll(function () {
console.info('afterAll called')
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0200
* @tc.name testStartpair
* @tc.desc Test pairDevice of use vailded address.
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 0
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0200', 0, async function (done) {
function PinRequiredParam(data) {
console.info("[bluetooth_js] pinRequired on:" + JSON.stringify(data));
bluetooth.setDevicePairingConfirmation(data.deviceId,false);
}
bluetooth.BLE.on('pinRequired', PinRequiredParam);
let result = bluetooth.pairDevice("SSS");
console.info("[bluetooth_js] onStartpair -> " + JSON.stringify(result));
expect(result).assertFalse();
bluetooth.BLE.off('pinRequired', PinRequiredParam);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0300
* @tc.name test getRemoteDeviceName
* @tc.desc Test get RemoteDeviceName
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 3
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0300', 0, async function (done) {
let ret = bluetooth.getRemoteDeviceName("00:00:00:00:00:00");
console.info('[bluetooth_js] getRemoteDeviceName ret2:' + JSON.stringify(ret));
expect(ret.length).assertEqual(0);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0400
* @tc.name test getRemoteDeviceClass
* @tc.desc Test get RemoteDeviceClass
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 1
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0400', 0, async function (done) {
let MajorMinorClass = {
COMPUTER_UNCATEGORIZED : 0x0100,COMPUTER_DESKTOP : 0x0104,
COMPUTER_SERVER : 0x0108,COMPUTER_LAPTOP : 0x010C,
COMPUTER_HANDHELD_PC_PDA : 0x0110,COMPUTER_PALM_SIZE_PC_PDA : 0x0114,
COMPUTER_WEARABLE : 0x0118,COMPUTER_TABLET : 0x011C,
PHONE_UNCATEGORIZED : 0x0200,PHONE_CELLULAR : 0x0204,
PHONE_CORDLESS : 0x0208,PHONE_SMART : 0x020C,
PHONE_MODEM_OR_GATEWAY : 0x0210,PHONE_ISDN : 0x0214,
NETWORK_FULLY_AVAILABLE : 0x0300,NETWORK_1_TO_17_UTILIZED : 0x0320,
NETWORK_17_TO_33_UTILIZED : 0x0340,NETWORK_33_TO_50_UTILIZED : 0x0360,
NETWORK_60_TO_67_UTILIZED : 0x0380,NETWORK_67_TO_83_UTILIZED : 0x03A0,
NETWORK_83_TO_99_UTILIZED : 0x03C0,NETWORK_NO_SERVICE : 0x03E0,
AUDIO_VIDEO_UNCATEGORIZED : 0x0400,AUDIO_VIDEO_WEARABLE_HEADSET: 0x0404,
AUDIO_VIDEO_HANDSFREE : 0x0408,AUDIO_VIDEO_MICROPHONE : 0x0410,
AUDIO_VIDEO_LOUDSPEAKER : 0x0414,AUDIO_VIDEO_HEADPHONES : 0x0418,
AUDIO_VIDEO_PORTABLE_AUDIO : 0x041C,AUDIO_VIDEO_CAR_AUDIO : 0x0420,
AUDIO_VIDEO_SET_TOP_BOX : 0x0424,AUDIO_VIDEO_HIFI_AUDIO : 0x0428,
AUDIO_VIDEO_VCR : 0x042C,AUDIO_VIDEO_VIDEO_CAMERA : 0x0430,
AUDIO_VIDEO_CAMCORDER : 0x0434,AUDIO_VIDEO_VIDEO_MONITOR : 0x0438,
AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER : 0x043C,
AUDIO_VIDEO_VIDEO_CONFERENCING : 0x0440,AUDIO_VIDEO_VIDEO_GAMING_TOY: 0x0448,
PERIPHERAL_NON_KEYBOARD_NON_POINTING : 0x0500,
PERIPHERAL_KEYBOARD : 0x0540,PERIPHERAL_POINTING_DEVICE : 0x0580,
PERIPHERAL_KEYBOARD_POINTING : 0x05C0,PERIPHERAL_UNCATEGORIZED : 0x0500,
PERIPHERAL_JOYSTICK : 0x0504,PERIPHERAL_GAMEPAD : 0x0508,
PERIPHERAL_REMOTE_CONTROL : 0x05C0,PERIPHERAL_SENSING_DEVICE : 0x0510,
PERIPHERAL_DIGITIZER_TABLET : 0x0514,
PERIPHERAL_CARD_READER : 0x0518,PERIPHERAL_DIGITAL_PEN : 0x051C,
PERIPHERAL_SCANNER_RFID : 0x0520,PERIPHERAL_GESTURAL_INPUT : 0x0522,
IMAGING_UNCATEGORIZED : 0x0600,IMAGING_DISPLAY : 0x0610,
IMAGING_CAMERA : 0x0620,IMAGING_SCANNER : 0x0640,
IMAGING_PRINTER : 0x0680,WEARABLE_UNCATEGORIZED : 0x0700,
WEARABLE_WRIST_WATCH : 0x0704,WEARABLE_PAGER : 0x0708,
WEARABLE_JACKET : 0x070C,WEARABLE_HELMET : 0x0710,
WEARABLE_GLASSES : 0x0714,TOY_UNCATEGORIZED : 0x0800,
TOY_ROBOT : 0x0804,TOY_VEHICLE : 0x0808,
TOY_DOLL_ACTION_FIGURE : 0x080C,TOY_CONTROLLER : 0x0810,
TOY_GAME : 0x0814,HEALTH_UNCATEGORIZED : 0x0900,
HEALTH_BLOOD_PRESSURE : 0x0904,HEALTH_THERMOMETER : 0x0908,
HEALTH_WEIGHING : 0x090C,HEALTH_GLUCOSE : 0x0910,
HEALTH_PULSE_OXIMETER : 0x0914,HEALTH_PULSE_RATE : 0x0918,
HEALTH_DATA_DISPLAY : 0x091C,HEALTH_STEP_COUNTER : 0x0920,
HEALTH_BODY_COMPOSITION_ANALYZER : 0x0924,
HEALTH_PEAK_FLOW_MOITOR : 0x0928,HEALTH_MEDICATION_MONITOR : 0x092C,
HEALTH_KNEE_PROSTHESIS : 0x0930,HEALTH_ANKLE_PROSTHESIS : 0x0934,
HEALTH_GENERIC_HEALTH_MANAGER : 0x0938,
HEALTH_PERSONAL_MOBILITY_DEVICE : 0x093C,
HEALTH_PERSONAL_MOBILITY_DEVICE : 0x093C
};
let MajorClass = {
MAJOR_MISC : 0x0000,MAJOR_COMPUTER : 0x0100,
MAJOR_PHONE : 0x0200,MAJOR_NETWORKING : 0x0300,
MAJOR_AUDIO_VIDEO: 0x0400,MAJOR_PERIPHERAL : 0x0500,
MAJOR_IMAGING : 0x0600,MAJOR_WEARABLE : 0x0700,
MAJOR_TOY : 0x0800,MAJOR_HEALTH : 0x0900,
MAJOR_UNCATEGORIZED : 0x1F00
};
let DeviceClass = bluetooth.getRemoteDeviceClass("00:00:00:00:00:00");
console.info('[bluetooth_js] getRemoteDeviceClass ret2 :' + JSON.stringify(DeviceClass)
+ 'majorClass:' +DeviceClass.majorClass + 'majorMinorClass:'+ DeviceClass.majorMinorClass
+ 'classOfDevice:' + DeviceClass.classOfDevice);
expect(DeviceClass.majorClass).assertEqual(0);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0500
* @tc.name test getRemoteDeviceClass
* @tc.desc Test get getRemoteDeviceClass
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 3
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0500', 0, async function (done) {
let ret = bluetooth.getRemoteDeviceName("1125445");
console.info('[bluetooth_js] getRemoteDeviceName ret2:' + JSON.stringify(ret));
expect(ret.length).assertEqual(0);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0600
* @tc.name test getPairedDevices
* @tc.desc Test get getPairedDevices
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 3
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0600', 0, async function (done) {
let ret = bluetooth.getPairedDevices();
console.info('[bluetooth_js] getPairedDevices ret2:' + JSON.stringify(ret));
expect(ret.length).assertEqual(0);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0700
* @tc.name test pinRequired
* @tc.desc Test pinRequired and setDevicePairing false
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 3
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0700', 0, async function (done) {
function PinRequiredParam(data) {
console.info("[bluetooth_js] pinRequired on:" + JSON.stringify(data));
bluetooth.setDevicePairingConfirmation(data.deviceId,false);
}
bluetooth.BLE.on('pinRequired', PinRequiredParam);
let result = bluetooth.pairDevice("00:00:00:00:00:00");
console.info("[bluetooth_js] onStartpair007 -> " + JSON.stringify(result));
expect(result).assertTrue();
bluetooth.BLE.off('pinRequired', PinRequiredParam);
done()
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0800
* @tc.name test pinRequired
* @tc.desc Test pinRequired and setDevicePairing true
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 3
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0800', 0, async function (done) {
function PinRequiredParam(data) {
console.info("[bluetooth_js] pinRequired on:" + JSON.stringify(data));
bluetooth.setDevicePairingConfirmation(data.deviceId,true);
}
bluetooth.BLE.on('pinRequired', PinRequiredParam);
let result = bluetooth.pairDevice("00:00:00:00:00:00");
console.info("[bluetooth_js] onStartpair008 -> " + JSON.stringify(result));
expect(result).assertTrue();
bluetooth.BLE.off('pinRequired', PinRequiredParam);
done()
})
})
}
...@@ -13,9 +13,15 @@ ...@@ -13,9 +13,15 @@
* limitations under the License. * limitations under the License.
*/ */
import bluetoothTEST from './BluetoothADD.test.js' import bluetoothTEST from './BluetoothOn.test.js'
import bluetoothhostTest from './BluetoothOn.test.js' import bluetoothhostTest from './BleScanResult.test.js'
import bluetoothhostTest2 from './BluetoothPair.test.js'
import bluetoothhostTest1 from './bluetoothProfileAdd.test.js'
import bluetoothhostTest4 from './bluetoothSys.test.js'
export default function testsuite() { export default function testsuite() {
bluetoothTEST()
bluetoothhostTest() bluetoothhostTest()
bluetoothTEST() bluetoothhostTest2()
bluetoothhostTest1()
bluetoothhostTest4()
} }
/*
* 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 bluetooth from '@ohos.bluetooth';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
export default function bluetoothhostTest1() {
describe('bluetoothhostTest1', function() {
beforeAll(function () {
console.info('beforeAll called')
})
beforeEach(function () {
console.info('beforeEach called')
})
afterEach(function () {
console.info('afterEach called')
})
afterAll(function () {
console.info('afterAll called')
})
function sleep(delay) {
return new Promise(resovle => setTimeout(resovle, delay))
}
async function tryToEnableBt() {
let sta = bluetooth.getState();
switch(sta){
case 0:
console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta));
bluetooth.enableBluetooth();
await sleep(3000);
break;
case 1:
console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta));
await sleep(3000);
break;
case 2:
console.info('[bluetooth_js] bt turn on:'+ JSON.stringify(sta));
break;
case 3:
console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta));
bluetooth.enableBluetooth();
await sleep(3000);
break;
default:
console.info('[bluetooth_js] enable success');
}
}
/**
* @tc.number SUB_COMMUNACATION_bluetooth_GET_BT_CONNECT_STATE_0001
* @tc.name testClassicGetBtConnectionState
* @tc.desc Test ClassicGetBtConnectionState api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it('SUB_COMMUNACATION_bluetooth_GET_BT_CONNECT_STATE_0001', 0, async function (done) {
console.info('[bluetooth_js] get connection state start');
await tryToEnableBt();
let ProfileConnectionState=
{
STATE_CONNECTING : 1,
STATE_CONNECTED : 2,
STATE_DISCONNECTED : 0,
STATE_DISCONNECTING : 3,
};
let connState = bluetooth.getBtConnectionState();
console.info('[bluetooth_js] get bt connection state result' + JSON.stringify(connState));
expect(connState).assertEqual(ProfileConnectionState.STATE_DISCONNECTED);
expect(true).assertTrue(ProfileConnectionState.STATE_CONNECTING!= connState );
expect(true).assertTrue(ProfileConnectionState.STATE_CONNECTED!= connState );
expect(true).assertTrue(ProfileConnectionState.STATE_DISCONNECTING!= connState );
done();
})
})
}
/*
* 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 bluetooth from '@ohos.bluetooth';
import bluetoothsys from '@system.bluetooth';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
export default function bluetoothhostTest4() {
describe('bluetoothhostTest4', function() {
function sleep(delay) {
return new Promise(resovle => setTimeout(resovle, delay))
}
async function tryToEnableBt() {
let sta = bluetooth.getState();
switch(sta){
case 0:
bluetooth.enableBluetooth();
await sleep(5000);
let sta1 = bluetooth.getState();
console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1));
break;
case 1:
console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta));
await sleep(3000);
break;
case 2:
console.info('[bluetooth_js] bt turn on:'+ JSON.stringify(sta));
break;
case 3:
bluetooth.enableBluetooth();
await sleep(3000);
let sta2 = bluetooth.getState();
console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2));
break;
default:
console.info('[bluetooth_js] enable success');
}
}
beforeAll(function () {
console.info('beforeAll called')
})
beforeEach(async function(done) {
console.info('beforeEach called')
await tryToEnableBt()
done()
})
afterEach(function () {
console.info('afterEach called')
})
afterAll(function () {
console.info('afterAll called')
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_SUBSCRIBE_BLEFound_0001
* @tc.name testsubscribeBLEFound
* @tc.desc Test subscribeBLEFound api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it('SUB_COMMUNACATION_bluetooth_SUBSCRIBE_BLEFound_0001', 0, async function (done) {
bluetoothsys.startBLEScan({
interval:0,
success() {
console.log('[bluetooth_js] startBLEScan1 success.');
bluetoothsys.subscribeBLEFound({
success(data) {
console.log('[bluetooth_js] bluetooth.subscribeBLEFound1 success.');
const [device] = data.devices;
console.log('[bluetooth_js] devices:'+ JSON.stringify(data.devices) + 'length:' + data.devices.length);
expect(true).assertTrue(data.devices.length >=0);
for (let i = 0; i < data.devices.length; i++) {
console.log(`subscribeBLEFound device, addrType: ${data.devices[i].addrType}`);
console.log(`subscribeBLEFound device, addr: ${data.devices[i].addr}`);
console.log(`subscribeBLEFound device, rssi: ${data.devices[i].rssi}`);
console.log(`subscribeBLEFound device, txpower: ${data.devices[i].txpower}`);
console.log(`subscribeBLEFound device, data: ${data.devices[i].data}`);
}
},
fail(code, data) {
console.log('[bluetooth_js] subscribeBLEFound1 failed code:'+ code + 'data:'+data);
}
});
sleep(3000);
bluetoothsys.unsubscribeBLEFound();
bluetoothsys.stopBLEScan({
success() {
console.log('[bluetooth_js] stopBLEScan success.');
},
fail(data, code) {
console.log('[bluetooth_js] stopBLEScan failed code:'+ code + 'data:'+data);
},
complete() {
console.log('[bluetooth_js] stopBLEScan complete.');
}
});
},
fail(code, data) {
console.log('[bluetooth_js] startBLEScan1 failed code:'+ code + 'data:'+data);
},
complete() {
console.log('[bluetooth_js] startBLEScan1 complete.');
}
});
done();
})
})
}
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
"test-timeout": "600000", "test-timeout": "600000",
"shell-timeout": "600000", "shell-timeout": "600000",
"bundle-name": "ohos.acts.communication.bluetooth.bluetoothhost", "bundle-name": "ohos.acts.communication.bluetooth.bluetoothhost",
"package-name": "ohos.acts.communication.bluetooth.bluetoothhost" "package-name": "ohos.acts.communication.bluetooth.bluetoothhost",
"testcase-timeout": 70000
}, },
"kits": [ "kits": [
{ {
...@@ -16,4 +17,4 @@ ...@@ -16,4 +17,4 @@
"cleanup-apps": true "cleanup-apps": true
} }
] ]
} }
\ No newline at end of file
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import bluetooth from '@ohos.bluetooth';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
let ScanMode =
{
SCAN_MODE_NONE : 0,
SCAN_MODE_CONNECTABLE : 1,
SCAN_MODE_GENERAL_DISCOVERABLE : 2,
SCAN_MODE_LIMITED_DISCOVERABLE : 3,
SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE : 4,
SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE : 5,
}
export default function bluetoothhostTest3() {
describe('bluetoothhostTest3', function() {
function sleep(delay) {
return new Promise(resovle => setTimeout(resovle, delay))
}
async function tryToEnableBt() {
let sta = bluetooth.getState();
switch(sta){
case 0:
bluetooth.enableBluetooth();
await sleep(5000);
let sta1 = bluetooth.getState();
console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1));
break;
case 1:
console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta));
await sleep(3000);
break;
case 2:
console.info('[bluetooth_js] bt turn on:'+ JSON.stringify(sta));
break;
case 3:
bluetooth.enableBluetooth();
await sleep(3000);
let sta2 = bluetooth.getState();
console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2));
break;
default:
console.info('[bluetooth_js] enable success');
}
}
beforeAll(function () {
console.info('beforeAll called')
})
beforeEach(async function(done) {
console.info('beforeEach called')
await tryToEnableBt()
done()
})
afterEach(function () {
console.info('afterEach called')
})
afterAll(function () {
console.info('afterAll called')
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Discovery_0100
* @tc.name TEST DISCOVERY
* @tc.desc TEST DISCOVERY
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 0
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_Discovery_0100', 0, async function (done) {
function onReceiveEvent(data){
console.info('[bluetooth_js] Device' + JSON.stringify(data)+
'length' + data.length);
expect(true).assertTrue(data.length > 0);
}
bluetooth.on("bluetoothDeviceFind", onReceiveEvent);
let result = bluetooth.startBluetoothDiscovery();
await sleep(3000);
console.info('[bluetooth_js] startDiscovery'+result);
expect(result).assertTrue();
bluetooth.off('bluetoothDeviceFind', onReceiveEvent);
result = bluetooth.stopBluetoothDiscovery();
console.info('[bluetooth_js] stopDiscovery'+result);
expect(true).assertTrue();
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Discovery_0300
* @tc.name TEST DISCOVERY
* @tc.desc TEST DISCOVERY api 8.
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 1
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_Discovery_0300', 0, async function (done) {
let result1 = bluetooth.setBluetoothScanMode(ScanMode.SCAN_MODE_CONNECTABLE,10);
expect(result1).assertTrue();
let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] getScanMode = '+ JSON.stringify(getScanMode));
expect(true).assertEqual(getScanMode == ScanMode.SCAN_MODE_CONNECTABLE);
let result = bluetooth.startBluetoothDiscovery();
await sleep(2000);
console.info('[bluetooth_js] startDiscovery1'+result);
expect(result).assertTrue();
let result2 = bluetooth.startBluetoothDiscovery();
console.info('[bluetooth_js] startDiscovery2'+result2);
expect(result2).assertFalse();
done();
})
})
}
/*
* 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 bluetooth from '@ohos.bluetooth';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
let ScanMode =
{
SCAN_MODE_NONE : 0,
SCAN_MODE_CONNECTABLE : 1,
SCAN_MODE_GENERAL_DISCOVERABLE : 2,
SCAN_MODE_LIMITED_DISCOVERABLE : 3,
SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE : 4,
SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE : 5,
}
export default function bluetoothhostTest2() {
describe('bluetoothhostTest2', function() {
function sleep(delay) {
return new Promise(resovle => setTimeout(resovle, delay))
}
async function tryToEnableBt() {
let sta = bluetooth.getState();
switch(sta){
case 0:
bluetooth.enableBluetooth();
await sleep(5000);
let sta1 = bluetooth.getState();
console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1));
break;
case 1:
console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta));
await sleep(3000);
break;
case 2:
console.info('[bluetooth_js] bt turn on:'+ JSON.stringify(sta));
break;
case 3:
bluetooth.enableBluetooth();
await sleep(3000);
let sta2 = bluetooth.getState();
console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2));
break;
default:
console.info('[bluetooth_js] enable success');
}
}
beforeAll(function () {
console.info('beforeAll called')
})
beforeEach(async function(done) {
console.info('beforeEach called')
await tryToEnableBt()
done()
})
afterEach(function () {
console.info('afterEach called')
})
afterAll(function () {
console.info('afterAll called')
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0100
* @tc.name TEST scanmode
* @tc.desc TEST scanmode api by promise.
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 2
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0100', 0, async function (done) {
let oldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0100 oldScanMode = '+ JSON.stringify(oldScanMode));
let result = bluetooth.setBluetoothScanMode(ScanMode.SCAN_MODE_NONE,0);
expect(result).assertTrue();
let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0100 newscanmode = '+ JSON.stringify(getScanMode));
expect(true).assertEqual(getScanMode == ScanMode.SCAN_MODE_NONE);
result=bluetooth.setBluetoothScanMode(oldScanMode,0);
expect(result).assertTrue();
let getOldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0100 setoldscanmode = '+ JSON.stringify(getOldScanMode));
expect(true).assertEqual(oldScanMode == getOldScanMode);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0200
* @tc.name TEST scanmode
* @tc.desc TEST scanmode api by promise.
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 2
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0200', 0, async function (done) {
let oldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0200 oldScanMode = '+ JSON.stringify(oldScanMode));
let result = bluetooth.setBluetoothScanMode(ScanMode.SCAN_MODE_LIMITED_DISCOVERABLE,0);
expect(result).assertTrue();
let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0200 newscanmode = '+ JSON.stringify(getScanMode));
expect(true).assertEqual(getScanMode == ScanMode.SCAN_MODE_LIMITED_DISCOVERABLE);
result=bluetooth.setBluetoothScanMode(oldScanMode,0);
expect(result).assertTrue();
let getOldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0200 setoldscanmode = '+ JSON.stringify(getOldScanMode));
expect(true).assertEqual(oldScanMode == getOldScanMode);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0300
* @tc.name TEST scanmode
* @tc.desc TEST scanmode api by promise.
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 3
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0300', 0, async function (done) {
let oldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0200 oldScanMode = '+ JSON.stringify(oldScanMode));
let result = bluetooth.setBluetoothScanMode(ScanMode.SCAN_MODE_LIMITED_DISCOVERABLE,40000);
expect(result).assertTrue();
let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0200 getScanMode = '+ JSON.stringify(getScanMode));
expect(true).assertEqual(getScanMode == ScanMode.SCAN_MODE_LIMITED_DISCOVERABLE);
result=bluetooth.setBluetoothScanMode(oldScanMode,0);
expect(result).assertTrue();
let getOldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0200 getOldScanMode = '+ JSON.stringify(getOldScanMode));
expect(true).assertEqual(oldScanMode == getOldScanMode);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0400
* @tc.name TEST scanmode
* @tc.desc TEST scanmode api by promise.
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 1
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0400', 0, async function (done) {
let oldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0400 oldScanMode = '+ JSON.stringify(oldScanMode));
let result = bluetooth.setBluetoothScanMode(ScanMode.SCAN_MODE_GENERAL_DISCOVERABLE,40000);
expect(result).assertTrue();
let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0400 getScanMode = '+ JSON.stringify(getScanMode));
expect(true).assertEqual(getScanMode == ScanMode.SCAN_MODE_GENERAL_DISCOVERABLE);
result=bluetooth.setBluetoothScanMode(oldScanMode,0);
expect(result).assertTrue();
let getOldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0400 getOldScanMode = '+ JSON.stringify(getOldScanMode));
expect(true).assertEqual(oldScanMode == getOldScanMode);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0500
* @tc.name TEST scanmode
* @tc.desc TEST scanmode api by promise.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0500', 0, async function (done) {
let oldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0500 oldScanMode = '+ JSON.stringify(oldScanMode));
let result = bluetooth.setBluetoothScanMode(ScanMode.SCAN_MODE_GENERAL_DISCOVERABLE,0);
expect(result).assertTrue();
let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0500 getScanMode = '+ JSON.stringify(getScanMode));
expect(true).assertEqual(getScanMode == ScanMode.SCAN_MODE_GENERAL_DISCOVERABLE);
result=bluetooth.setBluetoothScanMode(oldScanMode,0);
expect(result).assertTrue();
let getOldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0500 getOldScanMode = '+ JSON.stringify(getOldScanMode));
expect(true).assertEqual(oldScanMode == getOldScanMode);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0600
* @tc.name TEST scanmode
* @tc.desc TEST scanmode api by promise.
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 1
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0600', 0, async function (done) {
let oldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0600 oldScanMode = '+ JSON.stringify(oldScanMode));
let result = bluetooth.setBluetoothScanMode(ScanMode.SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE,0);
expect(result).assertTrue();
let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0600 getScanMode = '+ JSON.stringify(getScanMode));
expect(true).assertEqual(getScanMode == ScanMode.SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE);
result=bluetooth.setBluetoothScanMode(oldScanMode,0);
expect(result).assertTrue();
let getOldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0600 getOldScanMode = '+ JSON.stringify(getOldScanMode));
expect(true).assertEqual(oldScanMode == getOldScanMode);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0700
* @tc.name TEST scanmode
* @tc.desc TEST scanmode api by promise.
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 2
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0700', 0, async function (done) {
let oldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0700 oldScanMode = '+ JSON.stringify(oldScanMode));
let result = bluetooth.setBluetoothScanMode(ScanMode.SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE,20000);
expect(result).assertTrue();
let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0700 getScanMode = '+ JSON.stringify(getScanMode));
expect(true).assertEqual(getScanMode == ScanMode.SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE);
result=bluetooth.setBluetoothScanMode(oldScanMode,0);
expect(result).assertTrue();
let getOldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0700 getOldScanMode = '+ JSON.stringify(getOldScanMode));
expect(true).assertEqual(oldScanMode == getOldScanMode);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0800
* @tc.name TEST scanmode
* @tc.desc TEST scanmode api by promise.
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 1
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0800', 0, async function (done) {
let oldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0800 oldScanMode = '+ JSON.stringify(oldScanMode));
let result = bluetooth.setBluetoothScanMode(ScanMode.SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE,0);
expect(result).assertTrue();
let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0800 getScanMode = '+ JSON.stringify(getScanMode));
expect(true).assertEqual(getScanMode == ScanMode.SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE);
result=bluetooth.setBluetoothScanMode(oldScanMode,0);
expect(result).assertTrue();
let getOldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0800 getOldScanMode = '+ JSON.stringify(getOldScanMode));
expect(true).assertEqual(oldScanMode == getOldScanMode);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0900
* @tc.name TEST scanmode
* @tc.desc TEST scanmode api by promise.
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 3
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0900', 0, async function (done) {
let oldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0900 oldScanMode = '+ JSON.stringify(oldScanMode));
let result = bluetooth.setBluetoothScanMode(ScanMode.SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE,30000);
expect(result).assertTrue();
let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0900 getScanMode = '+ JSON.stringify(getScanMode));
expect(true).assertEqual(getScanMode == ScanMode.SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE);
result=bluetooth.setBluetoothScanMode(oldScanMode,0);
expect(result).assertTrue();
let getOldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0900 getOldScanMode = '+ JSON.stringify(getOldScanMode));
expect(true).assertEqual(oldScanMode == getOldScanMode);
done();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_1000
* @tc.name TEST scanmode
* @tc.desc TEST scanmode api by promise.
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 4
*/
it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_1000', 0, async function (done) {
let oldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_1000 oldScanMode = '+ JSON.stringify(oldScanMode));
let result = bluetooth.setBluetoothScanMode(-1,0);
expect(result).assertFalse();
let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_1000 getScanMode = '+ JSON.stringify(getScanMode));
expect(true).assertEqual(getScanMode == oldScanMode);
done();
})
})
}
...@@ -13,7 +13,15 @@ ...@@ -13,7 +13,15 @@
* limitations under the License. * limitations under the License.
*/ */
import bluetoothhostTest from './Bluetooth.test.js' import bluetoothhostTest from './BRSwitch.test.js'
import bluetoothhostTest1 from './BRSetLocalName.test.js'
import bluetoothhostTest2 from './BRScanMode.test.js'
import bluetoothhostTest3 from './BRDiscovery.test.js'
import bluetoothhostTest4 from './BRSpp.test.js'
export default function testsuite() { export default function testsuite() {
bluetoothhostTest() bluetoothhostTest()
bluetoothhostTest1()
bluetoothhostTest2()
bluetoothhostTest3()
bluetoothhostTest4()
} }
...@@ -860,7 +860,7 @@ describe('I18nTest', function () { ...@@ -860,7 +860,7 @@ describe('I18nTest', function () {
expect(name).assertEqual('和暦'); expect(name).assertEqual('和暦');
let timezone = calendar.getTimeZone(); let timezone = calendar.getTimeZone();
console.log('i18n_test_7920 ' + timezone); console.log('i18n_test_7920 ' + timezone);
expect(timezone).assertContain('Time'); expect(timezone.length > 0).assertTrue();
let firstday = calendar.getFirstDayOfWeek(); let firstday = calendar.getFirstDayOfWeek();
console.log('i18n_test_7920 ' + firstday); console.log('i18n_test_7920 ' + firstday);
expect(firstday).assertEqual(1); expect(firstday).assertEqual(1);
......
...@@ -189,7 +189,7 @@ describe('LangTest', function () { ...@@ -189,7 +189,7 @@ describe('LangTest', function () {
let timezone = I18n.getTimeZone(); let timezone = I18n.getTimeZone();
let value = timezone.getID(); let value = timezone.getID();
console.log('timezone_test_0100 ' + value); console.log('timezone_test_0100 ' + value);
expect(value == 'UTC' || value == 'Asia/Shanghai' || value == 'GMT').assertTrue(); expect(value.length > 0).assertTrue();
}) })
/* * /* *
......
...@@ -21,6 +21,7 @@ group("multimedia") { ...@@ -21,6 +21,7 @@ group("multimedia") {
"camera/camera_js_standard:camera_standard_ets_hap", "camera/camera_js_standard:camera_standard_ets_hap",
"image/image_js_standard/image:image_js_hap", "image/image_js_standard/image:image_js_hap",
"image/image_js_standard/imageColorspace:image_colorspace_js_hap", "image/image_js_standard/imageColorspace:image_colorspace_js_hap",
"image/image_js_standard/imageCreator:image_creator_js_hap",
"image/image_js_standard/imageDecodeOptions:image_DecodeOptions_js_hap", "image/image_js_standard/imageDecodeOptions:image_DecodeOptions_js_hap",
"image/image_js_standard/imageExif:image_exif_js_hap", "image/image_js_standard/imageExif:image_exif_js_hap",
"image/image_js_standard/imageModifyProperty:image_modifyProperty_js_hap", "image/image_js_standard/imageModifyProperty:image_modifyProperty_js_hap",
......
...@@ -21,6 +21,8 @@ ohos_js_hap_suite("audio_manager_js_hap") { ...@@ -21,6 +21,8 @@ ohos_js_hap_suite("audio_manager_js_hap") {
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAudioManagerJsTest" hap_name = "ActsAudioManagerJsTest"
subsystem_name = "multimedia"
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" source_dir = "./src/main/js/default"
......
...@@ -742,51 +742,6 @@ describe('audioEM', function () { ...@@ -742,51 +742,6 @@ describe('audioEM', function () {
}); });
}) })
/* *
* @tc.number : SUB_AUDIO_MANAGER_DeviceType_001
* @tc.name : DeviceType - INVALID
* @tc.desc : DeviceType - INVALID
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_DeviceType_001', 0, async function (done) {
expect(audio.DeviceType.INVALID).assertEqual(0);
await sleep(50);
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_DeviceType_002
* @tc.name : DeviceType - WIRED_HEADSET
* @tc.desc : DeviceType - WIRED_HEADSET
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_DeviceType_002', 0, async function (done) {
expect(audio.DeviceType.WIRED_HEADSET).assertEqual(3);
await sleep(50);
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_DeviceType_003
* @tc.name : DeviceType - USB_HEADSET
* @tc.desc : DeviceType - USB_HEADSET
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_DeviceType_003', 0, async function (done) {
var resultflag = false;
if (audio.DeviceType.USB_HEADSET == 22 || audio.DeviceType.USB_HEADSET == undefined)
resultflag = true;
expect(resultflag).assertTrue();
await sleep(50);
done();
})
/* * /* *
* @tc.number : SUB_AUDIO_MANAGER_DeviceChangeType_001 * @tc.number : SUB_AUDIO_MANAGER_DeviceChangeType_001
* @tc.name : DeviceChangeType - CONNECT * @tc.name : DeviceChangeType - CONNECT
......
...@@ -22,6 +22,8 @@ ohos_js_hap_suite("camera_standard_ets_hap") { ...@@ -22,6 +22,8 @@ ohos_js_hap_suite("camera_standard_ets_hap") {
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsCameraStandardETSTest" hap_name = "ActsCameraStandardETSTest"
subsystem_name = "multimedia"
part_name = "multimedia_camera_standard"
} }
ohos_js_assets("camera_ets_assets") { ohos_js_assets("camera_ets_assets") {
source_dir = "./src/main/ets/MainAbility" source_dir = "./src/main/ets/MainAbility"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# 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("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
...@@ -21,6 +21,8 @@ ohos_js_hap_suite("image_js_hap") { ...@@ -21,6 +21,8 @@ ohos_js_hap_suite("image_js_hap") {
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsImageJsTest" hap_name = "ActsImageJsTest"
subsystem_name = "multimedia"
part_name = "multimedia_image_standard"
} }
ohos_js_assets("image_js_assets") { ohos_js_assets("image_js_assets") {
js2abc = true js2abc = true
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# 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("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
...@@ -21,6 +21,8 @@ ohos_js_hap_suite("image_colorspace_js_hap") { ...@@ -21,6 +21,8 @@ ohos_js_hap_suite("image_colorspace_js_hap") {
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsImageColorspaceJsTest" hap_name = "ActsImageColorspaceJsTest"
subsystem_name = "multimedia"
part_name = "multimedia_image_standard"
} }
ohos_js_assets("image_colorspace_js_assets") { ohos_js_assets("image_colorspace_js_assets") {
js2abc = true js2abc = true
......
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册