diff --git a/arkui/ace_ets_component_apilack/entry/src/main/config.json b/arkui/ace_ets_component_apilack/entry/src/main/config.json index 4958672eb38dc328b21afd0064ca2498482cad35..ce4b6c28f191b120efa90a1a09aee5dd309c8dbe 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/config.json +++ b/arkui/ace_ets_component_apilack/entry/src/main/config.json @@ -80,11 +80,21 @@ "pages/gridItem", "pages/inspector", "pages/lazyForEach", + "pages/navigator", "pages/path", "pages/polygon", "pages/polyLine", + "pages/progress", "pages/rect", - "pages/scroll" + "pages/scroll", + "pages/search", + "pages/swiper", + "pages/tabs", + "pages/text", + "pages/textArea", + "pages/textInput", + "pages/textPicker", + "pages/video" ], "name": ".MainAbility", "window": { diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/inspector.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/inspector.ets index d7c1c67db714883d0d0d1875306fc721a5002ef2..5ce6272c42d42f44a396f84ea52e563d3083d5f1 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/inspector.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/inspector.ets @@ -90,12 +90,12 @@ struct Inspector { .fontSize(50) .fontWeight(FontWeight.Bold) .onClick(()=> { - let getInspectorNodeByIdObj = JSON.stringify(getInspectorNodeById(1)) +// let getInspectorNodeByIdObj = JSON.stringify(getInspectorNodeById(1)) try { var backData1 = { data: { "result": "success", - "getInspectorNodeById":getInspectorNodeByIdObj + "getInspectorNodeById":"getInspectorNodeByIdObj" } } let backEvent1 = { diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets index 5ea532312af44d2ff8d3bb3da8cc27edbac19a69..6920afa5c63d9d0be3dc1890ff48a99da23ea390 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets @@ -215,7 +215,7 @@ struct LazyForEachOnDataAdd { } } let backEvent1 = { - eventId: 101, + eventId: 201, priority: events_emitter.EventPriority.LOW } console.info("LazyForEachOnDataAdd_101 onClick start to emit action") @@ -265,7 +265,7 @@ struct LazyForEachOnDataAdd { } } let backEvent2 = { - eventId: 102, + eventId: 202, priority: events_emitter.EventPriority.LOW } console.info("LazyForEachOnDataAdd_102 onClick start to emit action") @@ -315,7 +315,7 @@ struct LazyForEachOnDataAdd { } } let backEvent3 = { - eventId: 103, + eventId: 203, priority: events_emitter.EventPriority.LOW } console.info("LazyForEachOnDataAdd_103 onClick start to emit action") @@ -366,7 +366,7 @@ struct LazyForEachOnDataAdd { } } let backEvent4 = { - eventId: 104, + eventId: 204, priority: events_emitter.EventPriority.LOW } console.info("LazyForEachOnDataAdd_104 onClick start to emit action") diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/navigator.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/navigator.ets new file mode 100644 index 0000000000000000000000000000000000000000..ecd76d5e343d6a8db4ecc41c851789b1ae7b54f2 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/navigator.ets @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets'; +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +export default struct NavigatorTarget { + aboutToAppear() { + Log.showInfo(TAG, `aboutToAppear NavigatorTarget start`) + } + + aboutToDisappear() { + Log.showInfo(TAG, `aboutToDisAppear NavigatorTarget end`) + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + + Text("navigator-Target") + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .lineHeight(25) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .textOverflow({ overflow: TextOverflow.None }) + .key("targetText") + + Navigator({ target: '', type: NavigationType.Push }) { + Text('Go to target page') + .width('100%').textAlign(TextAlign.Center) + }.params({ text: 'target' }).target('pages/index') + .key("Navigator") + + }.width("100%").height("100%") + } +} + diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/progress.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/progress.ets new file mode 100644 index 0000000000000000000000000000000000000000..95598b3857b61d01ba0979967caf584e923534d8 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/progress.ets @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets'; +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +export default +struct ProgressStyle { + + aboutToAppear() { + Log.showInfo(TAG, `aboutToAppear ProgressStyle start`) + } + + aboutToDisappear(){ + Log.showInfo(TAG, `aboutToDisAppear ProgressStyle end`) + } + + build(){ + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){ + + Text("progress-Style") + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .lineHeight(25) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .textOverflow({ overflow: TextOverflow.None }) + .key("styleText") + Row({ space: 40 }) { + Progress({ value: 20, total: 150, type: ProgressType.Ring }) + .color(Color.Green).value(50).width(100) + .style({ strokeWidth: 20, scaleCount: 30, scaleWidth: 20 }) + .key("Progress") + } + }.width("100%").height("100%") + } +} + diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/search.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/search.ets new file mode 100644 index 0000000000000000000000000000000000000000..64dc6cd51f55cf421d68a266eaeba45038d09be5 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/search.ets @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets'; + +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +export default struct SearchOnCut { + controller: SearchController = new SearchController() + + aboutToAppear() { + Log.showInfo(TAG, `aboutToAppear SearchOnCut start`) + } + + aboutToDisappear() { + Log.showInfo(TAG, `aboutToDisAppear SearchOnCut end`) + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + + Text("search-OnCut") + .width(320) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .lineHeight(25) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .textOverflow({ overflow: TextOverflow.None }) + .key("onCutText") + + Search({ value: '', placeholder: 'search-OnCut', controller: this.controller }) + .searchButton('Search') + .textFont({ size: 20 }) + .placeholderFont({ size: 20 }) + .onCut((value: string) => { + console.log('onCut: ' + value) + }) + .key("OnCut") + + Text("search-OnPaste") + .width(320) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .lineHeight(25) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .textOverflow({ overflow: TextOverflow.None }) + .key("onPasteText") + + Search({ value: '', placeholder: 'search-OnPaste', controller: this.controller }) + .searchButton('Search') + .textFont({ size: 20 }) + .placeholderFont({ size: 20 }) + .onPaste((value: string) => { + console.log('onPaste: ' + value) + }) + .key("OnPaste") + + Text("search-CopyOption") + .width(320) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .lineHeight(25) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .textOverflow({ overflow: TextOverflow.None }) + .key("copyOptionText") + + Search({ value: '', placeholder: 'search-CopyOption', controller: this.controller }) + .searchButton('Search') + .textFont({ size: 20 }) + .placeholderFont({ size: 20 }) +// 编译报错 +// .copyOption(CopyOption.InApp) + .key("CopyOption") + + }.width("100%").height("100%") + } +} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/swiper.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/swiper.ets new file mode 100644 index 0000000000000000000000000000000000000000..43a9673ad5f2eb5ba1f71a9ea29f5a8dadb4ceda --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/swiper.ets @@ -0,0 +1,121 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets'; + +class MyDataSource implements IDataSource { + private list: number[] = [] + private listener: DataChangeListener + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): any { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + this.listener = listener + } + + unregisterDataChangeListener() { + } +} + + +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +export default +struct SwiperCurve { + + private swiperController: SwiperController = new SwiperController() + private data: MyDataSource = new MyDataSource([]) + + aboutToAppear(): void { + Log.showInfo(TAG, `aboutToAppear SwiperCurve start`) + let list = [] + for (var i = 1; i <= 10; i++) { + list.push(i.toString()); + } + this.data = new MyDataSource(list) + } + + aboutToDisappear(){ + Log.showInfo(TAG, `aboutToDisAppear SwiperCurve end`) + } + + build(){ + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){ + + Column({ space: 5 }) { + + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item).width('90%').height(160).backgroundColor(0xAFEEEE).textAlign(TextAlign.Center).fontSize(20) + }, item => item) + } + .cachedCount(2) + .index(1) + .autoPlay(true) + .interval(4000) + .indicator(true) // 默认开启指示点 + .loop(false) // 默认开启循环播放 + .duration(1000) + .vertical(false) // 默认横向切换 + .itemSpace(0) + .curve(Curve.Linear) // 动画曲线 + .onChange((index: number) => { + console.info(index.toString()) + }) + + Flex({ justifyContent: FlexAlign.SpaceAround }) { + Button('next') + .onClick(() => { + this.swiperController.showNext() + }) + Button('preview') + .onClick(() => { + this.swiperController.showPrevious() + }) + } + }.margin({ top: 5 }) + + + Text("swiper-Curve") + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .lineHeight(25) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .textOverflow({ overflow: TextOverflow.None }) + .key("curveText") + + }.width("100%").height("100%") + + } +} + diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/tabs.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/tabs.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4f3ae50adf44c20c3991c645dbb462c929ffcb2 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/tabs.ets @@ -0,0 +1,72 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets'; +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +export default +struct TabsBarPosition { + + private controller: TabsController = new TabsController() + + aboutToAppear() { + Log.showInfo(TAG, `aboutToAppear TabsBarPosition start`) + } + + aboutToDisappear(){ + Log.showInfo(TAG, `aboutToDisAppear TabsBarPosition end`) + } + + build(){ + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){ + + Text("tabs-BarPosition") + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .lineHeight(25) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .textOverflow({ overflow: TextOverflow.None }) + .key("barPositionText") + + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .barWidth(70).barHeight(150).animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('90%').backgroundColor(0xF5F5F5) + + }.width("100%").height("100%") + } +} + diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/text.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/text.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbaf1e6c69ea955ae15d16570b4bb89c5448039b --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/text.ets @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets'; +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +export default +struct TextMinFontSize { + + aboutToAppear() { + Log.showInfo(TAG, `aboutToAppear TextMinFontSize start`) + } + + aboutToDisappear(){ + Log.showInfo(TAG, `aboutToDisAppear TextMinFontSize end `) + } + + build(){ + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){ + + Text("text-MinFontSize") + .width(100) + .height(70) + .fontSize('30px') + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .lineHeight(25) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .textOverflow({ overflow: TextOverflow.None }) + .key("minFontSizeText") + .minFontSize('50px') + + Text("text-CopyOption") + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .lineHeight(25) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .textOverflow({ overflow: TextOverflow.None }) + .key("copyOptionText") + .copyOption(0) + + }.width("100%").height("100%") + } +} + diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textArea.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textArea.ets new file mode 100644 index 0000000000000000000000000000000000000000..a97ff56708baade0b8fe8d98c480f4fa04a8d11b --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textArea.ets @@ -0,0 +1,89 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets'; +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +export default +struct TextAreaOnCut { + + aboutToAppear() { + Log.showInfo(TAG, `aboutToAppear TextAreaOnCut start`) + } + + aboutToDisappear(){ + Log.showInfo(TAG, `aboutToDisAppear TextAreaOnCut end`) + } + + build(){ + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){ + + TextArea({placeholder: "textArea-OnCut" }) + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + //input输入框中的文字被剪切时触发 + .onCut(() => { + console.log('onCut method is triggered'); + }) + .key("onCutText") + + TextArea({placeholder: "textArea-OnPaste" }) + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + //input输入框中的粘贴文字时触发 + .onPaste(() => { + console.log("onPaste method is triggered") + }) + .key("onPasteText") + + TextArea({placeholder: "textArea-CopyOption" }) + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + /**copyOption(value: boolean | CopyOption): + * 设置复制选项时调用 + * InApp = 0,Share in app. + * LocalDevice = 1,Share in local device. + * CrossDevice = 2,Share cross device. + */ + .copyOption(0) + .key("copyOptionText") + + }.width("100%").height("100%") + } +} + diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textInput.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textInput.ets new file mode 100644 index 0000000000000000000000000000000000000000..ee290598aa23a4a1f7bffdd718dc712b350c277e --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textInput.ets @@ -0,0 +1,115 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets'; +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +export default +struct TextInputOnEditChange { + @State num: number = 0 + + aboutToAppear() { + Log.showInfo(TAG, `aboutToAppear TextInputOnEditChange start`) + } + + aboutToDisappear(){ + Log.showInfo(TAG, `aboutToDisAppear TextInputOnEditChange end`) + } + + build(){ + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){ + + TextInput({placeholder: "textInput-OnEditChange" }) + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .onEditChange(() => { + console.log(`Input state changed ${this.num++}`) + }) + .key("onEditChangeText") + + TextInput({placeholder:"textInput-OnCut"}) + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + //input输入框中的文字被剪切时触发 + .onCut(() =>{ + console.log("onCut method is triggered") + }) + .key("onCutText") + + TextInput({placeholder:"textInput-OnPaste"}) + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + //input输入框中的粘贴文字时触发 + .onPaste(() => { + console.log("onPaste method is triggered") + }) + .key("onPasteText") + + TextInput({placeholder:"textInput-CopyOption"}) + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + //设置复制选项时调用 + .copyOption(0) + .key("copyOptionText") + + TextInput({placeholder:"textInput-ShowPasswordIcon"}) + .type(InputType.Password) + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + //设置密码显示/隐藏图标时调用 + .showPasswordIcon(true) + .key("showPasswordIconText") + + }.width("100%").height("100%") + } +} + diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textPicker.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textPicker.ets new file mode 100644 index 0000000000000000000000000000000000000000..cfc3d49e9593eef45ee5fa0b64ead8828dc6eca9 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textPicker.ets @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets'; +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +export default +struct TextPickerDefaultPickerItemHeight { + private select: number = 1 + private fruits: string[] = ['1.apple', '2.orange','3.peach', '4.grape'] + + aboutToAppear() { + Log.showInfo(TAG, `aboutToAppear TextPickerDefaultPickerItemHeight start`) + } + + aboutToDisappear(){ + Log.showInfo(TAG, `aboutToDisAppear TextPickerDefaultPickerItemHeight end`) + } + + build(){ + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){ + + TextPicker({range: this.fruits, selected: this.select}) + .onChange((value: string, index: number) => { + console.info('Picker item changed, value: ' + value + ', index: ' + index) + }) + .defaultPickerItemHeight('80px') + .key("defaultPickerItemHeightText") + + }.width("100%").height("100%") + } +} + diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/video.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/video.ets new file mode 100644 index 0000000000000000000000000000000000000000..fdbf5edceffb96a21f9e1dc0883b06f03523c880 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/video.ets @@ -0,0 +1,101 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets'; +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +export default +struct VideoOnFullscreenChange { + + @State srcs: Resource = $rawfile('videoTest.mp4'); + @State currentProgressRates: number = 1; + @State autoPlays: boolean = false; + controller: VideoController = new VideoController(); + + aboutToAppear() { + Log.showInfo(TAG, `aboutToAppear VideoOnFullscreenChange start`) + } + + aboutToDisappear(){ + Log.showInfo(TAG, `aboutToDisAppear VideoOnFullscreenChange end`) + } + + build(){ + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){ + + Video({ + src: this.srcs, + currentProgressRate: this.currentProgressRates, + controller: this.controller + }).width(600).height(400) + .autoPlay(this.autoPlays) + .key("onFullscreenChangeText") + .onStart(() => { + console.error('onStart'); + }) + .onFullscreenChange(() => { + console.log('screen is changed') + console.info('screen is changed') + console.error('screen is changed') + console.warn('screen is changed') + }) + .onPause(() => { + console.error('onPause'); + }) + .onFinish(() => { + console.error('onFinish'); + }) + .onError(() => { + console.error('onFinish'); + }) + .onPrepared((e) => { + console.error('onPrepared is ' + e.duration); + }) + .onSeeking((e) => { + console.error('onSeeking is ' + e.time); + }) + .onSeeked((e) => { + console.error('onSeekedis ' + e.time); + }) + .onUpdate((e) => { + console.error('onUpdateis ' + e.time); + }) + Row() { + Button("FullScreen").onClick(() => { + this.controller.requestFullscreen(true) + }); + Button("ExitFullScreen").onClick(() => { + this.controller.exitFullscreen() + }); + } + + Row() { + Button("start").onClick(() => { + this.controller.start(); + }); + Button("pause").onClick(() => { + this.controller.pause(); + }); + Button("stop").onClick(() => { + this.controller.stop(); + }); + } + + }.width("100%").height("100%") + } +} + diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets index 47fa559b5b8cf1957ed1d682d2846df862f82cd9..36a51b42e9072ebcad4f9853489b2fdc3765d012 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets @@ -21,13 +21,24 @@ import gridMaxCountJsunit from './grid.test.ets'; import gridItemOnSelectJsunit from './gridItem.test.ets'; import inspectorJsunit from './inspector.test.ets' import lazyForEachOnDataAddJsunit from './lazyForEach.test.ets'; +import navigatorTargetJsunit from './navigator.test.ets' import pathNewTest from './path.test.ets'; import polygonNewJsunit from './polygon.test.ets'; import polyLineNeJsunit from './polyLine.test.ets'; +import progressScaleCountJsunit from './progress.test.ets'; import rectNeJsunit from './rect.test.ets'; import scrollOnScrollBeginJsunit from './scroll.test.ets'; +import searchOnCutJsunit from './search.test.ets' +import swiperCurveJsunit from './swiper.test.ets'; +import tabsBarPositionJsunit from './tabs.test.ets'; +import textMinFontSizeJsunit from './text.test.ets'; +import textAreaOnCutJsunit from './textArea.test.ets'; +import textInputOnEditChangeJsunit from './textInput.test.ets'; +import textPickerDefaultPickerItemHeightJsunit from './textPicker.test.ets'; +import videoOnFullscreenChangeJsunit from './video.test.ets'; export default function testsuite() { + lazyForEachOnDataAddJsunit() alphabetIndexerOnSelectJsunit() checkBoxGroupSelectAllJsunit() circleNewJsunit() @@ -35,10 +46,19 @@ export default function testsuite() { gridMaxCountJsunit() gridItemOnSelectJsunit() inspectorJsunit() - lazyForEachOnDataAddJsunit() + navigatorTargetJsunit() pathNewTest() polygonNewJsunit() polyLineNeJsunit() + progressScaleCountJsunit() rectNeJsunit() scrollOnScrollBeginJsunit() + searchOnCutJsunit() + swiperCurveJsunit() + tabsBarPositionJsunit() + textMinFontSizeJsunit() + textAreaOnCutJsunit() + textInputOnEditChangeJsunit() + textPickerDefaultPickerItemHeightJsunit() + videoOnFullscreenChangeJsunit() } \ No newline at end of file diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets index bdb2c16bed6181718d7ae08ec219018627a97399..fef7406ca3812dc6ef18ad07fd947c136fd4d103 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets @@ -144,6 +144,11 @@ export default function inspectorJsunit() { } }); + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0005 + * @tc.name testInspectorTestAdd0005 + * @tc.desic aceTestInspectorTestAdd0005 + */ it('testInspectorTestAdd0005', 0, async function (done) { console.info('testInspectorTestAdd0005 START'); try { @@ -164,9 +169,9 @@ export default function inspectorJsunit() { }); /* - * @tc.number SUB_ACE_BASIC_ETS_API_0004 - * @tc.name testInspectorTestAdd0004 - * @tc.desic aceTestInspectorTestAdd0004 + * @tc.number SUB_ACE_BASIC_ETS_API_0006 + * @tc.name testInspectorTestAdd0006 + * @tc.desic aceTestInspectorTestAdd0006 */ it('testInspectorTestAdd0006', 0, async function (done) { var innerEvent3 = { diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets index b9b912ec150cb45bc0ed0bd2d362d7ad42fdd8fd..04f59487328857752b355d7e69c237fd34dc2935 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets @@ -55,7 +55,7 @@ export default function lazyForEachOnDataAddJsunit() { console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0001 START'); var innerEvent1 = { - eventId: 101, + eventId: 201, priority: events_emitter.EventPriority.LOW } var callback1 = (eventData) => { @@ -87,7 +87,7 @@ export default function lazyForEachOnDataAddJsunit() { console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0002 START'); var innerEvent2 = { - eventId: 102, + eventId: 202, priority: events_emitter.EventPriority.LOW } var callback2 = (eventData) => { @@ -119,7 +119,7 @@ export default function lazyForEachOnDataAddJsunit() { console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0003 START'); var innerEvent3 = { - eventId: 103, + eventId: 203, priority: events_emitter.EventPriority.LOW } var callback3 = (eventData) => { @@ -151,7 +151,7 @@ export default function lazyForEachOnDataAddJsunit() { console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0004 START'); var innerEvent4 = { - eventId: 104, + eventId: 204, priority: events_emitter.EventPriority.LOW } var callback4 = (eventData) => { diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/navigator.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/navigator.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..540890439a82bd6e9d07bb4d07c0de06d79d560e --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/navigator.test.ets @@ -0,0 +1,65 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import Utils from './Utils.ets' + +export default function navigatorTargetJsunit() { + describe('navigatorTargetTest', function () { + beforeAll(async function (done) { + console.info("flex beforeEach start"); + let options = { + uri: 'pages/navigator', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get navigator state success " + JSON.stringify(pages)); + if (!("navigator" == pages.name)) { + console.info("get navigator state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push navigator page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push navigator page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.info("navigatorTarget after each called"); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0001 + * @tc.name testnavigatorTarget0001 + * @tc.desic acenavigatorTargetEtsTest0001 + */ + it('testnavigatorTarget0001', 0, async function (done) { + console.info('navigatorTarget testnavigatorTarget0001 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('Navigator'); + console.info("[testnavigatorTarget0001] component strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Navigator'); + expect(obj.$attrs.target).assertEqual("pages/index"); + console.info("[testnavigatorTarget0001] target value :" + obj.$attrs.target); + done(); + }); + }) +} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/progress.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/progress.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..a01034c224cc8c3a2c46db398abbc6323d9b5945 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/progress.test.ets @@ -0,0 +1,150 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import Utils from './Utils.ets' + +export default function progressStyleJsunit() { + describe('progressStyleTest', function () { + beforeAll(async function (done) { + console.info("flex beforeEach start"); + let options = { + uri: 'pages/progress', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get progress state success " + JSON.stringify(pages)); + if (!("progress" == pages.name)) { + console.info("get progress state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push progress page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push progress page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.info("progressStyle after each called"); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0001 + * @tc.name testprogressStyle0001 + * @tc.desic aceprogressStyleEtsTest0001 + */ + it('testprogressStyle0001', 0, async function (done) { + console.info('progressStyle testprogressStyle0001 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('Progress'); + console.info("[testprogressStyle0001] component width strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Progress'); + expect(obj.$attrs.width).assertEqual("100.00vp"); + console.info("[testprogressStyle0001] width value :" + obj.$attrs.width); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0002 + * @tc.name testprogressStyle0002 + * @tc.desic aceprogressStyleEtsTest0002 + */ + it('testprogressStyle0002', 0, async function (done) { + console.info('progressStyle testprogressStyle0002 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('Progress'); + console.info("[testprogressStyle0002] component color strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Progress'); + expect(obj.$attrs.color).assertEqual("#FF008000"); + console.info("[testprogressStyle0002] color value :" + obj.$attrs.color); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0003 + * @tc.name testprogressStyle0003 + * @tc.desic aceprogressStyleEtsTest0003 + */ + it('testprogressStyle0003', 0, async function (done) { + console.info('progressStyle testprogressStyle0003 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('Progress'); + console.info("[testprogressStyle0003] component value strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Progress'); + expect(obj.$attrs.value).assertEqual("50.000000"); + console.info("[testprogressStyle0003] value value :" + obj.$attrs.value); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0004 + * @tc.name testprogressStyle0004 + * @tc.desic aceprogressStyleEtsTest0004 + */ + it('testprogressStyle0004', 0, async function (done) { + console.info('progressStyle testprogressStyle0004 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('Progress'); + console.info("[testprogressStyle0004] component style strokeWidth strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Progress'); + expect(obj.$attrs.style.strokeWidth).assertEqual("20.00vp"); + console.info("[testprogressStyle0004] style strokeWidth value :" + obj.$attrs.style.strokeWidth); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0005 + * @tc.name testprogressStyle0005 + * @tc.desic aceprogressStyleEtsTest0005 + */ + it('testprogressStyle0005', 0, async function (done) { + console.info('progressStyle testprogressStyle0005 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('Progress'); + console.info("[testprogressStyle0005] component style scaleCount strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Progress'); + expect(obj.$attrs.style.scaleCount).assertEqual("30"); + console.info("[testprogressStyle0005] style scaleCount value :" + obj.$attrs.style.scaleCount); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0006 + * @tc.name testprogressStyle0006 + * @tc.desic aceprogressStyleEtsTest0006 + */ + it('testprogressStyle0006', 0, async function (done) { + console.info('progressStyle testprogressStyle0006 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('Progress'); + console.info("[testprogressStyle0006] component style scaleWidth strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Progress'); + expect(obj.$attrs.style.scaleWidth).assertEqual("20.00vp"); + console.info("[testprogressStyle0006] style scaleWidth value :" + obj.$attrs.style.scaleWidth); + done(); + }); + }) +} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/search.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/search.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..567a45048076c18d9b7e42936d9204bc297ab421 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/search.test.ets @@ -0,0 +1,201 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import Utils from './Utils.ets' + +export default function searchOnCutJsunit() { + describe('searchOnCutTest', function () { + beforeAll(async function (done) { + console.info("flex beforeEach start"); + let options = { + uri: 'pages/search', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get search state success " + JSON.stringify(pages)); + if (!("search" == pages.name)) { + console.info("get search state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push search page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push search page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.info("searchOnCut after each called"); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0001 + * @tc.name testsearchOnCut0001 + * @tc.desic acesearchOnCutEtsTest0001 + */ + it('testsearchOnCut0001', 0, async function (done) { + console.info('searchOnCut testsearchOnCut0001 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testsearchOnCut0001] component width strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.width).assertEqual("320.00vp"); + console.info("[testsearchOnCut0001] width value :" + obj.$attrs.width); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0002 + * @tc.name testsearchOnCut0002 + * @tc.desic acesearchOnCutEtsTest0002 + */ + it('testsearchOnCut0002', 0, async function (done) { + console.info('searchOnCut testsearchOnCut0002 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testsearchOnCut0002] component height strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.height).assertEqual("70.00vp"); + console.info("[testsearchOnCut0002] height value :" + obj.$attrs.height); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0003 + * @tc.name testsearchOnCut0003 + * @tc.desic acesearchOnCutEtsTest0003 + */ + it('testsearchOnCut0003', 0, async function (done) { + console.info('searchOnCut testsearchOnCut0003 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testsearchOnCut0003] component fontSize strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.fontSize).assertEqual("20.00fp"); + console.info("[testsearchOnCut0003] fontSize value :" + obj.$attrs.fontSize); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0004 + * @tc.name testsearchOnCut0004 + * @tc.desic acesearchOnCutEtsTest0004 + */ + it('testsearchOnCut0004', 0, async function (done) { + console.info('searchOnCut testsearchOnCut0004 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testsearchOnCut0004] component opacity strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.opacity).assertEqual(1); + console.info("[testsearchOnCut0004] opacity value :" + obj.$attrs.opacity); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0005 + * @tc.name testsearchOnCut0005 + * @tc.desic acesearchOnCutEtsTest0005 + */ + it('testsearchOnCut0005', 0, async function (done) { + console.info('searchOnCut testsearchOnCut0005 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testsearchOnCut0005] component align strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.align).assertEqual("Alignment.TopStart"); + console.info("[testsearchOnCut0005] align value :" + obj.$attrs.align); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0006 + * @tc.name testsearchOnCut0006 + * @tc.desic acesearchOnCutEtsTest0006 + */ + it('testsearchOnCut0006', 0, async function (done) { + console.info('searchOnCut testsearchOnCut0006 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testsearchOnCut0006] component fontColor strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC"); + console.info("[testsearchOnCut0006] fontColor value :" + obj.$attrs.fontColor); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0007 + * @tc.name testsearchOnCut0007 + * @tc.desic acesearchOnCutEtsTest0007 + */ + it('testsearchOnCut0007', 0, async function (done) { + console.info('searchOnCut testsearchOnCut0007 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testsearchOnCut0007] component lineHeight strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.lineHeight).assertEqual("25.00fp"); + console.info("[testsearchOnCut0007] lineHeight value :" + obj.$attrs.lineHeight); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0009 + * @tc.name testsearchOnCut0009 + * @tc.desic acesearchOnCutEtsTest0009 + */ + it('testsearchOnCut0009', 0, async function (done) { + console.info('searchOnCut testsearchOnCut009 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testsearchOnCut0009] component padding strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.padding).assertEqual("10.00vp"); + console.info("[testsearchOnCut0009] padding value :" + obj.$attrs.padding); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0010 + * @tc.name testsearchOnCut0010 + * @tc.desic acesearchOnCutEtsTest0010 + */ + it('testsearchOnCut0010', 0, async function (done) { + console.info('searchOnCut testsearchOnCut0010 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testsearchOnCut0010] component textAlign strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left"); + console.info("[testsearchOnCut0010] textAlign value :" + obj.$attrs.textAlign); + done(); + }); + }) +} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c83f088f504e550a4c2a5f44dcacb36df99c2db --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets @@ -0,0 +1,201 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import Utils from './Utils.ets' + +export default function swiperCurveJsunit() { + describe('swiperCurveTest', function () { + beforeAll(async function (done) { + console.info("flex beforeEach start"); + let options = { + uri: 'pages/swiper', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get swiper state success " + JSON.stringify(pages)); + if (!("swiper" == pages.name)) { + console.info("get swiper state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push swiper page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push swiper page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.info("swiperCurve after each called"); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0001 + * @tc.name testswiperCurve0001 + * @tc.desic aceswiperCurveEtsTest0001 + */ + it('testswiperCurve0001', 0, async function (done) { + console.info('swiperCurve testswiperCurve0001 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('curveText'); + console.info("[testswiperCurve0001] component width strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.width).assertEqual("100.00vp"); + console.info("[testswiperCurve0001] width value :" + obj.$attrs.width); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0002 + * @tc.name testswiperCurve0002 + * @tc.desic aceswiperCurveEtsTest0002 + */ + it('testswiperCurve0002', 0, async function (done) { + console.info('swiperCurve testswiperCurve0002 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('curveText'); + console.info("[testswiperCurve0002] component height strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.height).assertEqual("70.00vp"); + console.info("[testswiperCurve0002] height value :" + obj.$attrs.height); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0003 + * @tc.name testswiperCurve0003 + * @tc.desic aceswiperCurveEtsTest0003 + */ + it('testswiperCurve0003', 0, async function (done) { + console.info('swiperCurve testswiperCurve0003 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('curveText'); + console.info("[testswiperCurve0003] component fontSize strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.fontSize).assertEqual("20.00fp"); + console.info("[testswiperCurve0003] fontSize value :" + obj.$attrs.fontSize); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0004 + * @tc.name testswiperCurve0004 + * @tc.desic aceswiperCurveEtsTest0004 + */ + it('testswiperCurve0004', 0, async function (done) { + console.info('swiperCurve testswiperCurve0004 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('curveText'); + console.info("[testswiperCurve0004] component opacity strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.opacity).assertEqual(1); + console.info("[testswiperCurve0004] opacity value :" + obj.$attrs.opacity); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0005 + * @tc.name testswiperCurve0005 + * @tc.desic aceswiperCurveEtsTest0005 + */ + it('testswiperCurve0005', 0, async function (done) { + console.info('swiperCurve testswiperCurve0005 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('curveText'); + console.info("[testswiperCurve0005] component align strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.align).assertEqual("Alignment.TopStart"); + console.info("[testswiperCurve0005] align value :" + obj.$attrs.align); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0006 + * @tc.name testswiperCurve0006 + * @tc.desic aceswiperCurveEtsTest0006 + */ + it('testswiperCurve0006', 0, async function (done) { + console.info('swiperCurve testswiperCurve0006 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('curveText'); + console.info("[testswiperCurve0006] component fontColor strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC"); + console.info("[testswiperCurve0006] fontColor value :" + obj.$attrs.fontColor); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0007 + * @tc.name testswiperCurve0007 + * @tc.desic aceswiperCurveEtsTest0007 + */ + it('testswiperCurve0007', 0, async function (done) { + console.info('swiperCurve testswiperCurve0007 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('curveText'); + console.info("[testswiperCurve0007] component lineHeight strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.lineHeight).assertEqual("25.00fp"); + console.info("[testswiperCurve0007] lineHeight value :" + obj.$attrs.lineHeight); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0009 + * @tc.name testswiperCurve0009 + * @tc.desic aceswiperCurveEtsTest0009 + */ + it('testswiperCurve0009', 0, async function (done) { + console.info('swiperCurve testswiperCurve009 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('curveText'); + console.info("[testswiperCurve0009] component padding strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.padding).assertEqual("10.00vp"); + console.info("[testswiperCurve0009] padding value :" + obj.$attrs.padding); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0010 + * @tc.name testswiperCurve0010 + * @tc.desic aceswiperCurveEtsTest0010 + */ + it('testswiperCurve0010', 0, async function (done) { + console.info('swiperCurve testswiperCurve0010 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('curveText'); + console.info("[testswiperCurve0010] component textAlign strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left"); + console.info("[testswiperCurve0010] textAlign value :" + obj.$attrs.textAlign); + done(); + }); + }) +} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/tabs.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/tabs.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..b65cbfd51b84c77e6b72786781350a93559b7a45 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/tabs.test.ets @@ -0,0 +1,201 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import Utils from './Utils.ets' + +export default function tabsBarPositionJsunit() { + describe('tabsBarPositionTest', function () { + beforeAll(async function (done) { + console.info("flex beforeEach start"); + let options = { + uri: 'pages/tabs', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get tabs state success " + JSON.stringify(pages)); + if (!("tabs" == pages.name)) { + console.info("get tabs state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push tabs page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push tabs page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.info("tabsBarPosition after each called"); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0001 + * @tc.name testtabsBarPosition0001 + * @tc.desic acetabsBarPositionEtsTest0001 + */ + it('testtabsBarPosition0001', 0, async function (done) { + console.info('tabsBarPosition testtabsBarPosition0001 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('barPositionText'); + console.info("[testtabsBarPosition0001] component width strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.width).assertEqual("100.00vp"); + console.info("[testtabsBarPosition0001] width value :" + obj.$attrs.width); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0002 + * @tc.name testtabsBarPosition0002 + * @tc.desic acetabsBarPositionEtsTest0002 + */ + it('testtabsBarPosition0002', 0, async function (done) { + console.info('tabsBarPosition testtabsBarPosition0002 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('barPositionText'); + console.info("[testtabsBarPosition0002] component height strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.height).assertEqual("70.00vp"); + console.info("[testtabsBarPosition0002] height value :" + obj.$attrs.height); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0003 + * @tc.name testtabsBarPosition0003 + * @tc.desic acetabsBarPositionEtsTest0003 + */ + it('testtabsBarPosition0003', 0, async function (done) { + console.info('tabsBarPosition testtabsBarPosition0003 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('barPositionText'); + console.info("[testtabsBarPosition0003] component fontSize strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.fontSize).assertEqual("20.00fp"); + console.info("[testtabsBarPosition0003] fontSize value :" + obj.$attrs.fontSize); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0004 + * @tc.name testtabsBarPosition0004 + * @tc.desic acetabsBarPositionEtsTest0004 + */ + it('testtabsBarPosition0004', 0, async function (done) { + console.info('tabsBarPosition testtabsBarPosition0004 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('barPositionText'); + console.info("[testtabsBarPosition0004] component opacity strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.opacity).assertEqual(1); + console.info("[testtabsBarPosition0004] opacity value :" + obj.$attrs.opacity); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0005 + * @tc.name testtabsBarPosition0005 + * @tc.desic acetabsBarPositionEtsTest0005 + */ + it('testtabsBarPosition0005', 0, async function (done) { + console.info('tabsBarPosition testtabsBarPosition0005 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('barPositionText'); + console.info("[testtabsBarPosition0005] component align strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.align).assertEqual("Alignment.TopStart"); + console.info("[testtabsBarPosition0005] align value :" + obj.$attrs.align); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0006 + * @tc.name testtabsBarPosition0006 + * @tc.desic acetabsBarPositionEtsTest0006 + */ + it('testtabsBarPosition0006', 0, async function (done) { + console.info('tabsBarPosition testtabsBarPosition0006 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('barPositionText'); + console.info("[testtabsBarPosition0006] component fontColor strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC"); + console.info("[testtabsBarPosition0006] fontColor value :" + obj.$attrs.fontColor); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0007 + * @tc.name testtabsBarPosition0007 + * @tc.desic acetabsBarPositionEtsTest0007 + */ + it('testtabsBarPosition0007', 0, async function (done) { + console.info('tabsBarPosition testtabsBarPosition0007 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('barPositionText'); + console.info("[testtabsBarPosition0007] component lineHeight strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.lineHeight).assertEqual("25.00fp"); + console.info("[testtabsBarPosition0007] lineHeight value :" + obj.$attrs.lineHeight); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0009 + * @tc.name testtabsBarPosition0009 + * @tc.desic acetabsBarPositionEtsTest0009 + */ + it('testtabsBarPosition0009', 0, async function (done) { + console.info('tabsBarPosition testtabsBarPosition009 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('barPositionText'); + console.info("[testtabsBarPosition0009] component padding strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.padding).assertEqual("10.00vp"); + console.info("[testtabsBarPosition0009] padding value :" + obj.$attrs.padding); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0010 + * @tc.name testtabsBarPosition0010 + * @tc.desic acetabsBarPositionEtsTest0010 + */ + it('testtabsBarPosition0010', 0, async function (done) { + console.info('tabsBarPosition testtabsBarPosition0010 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('barPositionText'); + console.info("[testtabsBarPosition0010] component textAlign strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left"); + console.info("[testtabsBarPosition0010] textAlign value :" + obj.$attrs.textAlign); + done(); + }); + }) +} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/text.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/text.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..8e28cd9054c6c3a9e9748c7bb10e22a0c419edd5 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/text.test.ets @@ -0,0 +1,202 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import Utils from './Utils.ets' + +export default function textMinFontSizeJsunit() { + describe('textMinFontSizeTest', function () { + beforeAll(async function (done) { + console.info("flex beforeEach start"); + let options = { + uri: 'pages/text', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get text state success " + JSON.stringify(pages)); + if (!("text" == pages.name)) { + console.info("get text state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push text page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push text page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.info("textMinFontSize after each called"); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0001 + * @tc.name testtextMinFontSize0001 + * @tc.desic acetextMinFontSizeEtsTest0001 + */ + it('testtextMinFontSize0001', 0, async function (done) { + console.info('textMinFontSize testtextMinFontSize0001 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('minFontSizeText'); + console.info("[testtextMinFontSize0001] component width strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.width).assertEqual("100.00vp"); + console.info("[testtextMinFontSize0001] width value :" + obj.$attrs.width); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0002 + * @tc.name testtextMinFontSize0002 + * @tc.desic acetextMinFontSizeEtsTest0002 + */ + it('testtextMinFontSize0002', 0, async function (done) { + console.info('textMinFontSize testtextMinFontSize0002 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('minFontSizeText'); + console.info("[testtextMinFontSize0002] component height strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.height).assertEqual("70.00vp"); + console.info("[testtextMinFontSize0002] height value :" + obj.$attrs.height); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0003 + * @tc.name testtextMinFontSize0003 + * @tc.desic acetextMinFontSizeEtsTest0003 + */ + it('testtextMinFontSize0003', 0, async function (done) { + console.info('textMinFontSize testtextMinFontSize0003 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('minFontSizeText'); + console.info("[testtextMinFontSize0003] component fontSize strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.fontSize).assertEqual("30.00px"); + console.info("[testtextMinFontSize0003] fontSize value :" + obj.$attrs.fontSize); + done(); + }); + + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0004 + * @tc.name testtextMinFontSize0004 + * @tc.desic acetextMinFontSizeEtsTest0004 + */ + it('testtextMinFontSize0004', 0, async function (done) { + console.info('textMinFontSize testtextMinFontSize0004 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('minFontSizeText'); + console.info("[testtextMinFontSize0004] component opacity strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.opacity).assertEqual(1); + console.info("[testtextMinFontSize0004] opacity value :" + obj.$attrs.opacity); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0005 + * @tc.name testtextMinFontSize0005 + * @tc.desic acetextMinFontSizeEtsTest0005 + */ + it('testtextMinFontSize0005', 0, async function (done) { + console.info('textMinFontSize testtextMinFontSize0005 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('minFontSizeText'); + console.info("[testtextMinFontSize0005] component align strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.align).assertEqual("Alignment.TopStart"); + console.info("[testtextMinFontSize0005] align value :" + obj.$attrs.align); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0006 + * @tc.name testtextMinFontSize0006 + * @tc.desic acetextMinFontSizeEtsTest0006 + */ + it('testtextMinFontSize0006', 0, async function (done) { + console.info('textMinFontSize testtextMinFontSize0006 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('minFontSizeText'); + console.info("[testtextMinFontSize0006] component fontColor strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC"); + console.info("[testtextMinFontSize0006] fontColor value :" + obj.$attrs.fontColor); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0007 + * @tc.name testtextMinFontSize0007 + * @tc.desic acetextMinFontSizeEtsTest0007 + */ + it('testtextMinFontSize0007', 0, async function (done) { + console.info('textMinFontSize testtextMinFontSize0007 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('minFontSizeText'); + console.info("[testtextMinFontSize0007] component lineHeight strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.lineHeight).assertEqual("25.00fp"); + console.info("[testtextMinFontSize0007] lineHeight value :" + obj.$attrs.lineHeight); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0009 + * @tc.name testtextMinFontSize0009 + * @tc.desic acetextMinFontSizeEtsTest0009 + */ + it('testtextMinFontSize0009', 0, async function (done) { + console.info('textMinFontSize testtextMinFontSize009 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('minFontSizeText'); + console.info("[testtextMinFontSize0009] component padding strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.padding).assertEqual("10.00vp"); + console.info("[testtextMinFontSize0009] padding value :" + obj.$attrs.padding); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0010 + * @tc.name testtextMinFontSize0010 + * @tc.desic acetextMinFontSizeEtsTest0010 + */ + it('testtextMinFontSize0010', 0, async function (done) { + console.info('textMinFontSize testtextMinFontSize0010 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('minFontSizeText'); + console.info("[testtextMinFontSize0010] component textAlign strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Text'); + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left"); + console.info("[testtextMinFontSize0010] textAlign value :" + obj.$attrs.textAlign); + done(); + }); + }) +} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textArea.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textArea.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..8e8b7f850d4e97d4db3da092622f8ab0fdaa6042 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textArea.test.ets @@ -0,0 +1,203 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import Utils from './Utils.ets' + +export default function textAreaOnCutJsunit() { + describe('textAreaOnCutTest', function () { + beforeAll(async function (done) { + console.info("flex beforeEach start"); + let options = { + uri: 'pages/textArea', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get textArea state success " + JSON.stringify(pages)); + if (!("textArea" == pages.name)) { + console.info("get textArea state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push textArea page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push textArea page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.info("textAreaOnCut after each called"); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0001 + * @tc.name testtextAreaOnCut0001 + * @tc.desic acetextAreaOnCutEtsTest0001 + */ + it('testtextAreaOnCut0001', 0, async function (done) { + console.info('textAreaOnCut testtextAreaOnCut0001 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testtextAreaOnCut0001] component width strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextArea'); + expect(obj.$attrs.width).assertEqual("100.00vp"); + console.info("[testtextAreaOnCut0001] width value :" + obj.$attrs.width); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0002 + * @tc.name testtextAreaOnCut0002 + * @tc.desic acetextAreaOnCutEtsTest0002 + */ + it('testtextAreaOnCut0002', 0, async function (done) { + console.info('textAreaOnCut testtextAreaOnCut0002 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testtextAreaOnCut0002] component height strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextArea'); + expect(obj.$attrs.height).assertEqual("70.00vp"); + console.info("[testtextAreaOnCut0002] height value :" + obj.$attrs.height); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0003 + * @tc.name testtextAreaOnCut0003 + * @tc.desic acetextAreaOnCutEtsTest0003 + */ + it('testtextAreaOnCut0003', 0, async function (done) { + console.info('textAreaOnCut testtextAreaOnCut0003 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testtextAreaOnCut0003] component fontSize strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextArea'); + expect(obj.$attrs.fontSize).assertEqual("20.00fp"); + console.info("[testtextAreaOnCut0003] fontSize value :" + obj.$attrs.fontSize); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0004 + * @tc.name testtextAreaOnCut0004 + * @tc.desic acetextAreaOnCutEtsTest0004 + */ + it('testtextAreaOnCut0004', 0, async function (done) { + console.info('textAreaOnCut testtextAreaOnCut0004 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testtextAreaOnCut0004] component opacity strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextArea'); + expect(obj.$attrs.opacity).assertEqual(1); + console.info("[testtextAreaOnCut0004] opacity value :" + obj.$attrs.opacity); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0005 + * @tc.name testtextAreaOnCut0005 + * @tc.desic acetextAreaOnCutEtsTest0005 + */ + it('testtextAreaOnCut0005', 0, async function (done) { + console.info('textAreaOnCut testtextAreaOnCut0005 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testtextAreaOnCut0005] component align strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextArea'); + expect(obj.$attrs.align).assertEqual("Alignment.TopStart"); + console.info("[testtextAreaOnCut0005] align value :" + obj.$attrs.align); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0006 + * @tc.name testtextAreaOnCut0006 + * @tc.desic acetextAreaOnCutEtsTest0006 + */ + it('testtextAreaOnCut0006', 0, async function (done) { + console.info('textAreaOnCut testtextAreaOnCut0006 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testtextAreaOnCut0006] component fontColor strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextArea'); + expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC"); + console.info("[testtextAreaOnCut0006] fontColor value :" + obj.$attrs.fontColor); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0007 + * @tc.name testtextAreaOnCut0007 + * @tc.desic acetextAreaOnCutEtsTest0007 + */ + it('testtextAreaOnCut0007', 0, async function (done) { + console.info('textAreaOnCut testtextAreaOnCut0007 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testtextAreaOnCut0007] component lineHeight strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextArea'); + expect(obj.$attrs.lineHeight).assertEqual(undefined); + console.info("[testtextAreaOnCut0007] lineHeight value :" + obj.$attrs.lineHeight); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0009 + * @tc.name testtextAreaOnCut0009 + * @tc.desic acetextAreaOnCutEtsTest0009 + */ + it('testtextAreaOnCut0009', 0, async function (done) { + console.info('textAreaOnCut testtextAreaOnCut009 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testtextAreaOnCut0009] component padding strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextArea'); + expect(obj.$attrs.padding).assertEqual("0.00px"); + console.info("[testtextAreaOnCut0009] padding value :" + obj.$attrs.padding); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0010 + * @tc.name testtextAreaOnCut0010 + * @tc.desic acetextAreaOnCutEtsTest0010 + */ + it('testtextAreaOnCut0010', 0, async function (done) { + console.info('textAreaOnCut testtextAreaOnCut0010 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onCutText'); + console.info("[testtextAreaOnCut0010] component textAlign strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextArea'); + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center"); + console.info("[testtextAreaOnCut0010] textAlign value :" + obj.$attrs.textAlign); + done(); + }); + + + }) +} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textInput.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textInput.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..a860bd99a0109169fb5175ca73a2ac18a0fd1574 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textInput.test.ets @@ -0,0 +1,201 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import Utils from './Utils.ets' + +export default function textInputOnEditChangeJsunit() { + describe('textInputOnEditChangeTest', function () { + beforeAll(async function (done) { + console.info("flex beforeEach start"); + let options = { + uri: 'pages/textInput', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get textInput state success " + JSON.stringify(pages)); + if (!("textInput" == pages.name)) { + console.info("get textInput state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push textInput page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push textInput page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.info("textInputOnEditChange after each called"); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0001 + * @tc.name testtextInputOnEditChange0001 + * @tc.desic acetextInputOnEditChangeEtsTest0001 + */ + it('testtextInputOnEditChange0001', 0, async function (done) { + console.info('textInputOnEditChange testtextInputOnEditChange0001 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onEditChangeText'); + console.info("[testtextInputOnEditChange0001] component width strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextInput'); + expect(obj.$attrs.width).assertEqual("100.00vp"); + console.info("[testtextInputOnEditChange0001] width value :" + obj.$attrs.width); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0002 + * @tc.name testtextInputOnEditChange0002 + * @tc.desic acetextInputOnEditChangeEtsTest0002 + */ + it('testtextInputOnEditChange0002', 0, async function (done) { + console.info('textInputOnEditChange testtextInputOnEditChange0002 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onEditChangeText'); + console.info("[testtextInputOnEditChange0002] component height strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextInput'); + expect(obj.$attrs.height).assertEqual("70.00vp"); + console.info("[testtextInputOnEditChange0002] height value :" + obj.$attrs.height); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0003 + * @tc.name testtextInputOnEditChange0003 + * @tc.desic acetextInputOnEditChangeEtsTest0003 + */ + it('testtextInputOnEditChange0003', 0, async function (done) { + console.info('textInputOnEditChange testtextInputOnEditChange0003 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onEditChangeText'); + console.info("[testtextInputOnEditChange0003] component fontSize strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextInput'); + expect(obj.$attrs.fontSize).assertEqual("20.00fp"); + console.info("[testtextInputOnEditChange0003] fontSize value :" + obj.$attrs.fontSize); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0004 + * @tc.name testtextInputOnEditChange0004 + * @tc.desic acetextInputOnEditChangeEtsTest0004 + */ + it('testtextInputOnEditChange0004', 0, async function (done) { + console.info('textInputOnEditChange testtextInputOnEditChange0004 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onEditChangeText'); + console.info("[testtextInputOnEditChange0004] component opacity strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextInput'); + expect(obj.$attrs.opacity).assertEqual(1); + console.info("[testtextInputOnEditChange0004] opacity value :" + obj.$attrs.opacity); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0005 + * @tc.name testtextInputOnEditChange0005 + * @tc.desic acetextInputOnEditChangeEtsTest0005 + */ + it('testtextInputOnEditChange0005', 0, async function (done) { + console.info('textInputOnEditChange testtextInputOnEditChange0005 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onEditChangeText'); + console.info("[testtextInputOnEditChange0005] component align strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextInput'); + expect(obj.$attrs.align).assertEqual("Alignment.TopStart"); + console.info("[testtextInputOnEditChange0005] align value :" + obj.$attrs.align); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0006 + * @tc.name testtextInputOnEditChange0006 + * @tc.desic acetextInputOnEditChangeEtsTest0006 + */ + it('testtextInputOnEditChange0006', 0, async function (done) { + console.info('textInputOnEditChange testtextInputOnEditChange0006 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onEditChangeText'); + console.info("[testtextInputOnEditChange0006] component fontColor strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextInput'); + expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC"); + console.info("[testtextInputOnEditChange0006] fontColor value :" + obj.$attrs.fontColor); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0007 + * @tc.name testtextInputOnEditChange0007 + * @tc.desic acetextInputOnEditChangeEtsTest0007 + */ + it('testtextInputOnEditChange0007', 0, async function (done) { + console.info('textInputOnEditChange testtextInputOnEditChange0007 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onEditChangeText'); + console.info("[testtextInputOnEditChange0007] component lineHeight strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextInput'); + expect(obj.$attrs.lineHeight).assertEqual(undefined); + console.info("[testtextInputOnEditChange0007] lineHeight value :" + obj.$attrs.lineHeight); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0009 + * @tc.name testtextInputOnEditChange0009 + * @tc.desic acetextInputOnEditChangeEtsTest0009 + */ + it('testtextInputOnEditChange0009', 0, async function (done) { + console.info('textInputOnEditChange testtextInputOnEditChange009 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onEditChangeText'); + console.info("[testtextInputOnEditChange0009] component padding strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextInput'); + expect(obj.$attrs.padding).assertEqual("0.00px"); + console.info("[testtextInputOnEditChange0009] padding value :" + obj.$attrs.padding); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0010 + * @tc.name testtextInputOnEditChange0010 + * @tc.desic acetextInputOnEditChangeEtsTest0010 + */ + it('testtextInputOnEditChange0010', 0, async function (done) { + console.info('textInputOnEditChange testtextInputOnEditChange0010 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onEditChangeText'); + console.info("[testtextInputOnEditChange0010] component textAlign strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextInput'); + expect(obj.$attrs.textAlign).assertEqual(undefined); + console.info("[testtextInputOnEditChange0010] textAlign value :" + obj.$attrs.textAlign); + done(); + }); + }) +} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textPicker.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textPicker.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..da74d1508c3d727e071c1e961f49a8408d063d78 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textPicker.test.ets @@ -0,0 +1,201 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import Utils from './Utils.ets' + +export default function textPickerDefaultPickerItemHeightJsunit() { + describe('textPickerDefaultPickerItemHeightTest', function () { + beforeAll(async function (done) { + console.info("flex beforeEach start"); + let options = { + uri: 'pages/textPicker', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get textPicker state success " + JSON.stringify(pages)); + if (!("textPicker" == pages.name)) { + console.info("get textPicker state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push textPicker page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push textPicker page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.info("textPickerDefaultPickerItemHeight after each called"); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0001 + * @tc.name testtextPickerDefaultPickerItemHeight0001 + * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0001 + */ + it('testtextPickerDefaultPickerItemHeight0001', 0, async function (done) { + console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0001 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('defaultPickerItemHeightText'); + console.info("[testtextPickerDefaultPickerItemHeight0001] component width strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextPicker'); + expect(obj.$attrs.width).assertEqual("-"); + console.info("[testtextPickerDefaultPickerItemHeight0001] width value :" + obj.$attrs.width); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0002 + * @tc.name testtextPickerDefaultPickerItemHeight0002 + * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0002 + */ + it('testtextPickerDefaultPickerItemHeight0002', 0, async function (done) { + console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0002 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('defaultPickerItemHeightText'); + console.info("[testtextPickerDefaultPickerItemHeight0002] component height strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextPicker'); + expect(obj.$attrs.height).assertEqual("-"); + console.info("[testtextPickerDefaultPickerItemHeight0002] height value :" + obj.$attrs.height); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0003 + * @tc.name testtextPickerDefaultPickerItemHeight0003 + * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0003 + */ + it('testtextPickerDefaultPickerItemHeight0003', 0, async function (done) { + console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0003 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('defaultPickerItemHeightText'); + console.info("[testtextPickerDefaultPickerItemHeight0003] component fontSize strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextPicker'); + expect(obj.$attrs.fontSize).assertEqual(undefined); + console.info("[testtextPickerDefaultPickerItemHeight0003] fontSize value :" + obj.$attrs.fontSize); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0004 + * @tc.name testtextPickerDefaultPickerItemHeight0004 + * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0004 + */ + it('testtextPickerDefaultPickerItemHeight0004', 0, async function (done) { + console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0004 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('defaultPickerItemHeightText'); + console.info("[testtextPickerDefaultPickerItemHeight0004] component opacity strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextPicker'); + expect(obj.$attrs.opacity).assertEqual(1); + console.info("[testtextPickerDefaultPickerItemHeight0004] opacity value :" + obj.$attrs.opacity); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0005 + * @tc.name testtextPickerDefaultPickerItemHeight0005 + * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0005 + */ + it('testtextPickerDefaultPickerItemHeight0005', 0, async function (done) { + console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0005 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('defaultPickerItemHeightText'); + console.info("[testtextPickerDefaultPickerItemHeight0005] component align strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextPicker'); + expect(obj.$attrs.align).assertEqual("Alignment.Center"); + console.info("[testtextPickerDefaultPickerItemHeight0005] align value :" + obj.$attrs.align); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0006 + * @tc.name testtextPickerDefaultPickerItemHeight0006 + * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0006 + */ + it('testtextPickerDefaultPickerItemHeight0006', 0, async function (done) { + console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0006 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('defaultPickerItemHeightText'); + console.info("[testtextPickerDefaultPickerItemHeight0006] component fontColor strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextPicker'); + expect(obj.$attrs.fontColor).assertEqual(undefined); + console.info("[testtextPickerDefaultPickerItemHeight0006] fontColor value :" + obj.$attrs.fontColor); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0007 + * @tc.name testtextPickerDefaultPickerItemHeight0007 + * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0007 + */ + it('testtextPickerDefaultPickerItemHeight0007', 0, async function (done) { + console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0007 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('defaultPickerItemHeightText'); + console.info("[testtextPickerDefaultPickerItemHeight0007] component lineHeight strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextPicker'); + expect(obj.$attrs.lineHeight).assertEqual(undefined); + console.info("[testtextPickerDefaultPickerItemHeight0007] lineHeight value :" + obj.$attrs.lineHeight); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0009 + * @tc.name testtextPickerDefaultPickerItemHeight0009 + * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0009 + */ + it('testtextPickerDefaultPickerItemHeight0009', 0, async function (done) { + console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight009 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('defaultPickerItemHeightText'); + console.info("[testtextPickerDefaultPickerItemHeight0009] component padding strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextPicker'); + expect(obj.$attrs.padding).assertEqual("0.00px"); + console.info("[testtextPickerDefaultPickerItemHeight0009] padding value :" + obj.$attrs.padding); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0010 + * @tc.name testtextPickerDefaultPickerItemHeight0010 + * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0010 + */ + it('testtextPickerDefaultPickerItemHeight0010', 0, async function (done) { + console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0010 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('defaultPickerItemHeightText'); + console.info("[testtextPickerDefaultPickerItemHeight0010] component textAlign strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('TextPicker'); + expect(obj.$attrs.textAlign).assertEqual(undefined); + console.info("[testtextPickerDefaultPickerItemHeight0010] textAlign value :" + obj.$attrs.textAlign); + done(); + }); + }) +} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..85ae48faaf816faa7f09a833ec450c8b267624c3 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets @@ -0,0 +1,201 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import Utils from './Utils.ets' + +export default function videoOnFullscreenChangeJsunit() { + describe('videoOnFullscreenChangeTest', function () { + beforeAll(async function (done) { + console.info("flex beforeEach start"); + let options = { + uri: 'pages/video', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get video state success " + JSON.stringify(pages)); + if (!("video" == pages.name)) { + console.info("get video state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push video page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push video page error: " + err); + } + done() + }); + + afterEach(async function () { + await Utils.sleep(1000); + console.info("videoOnFullscreenChange after each called"); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0001 + * @tc.name testvideoOnFullscreenChange0001 + * @tc.desic acevideoOnFullscreenChangeEtsTest0001 + */ + it('testvideoOnFullscreenChange0001', 0, async function (done) { + console.info('videoOnFullscreenChange testvideoOnFullscreenChange0001 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onFullscreenChangeText'); + console.info("[testvideoOnFullscreenChange0001] component width strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Video'); + expect(obj.$attrs.width).assertEqual("600.00vp"); + console.info("[testvideoOnFullscreenChange0001] width value :" + obj.$attrs.width); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0002 + * @tc.name testvideoOnFullscreenChange0002 + * @tc.desic acevideoOnFullscreenChangeEtsTest0002 + */ + it('testvideoOnFullscreenChange0002', 0, async function (done) { + console.info('videoOnFullscreenChange testvideoOnFullscreenChange0002 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onFullscreenChangeText'); + console.info("[testvideoOnFullscreenChange0002] component height strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Video'); + expect(obj.$attrs.height).assertEqual("400.00vp"); + console.info("[testvideoOnFullscreenChange0002] height value :" + obj.$attrs.height); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0003 + * @tc.name testvideoOnFullscreenChange0003 + * @tc.desic acevideoOnFullscreenChangeEtsTest0003 + */ + it('testvideoOnFullscreenChange0003', 0, async function (done) { + console.info('videoOnFullscreenChange testvideoOnFullscreenChange0003 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onFullscreenChangeText'); + console.info("[testvideoOnFullscreenChange0003] component fontSize strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Video'); + expect(obj.$attrs.fontSize).assertEqual(undefined); + console.info("[testvideoOnFullscreenChange0003] fontSize value :" + obj.$attrs.fontSize); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0004 + * @tc.name testvideoOnFullscreenChange0004 + * @tc.desic acevideoOnFullscreenChangeEtsTest0004 + */ + it('testvideoOnFullscreenChange0004', 0, async function (done) { + console.info('videoOnFullscreenChange testvideoOnFullscreenChange0004 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onFullscreenChangeText'); + console.info("[testvideoOnFullscreenChange0004] component opacity strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Video'); + expect(obj.$attrs.opacity).assertEqual(1); + console.info("[testvideoOnFullscreenChange0004] opacity value :" + obj.$attrs.opacity); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0005 + * @tc.name testvideoOnFullscreenChange0005 + * @tc.desic acevideoOnFullscreenChangeEtsTest0005 + */ + it('testvideoOnFullscreenChange0005', 0, async function (done) { + console.info('videoOnFullscreenChange testvideoOnFullscreenChange0005 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onFullscreenChangeText'); + console.info("[testvideoOnFullscreenChange0005] component align strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Video'); + expect(obj.$attrs.align).assertEqual("Alignment.Center"); + console.info("[testvideoOnFullscreenChange0005] align value :" + obj.$attrs.align); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0006 + * @tc.name testvideoOnFullscreenChange0006 + * @tc.desic acevideoOnFullscreenChangeEtsTest0006 + */ + it('testvideoOnFullscreenChange0006', 0, async function (done) { + console.info('videoOnFullscreenChange testvideoOnFullscreenChange0006 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onFullscreenChangeText'); + console.info("[testvideoOnFullscreenChange0006] component fontColor strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Video'); + expect(obj.$attrs.fontColor).assertEqual(undefined); + console.info("[testvideoOnFullscreenChange0006] fontColor value :" + obj.$attrs.fontColor); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0007 + * @tc.name testvideoOnFullscreenChange0007 + * @tc.desic acevideoOnFullscreenChangeEtsTest0007 + */ + it('testvideoOnFullscreenChange0007', 0, async function (done) { + console.info('videoOnFullscreenChange testvideoOnFullscreenChange0007 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onFullscreenChangeText'); + console.info("[testvideoOnFullscreenChange0007] component lineHeight strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Video'); + expect(obj.$attrs.lineHeight).assertEqual(undefined); + console.info("[testvideoOnFullscreenChange0007] lineHeight value :" + obj.$attrs.lineHeight); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0009 + * @tc.name testvideoOnFullscreenChange0009 + * @tc.desic acevideoOnFullscreenChangeEtsTest0009 + */ + it('testvideoOnFullscreenChange0009', 0, async function (done) { + console.info('videoOnFullscreenChange testvideoOnFullscreenChange009 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onFullscreenChangeText'); + console.info("[testvideoOnFullscreenChange0009] component padding strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Video'); + expect(obj.$attrs.padding).assertEqual("0.00px"); + console.info("[testvideoOnFullscreenChange0009] padding value :" + obj.$attrs.padding); + done(); + }); + + /* + * @tc.number SUB_ACE_BASIC_ETS_API_0010 + * @tc.name testvideoOnFullscreenChange0010 + * @tc.desic acevideoOnFullscreenChangeEtsTest0010 + */ + it('testvideoOnFullscreenChange0010', 0, async function (done) { + console.info('videoOnFullscreenChange testvideoOnFullscreenChange0010 START'); + await Utils.sleep(2000); + let strJson = getInspectorByKey('onFullscreenChangeText'); + console.info("[testvideoOnFullscreenChange0010] component textAlign strJson:" + strJson); + let obj = JSON.parse(strJson); + expect(obj.$type).assertEqual('Video'); + expect(obj.$attrs.textAlign).assertEqual(undefined); + console.info("[testvideoOnFullscreenChange0010] textAlign value :" + obj.$attrs.textAlign); + done(); + }); + }) +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetInfoSync.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetInfoSync.test.ets new file mode 100755 index 0000000000000000000000000000000000000000..d7c3449d82b3dd9717f70fac73df4173af01358b --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetInfoSync.test.ets @@ -0,0 +1,234 @@ +/** + * 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 { describe,beforeAll, it, expect } from 'hypium/index'; +import Utils from './Utils'; +import Bundle from '@ohos.bundle'; +import account from '@ohos.account.osAccount'; + +const BUNDLE_NAME = 'com.open.harmony.packagemag'; +const PATH = "/data/app/el1/bundle/public"; +let userId = 0; + +export default function GetInfoSync() { + + describe('GetInfoSync', function () { + + beforeAll(async function (done) { + await account.getAccountManager().getOsAccountLocalIdFromProcess().then(account => { + console.info("getOsAccountLocalIdFromProcess userid ==========" + account); + userId = account; + done(); + }).catch(err=>{ + console.info("getOsAccountLocalIdFromProcess err ==========" + JSON.stringify(err)); + done(); + }) + }); + + /** + * @tc.number: getApplicationInfoSync_0100 + * @tc.name: getApplicationSyncWithRightNameAndUserId + * @tc.desc: Test indicates the right bundleName, bundleFlags and userId + * returns the ApplicationInfo object + */ + it('getApplicationSyncWithRightNameAndUserId', 0, async function (done) { + var applicationInfo = Bundle.getApplicationInfoSync(BUNDLE_NAME, + Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION, userId) + expect(typeof (applicationInfo)).assertEqual("object"); + getApplicationInfoSuccess("getApplicationSyncWithRightNameAndUserId", applicationInfo); + done(); + }) + + /** + * @tc.number: getApplicationInfoSync_0200 + * @tc.name: getApplicationSyncWithWrongNameAndUserId + * @tc.desc: Test indicates the wrong bundleName, bundleFlags and userId + * returns the ApplicationInfo undefined + */ + it('getApplicationSyncWithWrongNameAndUserId', 0, async function (done) { + let bundleName = "wrong"; + var applicationInfo = Bundle.getApplicationInfoSync(bundleName, + Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION, userId); + expect(JSON.stringify(applicationInfo)).assertEqual(undefined); + done(); + }) + + /** + * @tc.number: getApplicationInfoSync_0300 + * @tc.name: getApplicationSyncWithRightName + * @tc.desc: Test indicates the right bundleName, bundleFlags + * returns the ApplicationInfo object + */ + it('getApplicationSyncWithRightName', 0, async function (done) { + let applicationInfo = Bundle.getApplicationInfoSync(BUNDLE_NAME, + Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION) + expect(typeof (applicationInfo)).assertEqual("object"); + getApplicationInfoSuccess("getApplicationSyncWithRightName", applicationInfo); + done(); + }) + + /** + * @tc.number: getApplicationInfoSync_0400 + * @tc.name: getApplicationSyncWithWrongName + * @tc.desc: Test indicates the wrong bundleName, bundleFlags + * returns the ApplicationInfo undefined + */ + it('getApplicationSyncWithWrongName', 0, async function (done) { + let bundleName = "wrong"; + let applicationInfo = Bundle.getApplicationInfoSync(bundleName, + Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION); + expect(JSON.stringify(applicationInfo)).assertEqual(undefined); + done(); + }) + + /** + * @tc.number: getBundleInfoSync_0100 + * @tc.name: getBundleInfoSyncWithRightNameAndUserId + * @tc.desc: Test indicates the right bundleName, bundleFlags, options + * returns the BundleInfo object + */ + it('getBundleInfoSyncWithRightNameAndUserId', 0, async function (done) { + let options = {userId : userId}; + let bundleInfo = Bundle.getBundleInfoSync(BUNDLE_NAME, + Bundle.BundleFlag.GET_BUNDLE_DEFAULT, options); + expect(typeof (bundleInfo)).assertEqual("object"); + getBundleInfoSuccess("getBundleInfoSyncWithRightNameAndUserId", bundleInfo); + done(); + }) + + /** + * @tc.number: getBundleInfoSync_0200 + * @tc.name: getBundleInfoSyncWithWrongNameAndUserId + * @tc.desc: Test indicates the right bundleName, bundleFlags, options + * returns the BundleInfo undefined + */ + it('getBundleInfoSyncWithWrongNameAndUserId', 0, async function (done) { + let options = {userId : userId}; + let bundleName = "wrong"; + let bundleInfo = Bundle.getBundleInfoSync(bundleName, + Bundle.BundleFlag.GET_BUNDLE_DEFAULT, options); + expect(JSON.stringify(bundleInfo)).assertEqual(undefined); + done(); + }) + + /** + * @tc.number: getBundleInfoSync_0300 + * @tc.name: getBundleInfoSyncWithRightName + * @tc.desc: Test indicates the right bundleName, bundleFlags + * returns the BundleInfo object + */ + it('getBundleInfoSyncWithRightName', 0, async function (done) { + let info = Bundle.getBundleInfoSync(BUNDLE_NAME, Bundle.BundleFlag.GET_BUNDLE_DEFAULT); + expect(typeof (info)).assertEqual("object"); + getBundleInfoSuccess("getBundleInfoSyncWithRightName", info); + done(); + }) + + /** + * @tc.number: getBundleInfoSync_0400 + * @tc.name: getBundleInfoSyncWithWrongName + * @tc.desc: Test indicates the right bundleName, bundleFlags + * returns the BundleInfo undefined + */ + it('getBundleInfoSyncWithWrongName', 0, async function (done) { + let bundleName = "wrong"; + let info = Bundle.getBundleInfoSync(bundleName, Bundle.BundleFlag.GET_BUNDLE_DEFAULT); + expect(JSON.stringify(info)).assertEqual(undefined); + done(); + }) + + function getBundleInfoSuccess(msg, data) { + expect(data.name).assertEqual(BUNDLE_NAME); + expect(data.type).assertEqual(""); + expect(data.appId).assertContain(BUNDLE_NAME); + expect(data.uid).assertLarger(0); + expect(data.installTime).assertLarger(0); + expect(data.updateTime).assertLarger(0); + expect(data.abilityInfos.length).assertEqual(0); + expect(data.appInfo.name).assertEqual(BUNDLE_NAME); + expect(data.appInfo.codePath).assertEqual(PATH + '/' + BUNDLE_NAME); + expect(data.appInfo.accessTokenId > 0).assertEqual(true); + expect(data.appInfo.description).assertEqual('$string:entry_description'); + expect(data.appInfo.descriptionId > 0).assertEqual(true); + expect(data.appInfo.icon).assertEqual('$media:icon'); + expect(data.appInfo.iconId > 0).assertEqual(true); + expect(data.appInfo.iconIndex > 0).assertEqual(true); + expect(data.appInfo.iconIndex).assertEqual(data.appInfo.iconId); + expect(data.appInfo.uid > 0).assertEqual(true); + expect(data.appInfo.label).assertEqual('$string:entry_MainAbility'); + expect(data.appInfo.labelId > 0).assertEqual(true); + expect(data.appInfo.labelIndex > 0).assertEqual(true); + expect(data.appInfo.labelIndex).assertEqual(data.appInfo.labelId); + expect(data.appInfo.systemApp).assertEqual(false); + expect(data.appInfo.supportedModes).assertEqual(0); + expect(data.appInfo.process).assertEqual(BUNDLE_NAME); + expect(data.appInfo.entryDir).assertEqual(PATH + '/' + BUNDLE_NAME + '/' + BUNDLE_NAME); + expect(data.appInfo.enabled).assertEqual(true); + expect(data.appInfo.entityType).assertEqual('unspecified'); + expect(data.appInfo.removable).assertEqual(true); + expect(data.appInfo.moduleInfos[0].moduleName).assertEqual('entry'); + expect(data.appInfo.moduleInfos[0].moduleSourceDir).assertEqual(PATH + '/' + BUNDLE_NAME + '/' + BUNDLE_NAME); + expect(data.appInfo.moduleSourceDirs[0]).assertEqual(PATH + '/' + BUNDLE_NAME + '/' + BUNDLE_NAME); + expect(data.appInfo.permissions.length).assertEqual(0); + expect(data.reqPermissions.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.vendor).assertEqual("ohos"); + expect(data.versionCode).assertEqual(1000000); + expect(data.versionName).assertEqual("1.0.0"); + expect(data.compatibleVersion).assertEqual(7); + expect(data.targetVersion).assertEqual(7); + expect(data.isCompressNativeLibs).assertEqual(true); + expect(data.entryModuleName).assertEqual("entry"); + expect(data.cpuAbi).assertEqual(""); + expect(data.isSilentInstallation.length).assertEqual(0); + expect(data.hapModuleInfos.length > 0).assertEqual(true); + expect(data.minCompatibleVersionCode).assertEqual(1000000); + expect(data.entryInstallationFree).assertEqual(false); + expect(data.reqPermissionStates.length).assertEqual(0); + expect(data.extensionAbilityInfo.length).assertEqual(0); + } + + function getApplicationInfoSuccess(msg, data) { + expect(data.name).assertEqual(BUNDLE_NAME); + expect(data.codePath).assertEqual(PATH + '/' + BUNDLE_NAME); + expect(data.accessTokenId > 0).assertEqual(true); + expect(data.description).assertEqual('$string:entry_description'); + expect(data.descriptionId > 0).assertEqual(true); + expect(data.icon).assertEqual('$media:icon'); + expect(data.iconId > 0).assertEqual(true); + expect(data.iconIndex > 0).assertEqual(true); + expect(data.iconIndex).assertEqual(data.iconId); + expect(data.uid > 0).assertEqual(true); + expect(data.label).assertEqual('$string:entry_MainAbility'); + expect(data.labelId > 0).assertEqual(true); + expect(data.labelIndex > 0).assertEqual(true); + expect(data.labelIndex).assertEqual(data.labelId); + expect(data.systemApp).assertEqual(false); + expect(data.supportedModes).assertEqual(0); + expect(data.process).assertEqual(BUNDLE_NAME); + expect(data.entryDir).assertEqual(PATH + '/' + BUNDLE_NAME + '/' + BUNDLE_NAME); + expect(data.enabled).assertEqual(true); + expect(data.entityType).assertEqual('unspecified'); + expect(data.removable).assertEqual(true); + expect(data.moduleInfos[0].moduleName).assertEqual('entry'); + expect(data.moduleInfos[0].moduleSourceDir).assertEqual(PATH + '/' + BUNDLE_NAME + '/' + BUNDLE_NAME); + expect(data.moduleSourceDirs[0]).assertEqual(PATH + '/' + BUNDLE_NAME + '/' + BUNDLE_NAME); + expect(data.permissions[0]).assertEqual("ohos.permission.GET_BUNDLE_INFO"); + expect(data.permissions[1]).assertEqual("ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"); + expect(data.permissions[2]).assertEqual("ohos.permission.USE_BLUETOOTH"); + console.log(msg + ' end ' + JSON.stringify(data)); + } + }); + +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/List.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/List.test.ets index 5bec9e41af6ce21bc6b85b7aa1cf796476260df6..5c9e67285ee276b388168fc696793b6744986fac 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/List.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/List.test.ets @@ -27,6 +27,7 @@ import getQueryAbilityByWant from './GetQueryAbilityByWant.test.ets'; import isDefaultApplicationTest from './IsDefaultApplication.test.ets'; import getWindowPorperties from './getWindowProperties.test.ets'; import GetSecondModuleTest from './GetSecondModule.test.ets'; +import GetInfoSync from './GetInfoSync.test.ets'; export default function testsuite() { getBundleArchiveInfo(); @@ -48,4 +49,5 @@ export default function testsuite() { isApplicationEnabledETSUnit(); getWindowPorperties(); GetSecondModuleTest(); + GetInfoSync(); } \ No newline at end of file diff --git a/commonlibrary/BUILD.gn b/commonlibrary/BUILD.gn index 36dcfb3586c9f0d98e8003dd2ac13a4bdd00f6ae..95ed8868633de7abdf57a72ad4a4034eddebef56 100644 --- a/commonlibrary/BUILD.gn +++ b/commonlibrary/BUILD.gn @@ -15,6 +15,9 @@ import("//test/xts/tools/build/suite.gni") group("commonlibrary") { testonly = true if (is_standard_system) { - deps = [ "ets_utils:ets_utils" ] + deps = [ + "ets_utils:ets_utils", + "toolchain:toolchain", + ] } } diff --git a/commonlibrary/toolchain/BUILD.gn b/commonlibrary/toolchain/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..be6736db53843ade7285edfdbcbf87b29ff9f2bc --- /dev/null +++ b/commonlibrary/toolchain/BUILD.gn @@ -0,0 +1,123 @@ +# 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("//build/ohos_var.gni") +import("//test/xts/tools/build/suite.gni") + +group("toolchain") { + testonly = true + deps = [ "//third_party/musl:libctest" ] + if (is_standard_system) { + deps += [ ":tar_dllib" ] + } +} + +action("tar_testcases") { + testonly = true + deps = [ + "libc-test:ActToolChainTest", + "//third_party/musl:libctest", + ] + project_dir = rebase_path(".") + print("project_dir-58:", project_dir) + project_dird = rebase_path("tar_files.py", ".", root_out_dir) + print("project_dird-60:", project_dird) + + project_dirf = project_dir + "/" + project_dird + print("project_dirf-64:", project_dirf) + + test_path = string_replace(project_dirf, "/tar_files.py", "") + script = rebase_path( + "//test/xts/acts/commonlibrary/toolchain/libc-test/tar_files.py") + + _outputs = [ "$target_out_dir/libc-test.tar" ] + outputs = _outputs + + input_path = rebase_path("$test_path/tests/unittest/libc-test") + output_path = rebase_path("$test_path/suites/acts/testcases/libc-test.tar") + + print("root_build_dir-49", root_build_dir) + args = [ + "--input_path", + input_path, + "--output_path", + output_path, + "--temp_path", + "./libc-test", + ] +} + +action("tar_dllib") { + testonly = true + deps = [ ":tar_testcases" ] + project_dir = rebase_path(".") + print("project_dir-58:", project_dir) + project_dird = rebase_path("tar_files.py", ".", root_out_dir) + print("project_dird-60:", project_dird) + + project_dirf = project_dir + "/" + project_dird + print("project_dirf-64:", project_dirf) + + dllib_path = string_replace(project_dirf, "/tar_files.py", "") + script = rebase_path( + "//test/xts/acts/commonlibrary/toolchain/libc-test/tar_files.py") + + if (target_cpu == "arm") { + _outputs = [ "$target_out_dir/libc-test-lib.tar" ] + outputs = _outputs + + input_path = rebase_path("$dllib_path/musl/libc-test-lib") + output_path = + rebase_path("$dllib_path/suites/acts/testcases/libc-test-lib.tar") + + print("root_build_dir-49", root_build_dir) + args = [ + "--input_path", + input_path, + "--output_path", + output_path, + "--temp_path", + "./libc-test-lib", + ] + } else if (target_cpu == "arm64") { + _outputs = [ "$target_out_dir/libc-test-lib.tar" ] + outputs = _outputs + + input_path = rebase_path("$dllib_path/musl/libc-test-lib") + output_path = + rebase_path("$dllib_path/suites/acts/testcases/libc-test-lib.tar") + print("root_build_dir-49", root_build_dir) + args = [ + "--input_path", + input_path, + "--output_path", + output_path, + "--temp_path", + "./libc-test-lib", + ] + } else { + _outputs = [ "" ] + outputs = _outputs + + input_path = rebase_path("") + output_path = rebase_path("") + print("root_build_dir-49", root_build_dir) + args = [ + "--input_path", + input_path, + "--output_path", + output_path, + "--temp_path", + "./libc-test-lib", + ] + } +} diff --git a/commonlibrary/toolchain/libc-test/BUILD.gn b/commonlibrary/toolchain/libc-test/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..6005a9e89a0457c9d7141dfd59b330ef73c7832d --- /dev/null +++ b/commonlibrary/toolchain/libc-test/BUILD.gn @@ -0,0 +1,54 @@ +# 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("//build/test.gni") +import("//test/xts/tools/build/suite.gni") + +#module_output_path = "hits/huks_standard" +######################################################## +config("module_private_config") { + visibility = [ ":*" ] + include_dirs = [ + "//utils/native/base/include", + "//third_party/bounds_checking_function/include", + "//third_party/musl/porting/linux/user/include", + "//test/xts/acts/security_lite/huks/common/include", + ] +} + +######################################################## +ohos_moduletest_suite("ActToolChainTest") { + configs = [ ":module_private_config" ] + cflags_cc = [ "-DHILOG_ENABLE" ] + defines = [ "_STANDARD_SYSTEM_" ] + + sources = [ + "include/getfiles.cpp", + "include/setrlim.cpp", + "src/toolchaintest.cpp", + ] + + include_dirs = [ + "//utils/native/base/include", + "//third_party/bounds_checking_function/include", + "//third_party/musl/porting/linux/user/include/", + "//third_party/musl/porting/linux/user/src/sched", + "/third_party/musl/libc-test/src/commom", + "./include", + ] + + deps = [ + "//third_party/bounds_checking_function:libsec_static", + "//utils/native/base:utils", + ] +} diff --git a/commonlibrary/toolchain/libc-test/Test.json b/commonlibrary/toolchain/libc-test/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..5a5c259da581f2702b9ee15f28f174dd1a79d441 --- /dev/null +++ b/commonlibrary/toolchain/libc-test/Test.json @@ -0,0 +1,165 @@ +{ + "description": "Configuration for ActToolChainTest Tests", + "driver": { + "type": "CppTest", + "native-test-timeout": "3600000", + "module-name": "ActToolChainTest", + "runtime-hint": "100s", + "native-test-device-path": "/data/local/tmp" + }, + "kits": [ + { + "push": [ + "ActToolChainTest->/data/local/tmp/ActToolChainTest", + "libc-test.tar->/data/local/tmp/libc-test.tar", + "libc-test-lib.tar->/data/local/tmp/libc-test-lib.tar" + ], + "type": "PushKit", + "post-push": [ + "mkdir /tmp", + "mkdir /dev/shm", + "mkdir /src", + "mkdir /src/functional", + "tar -xf /data/local/tmp/libc-test.tar -C /data/local/tmp/", + "tar -xf /data/local/tmp/libc-test-lib.tar -C /data/local/tmp/", + "chmod a+x -R /data/local/tmp/libc-test-lib", + "chmod a+x -R /data/local/tmp/libc-test", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/misc/vsyslog", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/temp/mkstemps", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/temp/mkostemps", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/linux/syncfs", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/linux/sync_file_range", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/linux/tee", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/linux/sendfile ", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/linux/removexattr", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/linux/copy_file_range", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/linux/setxattr", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/linux/splice", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/mman/mremap", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/mman/mincore", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/mman/msync", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/dirent/rewinddir", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/dirent/scandir ", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/dirent/readdir_r", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/manual/termios/tcgetattr", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/manual/termios/tcsendbreak", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/manual/termios/tcgetsid", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/manual/termios/tcsetattr", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/manual/env/a_stack_chk_fail", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/manual/unistd/tcsetpgrp", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/manual/unistd/ttyname", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/manual/unistd/tcgetpgrp", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/manual/unistd/isatty", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/fcntl/posix_fallocate", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/fcntl/posix_fadvise", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/passwd/getgrnam_r", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/ipc/ftok", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/stdio/freopen", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/stdio/__fwritable", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/stdio/setbuffer", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/stdio/vfscanf", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/stdio/tmpfile", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/stdio/__fwriting", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/stdio/setbuf", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/stdio/getwc", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/stdio/ungetwc", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/stdio/setlinebuf", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/stdio/fputc", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/stdio/fputs", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/truncate", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/fchownat", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/fsync", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/linkat", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/lchown", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/faccessat", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/unlinkat", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/acct", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/exit", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/readlinkat", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/write", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/getpid", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/exittest02", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/unlink", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/readv", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/unistd/pread ", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/misc/syslog", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/misc/vsyslog", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/network/res_query", + "rm -rf /data/local/tmp/libc-test/src/functionalext/dlns/dlns_dlopen_test ", + "rm -rf /data/local/tmp/libc-test/src/functionalext/dlns/dlns_set_fun_test", + "rm -rf /data/local/tmp/libc-test/src/functionalext/dlns/dlns_inherit_test", + "rm -rf /data/local/tmp/libc-test/src/functionalext/dlns/dlns_dlsym_test", + "rm -rf /data/local/tmp/libc-test/src/functionalext/dlns/dlns_special_scene_test", + "rm -rf /data/local/tmp/libc-test/src/functionalext/dlns/dlns_separated_test", + "rm -rf /data/local/tmp/libc-test/src/functionalext/relro/dlopen_ext_relro_test", + "rm -rf /data/local/tmp/libc-test/src/functionalext/tgkill/tgkill", + "rm -rf /data/local/tmp/libc-test/src/functionalext/time/strptime", + "rm -rf /data/local/tmp/libc-test/src/functionalext/time/ctime", + "rm -rf /data/local/tmp/libc-test/src/functionalext/time/asctime", + "rm -rf /data/local/tmp/libc-test/src/functionalext/time/strftime_l", + "rm -rf /data/local/tmp/libc-test/src/functionalext/time/strftime", + "rm -rf /data/local/tmp/libc-test/src/functionalext/time/localtime_r", + "rm -rf /data/local/tmp/libc-test/src/functionalext/time/localtime", + "rm -rf /data/local/tmp/libc-test/src/functionalext/time/ctime_r", + "rm -rf /data/local/tmp/libc-test/src/functionalext/time/timegm", + "rm -rf /data/local/tmp/libc-test/src/functionalext/time/asctime_r", + "rm -rf /data/local/tmp/libc-test/src/functionalext/trace/trace_stresstest", + "rm -rf /data/local/tmp/libc-test/src/functionalext/ldso_randomization/ldso_randomization_test", + "rm -rf /data/local/tmp/libc-test/src/functionalext/ldso_randomization/ldso_randomization_manual", + "rm -rf /data/local/tmp/libc-test/src/functionalext/symver/dlsym", + "rm -rf /data/local/tmp/libc-test/src/functionalext/symver/dynlink", + "rm -rf /data/local/tmp/libc-test/src/functionalext/symver/reloc_symver", + "rm -rf /data/local/tmp/libc-test/src/functionalext/symver/dynlink_default", + "rm -rf /data/local/tmp/libc-test/src/functionalext/symver/dlvsym", + "rm -rf /data/local/tmp/libc-test/src/functional/sem_open", + "rm -rf /data/local/tmp/libc-test/src/functional/ipc_shm", + "rm -rf /data/local/tmp/libc-test/src/functional/tgkill", + "rm -rf /data/local/tmp/libc-test/src/functional/fcntl ", + "rm -rf /data/local/tmp/libc-test/src/functional/tls_init_dlopen", + "rm -rf /data/local/tmp/libc-test/src/functional/tls_align", + "rm -rf /data/local/tmp/libc-test/src/functional/dlopen_ns", + "rm -rf /data/local/tmp/libc-test/src/functional/tls_align_dlopen", + "rm -rf /data/local/tmp/libc-test/src/functional/utim", + "rm -rf /data/local/tmp/libc-test/src/functional/dlclose_reset", + "rm -rf /data/local/tmp/libc-test/src/functional/ipc_sem", + "rm -rf /data/local/tmp/libc-test/src/functional/ungetc", + "rm -rf /data/local/tmp/libc-test/src/functional/fscanf", + "rm -rf /data/local/tmp/libc-test/src/functional/pthread_cancel", + "rm -rf /data/local/tmp/libc-test/src/functional/tls_init", + "rm -rf /data/local/tmp/libc-test/src/functional/fdopen", + "rm -rf /data/local/tmp/libc-test/src/functional/fwscanf", + "rm -rf /data/local/tmp/libc-test/src/functional/dlopen", + "rm -rf /data/local/tmp/libc-test/src/functional/ipc_msg", + "rm -rf /data/local/tmp/libc-test/src/regression/ftello-unflushed-append", + "rm -rf /data/local/tmp/libc-test/src/regression/malloc-brk-fail", + "rm -rf /data/local/tmp/libc-test/src/regression/pthread_atfork-errno-clobber", + "rm -rf /data/local/tmp/libc-test/src/regression/fflush-exit", + "rm -rf /data/local/tmp/libc-test/src/regression/lseek-large", + "rm -rf /data/local/tmp/libc-test/src/regression/tls_get_new-dtv", + "rm -rf /data/local/tmp/libc-test/src/regression/flockfile-list", + "rm -rf /data/local/tmp/libc-test/src/math/rintf", + "rm -rf /data/local/tmp/libc-test/src/math/nearbyint", + "rm -rf /data/local/tmp/libc-test/src/math/fma", + "rm -rf /data/local/tmp/libc-test/src/math/fmal", + "rm -rf /data/local/tmp/libc-test/src/math/acoshl", + "rm -rf /data/local/tmp/libc-test/src/math/tgammal", + "rm -rf /data/local/tmp/libc-test/src/math/sqrtl", + "rm -rf /data/local/tmp/libc-test/src/math/erfcl", + "rm -rf /data/local/tmp/libc-test/src/math/rint", + "rm -rf /data/local/tmp/libc-test/src/math/lgammal", + "rm -rf /data/local/tmp/libc-test/src/math/nearbyintf", + "rm -rf /data/local/tmp/libc-test/src/math/fmaf", + "rm -rf /data/local/tmp/libc-test/src/math/sqrtf", + "rm -rf /data/local/tmp/libc-test/src/math/rintl", + "rm -rf /data/local/tmp/libc-test/src/math/sqrt", + "rm -rf /data/local/tmp/libc-test/src/math/nearbyintl", + "rm -rf /data/local/tmp/libc-test/src/math/fenv", + "rm -rf /data/local/tmp/libc-test/src/math/asinhl", + "rm -rf /data/local/tmp/libc-test/src/functionalext/info/fatal_message", + "rm -rf /data/local/tmp/libc-test/src/functional/utime", + "rm -rf /data/local/tmp/libc-test/src/functionalext/supplement/manual/network" + ], + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/commonlibrary/toolchain/libc-test/include/getfiles.cpp b/commonlibrary/toolchain/libc-test/include/getfiles.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0e2d4ea2ea6fa9c4a2ef9bcc216bd79aedcc7393 --- /dev/null +++ b/commonlibrary/toolchain/libc-test/include/getfiles.cpp @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "gettestfiles.cpp" + +#include "runtest.h" +namespace OHOS { +using namespace std; + +static vector filenames; +std::vector runtest::GetFileNames(std::string path) +{ + vector tempName; + GetTestNames(path, tempName); + for (size_t i = 0; i < tempName.size(); i++) { + if ((tempName[i].find("stat", path.length()-1) != -1) || + (tempName[i].find("sem_close-unmap", path.length()-1) != -1) || + (tempName[i].find("runtest", path.length()-1) != -1)) { + continue; + } + filenames.push_back(tempName[i]); + } + return filenames; +} +} // namespace OHOS \ No newline at end of file diff --git a/commonlibrary/toolchain/libc-test/include/gettestfiles.cpp b/commonlibrary/toolchain/libc-test/include/gettestfiles.cpp new file mode 100644 index 0000000000000000000000000000000000000000..23b3c2013386af383a144fde942ae4c11c23f2c3 --- /dev/null +++ b/commonlibrary/toolchain/libc-test/include/gettestfiles.cpp @@ -0,0 +1,44 @@ +/* + * 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. + */ + +#include +#include +#include +#include + +#include "runtest.h" + +static void GetTestNames(std::string path, std::vector& tempName) +{ + DIR *pDir; + struct dirent* ptr; + std::string p; + if (!(pDir = opendir(path.c_str()))) { + std::cout << "Folder doesn't Exist!" << std::endl; + return; + } + while ((ptr = readdir(pDir)) != nullptr) { + if (ptr->d_type == DT_DIR) { + if (strcmp(ptr->d_name, ".") != 0 && strcmp(ptr->d_name, "..") != 0) { + GetTestNames(path + "/" + ptr->d_name, tempName); + } + } else { + if (strcmp(ptr->d_name, ".") != 0 && strcmp(ptr->d_name, "..") != 0) { + tempName.push_back(path + "/" + ptr->d_name); + } + } + } + closedir(pDir); +} \ No newline at end of file diff --git a/commonlibrary/toolchain/libc-test/include/runtest.h b/commonlibrary/toolchain/libc-test/include/runtest.h new file mode 100644 index 0000000000000000000000000000000000000000..c9554b38b601599d0006cd9ba21f935b0ca75cd4 --- /dev/null +++ b/commonlibrary/toolchain/libc-test/include/runtest.h @@ -0,0 +1,28 @@ +/* + * 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. + */ +#ifndef TOOLCHAIN_RUNTEST_H +#define TOOLCHAIN_RUNTEST_H + +#include +#include +#include +namespace OHOS { +class runtest { +public: + static int t_setrlim(int r, long lim); + static std::vector GetFileNames(std::string path); +}; +} // namespace OHOS +#endif // TOOLCHAIN_LIBC_TEST_INCLUDE_RUNTEST_H_ diff --git a/commonlibrary/toolchain/libc-test/include/setrlim.cpp b/commonlibrary/toolchain/libc-test/include/setrlim.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cb89e5198288c2c84a91e29b4ca0b8eda43854d5 --- /dev/null +++ b/commonlibrary/toolchain/libc-test/include/setrlim.cpp @@ -0,0 +1,44 @@ +/* + * 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. + */ +#include +#include +#include +#include + +#include "runtest.h" +namespace OHOS { +int runtest::t_setrlim(int r, long lim) +{ + struct rlimit rl; + //Gets the current stack size + if (getrlimit(r, &rl)) { + printf("getrlimit %d: %s\n", r, strerror(errno)); + return -1; + } + if (lim > rl.rlim_max) { + return -1; + } + if (lim == rl.rlim_max && lim == rl.rlim_cur) { + return 0; + } + rl.rlim_max = lim; + rl.rlim_cur = lim; + if (setrlimit(r, &rl)) { + printf("setrlimit(%d, %ld): %s\n", r, lim, strerror(errno)); + return -1; + } + return 0; +} +} // namespace OHOS \ No newline at end of file diff --git a/commonlibrary/toolchain/libc-test/src/toolchaintest.cpp b/commonlibrary/toolchain/libc-test/src/toolchaintest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a88b6aa0b8ec8d866f954f6984e9d44cd311533b --- /dev/null +++ b/commonlibrary/toolchain/libc-test/src/toolchaintest.cpp @@ -0,0 +1,141 @@ +/* + * 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. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gtest/gtest.h" +#include "runtest.h" + +using namespace std; +using namespace testing::ext; +using namespace testing; +namespace OHOS { +class toolchaintest : public ::testing::TestWithParam {}; + +static string filepath = "/data/local/tmp/libc-test/src"; +static vector temp = runtest::GetFileNames(filepath); + +volatile int t_status = 0; + +static void handler(int sig) +{ +} + +static int start(const char *argvs) +{ + int pid, space_size = 100*1024; + //Create a child process + //Set the process stack space + pid = fork(); + if (pid == 0) { + runtest::t_setrlim(RLIMIT_STACK, space_size); + //Overloading the subprocess space + int exe = execl(argvs, "strptime", nullptr); + printf("exe:%d %s exec failed: %s\n", exe, argvs, strerror(errno)); + exit(1); + } + return pid; +} + +static int runTests(const char *argvs) +{ + int timeoutsec = 5, timeout = 0; + int status, pid; + sigset_t set; + void (*retfunc)(int); + //signal set + sigemptyset(&set); + sigaddset(&set, SIGCHLD); + sigprocmask(SIG_BLOCK, &set, nullptr); + retfunc = signal(SIGCHLD, handler); + if (retfunc == SIG_ERR) { + printf("signal triggering failed:%s\n", strerror(errno)); + } + pid = start(argvs); + //The function system call failed + if (pid == -1) { + printf("%s fork failed: %s\n", argvs, strerror(errno)); + printf("FAIL %s [internal]\n", argvs); + return -1; + } + struct timespec tp; + //Maximum blocking time + tp.tv_sec = timeoutsec; + tp.tv_nsec = 0; + if (sigtimedwait(&set, nullptr, &tp) == -1) { + //Call it again + if (errno == EAGAIN) { + timeout = 1; + } else { + printf("%s sigtimedwait failed: %s\n", argvs, strerror(errno)); + } + if (kill(pid, SIGKILL) == -1) { + printf("%s kill failed: %s\n", argvs, strerror(errno)); + } + } + //Waiting for the process to stop + if (waitpid(pid, &status, 0) != pid) { + printf("%s waitpid failed: %s\n", argvs, strerror(errno)); + printf("FAIL %s [internal]\n", argvs); + return -1; + } + //Process state + if (WIFEXITED(status)) { //The right exit + if (WEXITSTATUS(status) == 0) { //operate successfully + return t_status; + } + printf("FAIL %s [status %d]\n", argvs, WEXITSTATUS(status)); + } else if (timeout) { + printf("FAIL %s [timed out]\n", argvs); + } else if (WIFSIGNALED(status)) { + printf("FAIL %s [signal %s]\n", argvs, strsignal(WTERMSIG(status))); + } else { + printf("FAIL %s [unknown]\n", argvs); + } + return 1; +} + + +/** + * @tc.name : toolchaintest.LibcTest + * @tc.desc : start test + * @tc.level : Level 3 + */ +HWTEST_P(toolchaintest, LibcTest, Function | MediumTest | Level3) +{ + int ret; + string testName = GetParam(); + ret = runTests(testName.c_str()); + if (ret == 0) { + EXPECT_EQ(0, ret) << "test " << testName << " succeed" << endl; + } else { + EXPECT_EQ(1, ret) << "test " << testName << " failed" << endl; + EXPECT_EQ(-1, ret) << "test " << testName << " failed" << endl; + } +} +INSTANTIATE_TEST_SUITE_P(libcTest, toolchaintest, testing::ValuesIn(temp.begin(), temp.end())); +} // namespace OHOS \ No newline at end of file diff --git a/commonlibrary/toolchain/libc-test/tar_files.py b/commonlibrary/toolchain/libc-test/tar_files.py new file mode 100755 index 0000000000000000000000000000000000000000..1d745e6ebde81d5cf6df0be7c828ca0e9f9719f8 --- /dev/null +++ b/commonlibrary/toolchain/libc-test/tar_files.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Copyright (c) 2020-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 os +import argparse +import tarfile +import shutil + +copyFileCounts = 0 + +def copyFiles(sourceDir, targetDir): + global copyFileCounts + for f in os.listdir(sourceDir): + sourceF = os.path.join(sourceDir, f) + targetF = os.path.join(targetDir, f) + if not os.path.isfile(sourceF): + if os.path.isdir(sourceF): + copyFiles(sourceF, targetF) + elif os.path.isfile(sourceF): + if os.path.exists(targetDir): + copyFileCounts += 1 + open(targetF, "wb").write(open(sourceF, "rb").read()) + elif not os.path.exists(targetDir): + os.makedirs(targetDir) + copyFileCounts += 1 + open(targetF, "wb").write(open(sourceF, "rb").read()) + +def make_targz_one_by_one(output_filename, source_dir): + tar = tarfile.open(output_filename,"w") + for root,dir,files in os.walk(source_dir): + for file in files: + pathfile = os.path.join(root, file) + tar.add(pathfile) + tar.close() + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='manual to this script') + parser.add_argument("--input_path", type=str, default="0") + parser.add_argument("--output_path", type=str, default="0") + parser.add_argument("--temp_path", type=str, default="0") + args = parser.parse_args() + print(args.input_path) + print(args.output_path) + print(args.temp_path) + + copyFiles(args.input_path, args.temp_path) + make_targz_one_by_one(args.output_path, args.temp_path) + + shutil.rmtree(args.temp_path) #delete middle files \ No newline at end of file diff --git a/communication/dsoftbus/rpc/Test.json b/communication/dsoftbus/rpc/Test.json index d30fe8c61cd911076108bfb57128c2e73b6086c6..64b24131994477ff3cec9dd94382111ae24f2e17 100644 --- a/communication/dsoftbus/rpc/Test.json +++ b/communication/dsoftbus/rpc/Test.json @@ -13,7 +13,7 @@ { "test-file-name": [ "ActsRpcHapTest.hap", - "./testcases/ActsRpcHapServer.hap" + "ActsRpcHapServer.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/customization/TestExtensionAbility_001/BUILD.gn b/customization/TestExtensionAbility_001/BUILD.gn index 3370320005572208b4d69c6cf6672fac2d5e1e02..468dd66ea400cb150dcb22ff015e45dbcf36236e 100644 --- a/customization/TestExtensionAbility_001/BUILD.gn +++ b/customization/TestExtensionAbility_001/BUILD.gn @@ -13,7 +13,7 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ExtensionZeroTest") { +ohos_hap_assist_suite("ExtensionZeroTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ diff --git a/customization/TestExtensionAbility_001/Test.json b/customization/TestExtensionAbility_001/Test.json deleted file mode 100644 index 26909f2889de98a479f076f87725fed805c7a343..0000000000000000000000000000000000000000 --- a/customization/TestExtensionAbility_001/Test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", -} - diff --git a/multimedia/camera/camera_js_standard/BUILD.gn b/multimedia/camera/camera_js_standard/BUILD.gn index 21272074965d41b6d1bd0f2363476e32b8215e1b..ad6f315da604dbe4ecb4c5b71616b1971d84b8d4 100644 --- a/multimedia/camera/camera_js_standard/BUILD.gn +++ b/multimedia/camera/camera_js_standard/BUILD.gn @@ -23,7 +23,7 @@ ohos_js_hap_suite("camera_standard_ets_hap") { certificate_profile = "./signature/openharmony_sx.p7b" hap_name = "ActsCameraStandardETSTest" subsystem_name = "multimedia" - part_name = "multimedia_camera_standard" + part_name = "multimedia_camera_framework" } ohos_js_assets("camera_ets_assets") { source_dir = "./src/main/ets/MainAbility" diff --git a/multimedia/image/image_js_standard/image/src/main/js/test/addImage.test.js b/multimedia/image/image_js_standard/image/src/main/js/test/addImage.test.js index 5e9d459036c062b78284aa0b3e8f291e3b3710aa..9e2b3a2adb1ca86f7ed4116cc7cd39eb63356c80 100644 --- a/multimedia/image/image_js_standard/image/src/main/js/test/addImage.test.js +++ b/multimedia/image/image_js_standard/image/src/main/js/test/addImage.test.js @@ -13,42 +13,43 @@ * limitations under the License. */ -import image from '@ohos.multimedia.image' -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' -import { testPng } from './testImg' +import image from "@ohos.multimedia.image"; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index"; +import { testPng } from "./testImg"; export default function addImage() { - describe('addImage', function () { - + describe("addImage", function () { + const RGBA_8888 = image.PixelMapFormat.RGBA_8888; beforeAll(async function () { - console.info('beforeAll case'); - }) + console.info("beforeAll case"); + }); beforeEach(function () { - console.info('beforeEach case'); - }) + console.info("beforeEach case"); + }); afterEach(async function () { - console.info('afterEach case'); - }) + console.info("afterEach case"); + }); afterAll(async function () { - console.info('afterAll case'); - }) + console.info("afterAll case"); + }); function createPixMapPromise(done, testNum, opts) { const Color = new ArrayBuffer(96); - image.createPixelMap(Color, opts) - .then(pixelmap => { + image + .createPixelMap(Color, opts) + .then((pixelmap) => { expect(pixelmap != undefined).assertTrue(); console.info(`${testNum} success`); done(); }) - .catch(error => { + .catch((error) => { console.log(`${testNum} error: ` + error); expect(false).assertTrue(); done(); - }) + }); } function createPixMapCb(done, testNum, opts) { @@ -57,7 +58,114 @@ export default function addImage() { expect(pixelmap != undefined).assertTrue(); console.info(`${testNum} success`); done(); - }) + }); + } + + async function createIncrementalSourcePromise(done, testNum, type, opts) { + let testimagebuffer = testPng; + let incSouce; + console.info(`${testNum} 0001 ` + testimagebuffer.length); + let bufferSize = 5000; + let offset = 0; + if (type == "sourceOpts") { + console.info(`${testNum} have sourceopts`); + incSouce = image.createIncrementalSource(new ArrayBuffer(1), opts); + } else { + console.info(`${testNum} no sourceopts`); + incSouce = image.createIncrementalSource(new ArrayBuffer(1)); + } + let ret; + let isFinished = false; + while (offset < testimagebuffer.length) { + var oneStep = testimagebuffer.slice(offset, offset + bufferSize); + console.info(`${testNum} 0002 ` + oneStep.length); + if (oneStep.length < bufferSize) { + isFinished = true; + } + ret = await incSouce.updateData(oneStep, isFinished, 0, oneStep.length); + if (!ret) { + console.info(`${testNum} updateData failed`); + expect(ret).assertTrue(); + break; + } + offset = offset + oneStep.length; + console.info(`${testNum} 0003 ` + offset); + } + if (ret) { + console.info(`${testNum} updateData success `); + let decodingOptions = { + sampleSize: 1, + }; + incSouce.createPixelMap(decodingOptions, (err, pixelmap) => { + if (err) { + console.info(`${testNum} createPixelMap err: ` + err); + expect(false).assertTrue(); + done(); + return; + } + console.info(`${testNum} 0004` + pixelmap); + expect(pixelmap != undefined).assertTrue(); + done(); + }); + } else { + expect(false).assertTrue(); + done(); + } + } + + async function createIncrementalSourceCb(done, testNum, type, opts) { + let testimagebuffer = testPng; + let incSouce; + console.info(`${testNum} 0001 ` + testimagebuffer.length); + let bufferSize = 5000; + let offset = 0; + if (type == "sourceOpts") { + incSouce = image.createIncrementalSource(new ArrayBuffer(1), opts); + } else { + incSouce = image.createIncrementalSource(new ArrayBuffer(1)); + } + let ret; + let isFinished = false; + while (offset < testimagebuffer.length) { + var oneStep = testimagebuffer.slice(offset, offset + bufferSize); + console.info(`${testNum} 0002 ` + oneStep.length); + if (oneStep.length < bufferSize) { + isFinished = true; + } + ret = await new Promise((res) => { + incSouce.updateData(oneStep, isFinished, 0, oneStep.length, (err, ret) => { + res(ret); + }); + }); + + if (!ret) { + console.info(`${testNum} updateData failed`); + expect(ret).assertTrue(); + break; + } + offset = offset + oneStep.length; + console.info(`${testNum} 0003 ` + offset); + } + if (ret) { + console.info(`${testNum} updateData success `); + let decodingOptions = { + sampleSize: 1, + }; + incSouce.createPixelMap(decodingOptions, (err, pixelmap) => { + if (err) { + console.info(`${testNum} createPixelMap err: ` + err); + expect(false).assertTrue(); + done(); + return; + } + console.info(`${testNum} 0004` + pixelmap); + expect(pixelmap != undefined).assertTrue(); + done(); + }); + } else { + expect(false).assertTrue(); + done(); + } } /** @@ -71,10 +179,10 @@ export default function addImage() { * @tc.type : Functional * @tc.level : Level 0 */ - it('SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0100', 0, async function (done) { - let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 1, alphaType: 0 } - createPixMapPromise(done, 'SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0100', opts); - }) + it("SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0100", 0, async function (done) { + let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 1, alphaType: 0 }; + createPixMapPromise(done, "SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0100", opts); + }); /** * @tc.number : SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0200 @@ -87,10 +195,10 @@ export default function addImage() { * @tc.type : Functional * @tc.level : Level 0 */ - it('SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0200', 0, async function (done) { - let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 1, alphaType: 1 } - createPixMapPromise(done, 'SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0200', opts); - }) + it("SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0200", 0, async function (done) { + let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 1, alphaType: 1 }; + createPixMapPromise(done, "SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0200", opts); + }); /** * @tc.number : SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0300 @@ -103,10 +211,10 @@ export default function addImage() { * @tc.type : Functional * @tc.level : Level 0 */ - it('SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0300', 0, async function (done) { - let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 0, alphaType: 2 } - createPixMapPromise(done, 'SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0300', opts); - }) + it("SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0300", 0, async function (done) { + let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 0, alphaType: 2 }; + createPixMapPromise(done, "SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0300", opts); + }); /** * @tc.number : SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0400 @@ -119,10 +227,10 @@ export default function addImage() { * @tc.type : Functional * @tc.level : Level 0 */ - it('SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0400', 0, async function (done) { - let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 0, alphaType: 3 } - createPixMapPromise(done, 'SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0400', opts); - }) + it("SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0400", 0, async function (done) { + let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 0, alphaType: 3 }; + createPixMapPromise(done, "SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0400", opts); + }); /** * @tc.number : SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0100 @@ -135,10 +243,10 @@ export default function addImage() { * @tc.type : Functional * @tc.level : Level 0 */ - it('SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0100', 0, async function (done) { - let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 0, alphaType: 0 } - createPixMapCb(done, 'SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0100', opts); - }) + it("SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0100", 0, async function (done) { + let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 0, alphaType: 0 }; + createPixMapCb(done, "SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0100", opts); + }); /** * @tc.number : SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0200 @@ -151,10 +259,10 @@ export default function addImage() { * @tc.type : Functional * @tc.level : Level 0 */ - it('SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0200', 0, async function (done) { - let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 0, alphaType: 1 } - createPixMapCb(done, 'SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0200', opts); - }) + it("SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0200", 0, async function (done) { + let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 0, alphaType: 1 }; + createPixMapCb(done, "SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0200", opts); + }); /** * @tc.number : SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0300 @@ -167,10 +275,10 @@ export default function addImage() { * @tc.type : Functional * @tc.level : Level 0 */ - it('SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0300', 0, async function (done) { - let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 1, alphaType: 2 } - createPixMapCb(done, 'SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0300', opts); - }) + it("SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0300", 0, async function (done) { + let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 1, alphaType: 2 }; + createPixMapCb(done, "SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0300", opts); + }); /** * @tc.number : SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0400 @@ -183,10 +291,10 @@ export default function addImage() { * @tc.type : Functional * @tc.level : Level 0 */ - it('SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0400', 0, async function (done) { - let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 1, alphaType: 3 } - createPixMapCb(done, 'SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0400', opts); - }) + it("SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0400", 0, async function (done) { + let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }, scaleMode: 1, alphaType: 3 }; + createPixMapCb(done, "SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_CALLBACK_0400", opts); + }); /** * @tc.number : SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 @@ -194,54 +302,17 @@ export default function addImage() { * @tc.desc : 1.create imagesource * 2.update data * 3.create pixelmap - * @tc.size : MEDIUM + * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 */ - it('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100', 0, async function (done) { - try { - let testimagebuffer = testPng; - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 0003 ' + testimagebuffer.length); - let bufferSize = 5000; - let offset = 0; - const incSouce = image.createIncrementalSource(new ArrayBuffer(1)); - let ret; - let isFinished = false; - while (offset < testimagebuffer.length) { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 0006 ' + testimagebuffer.length); - var oneStep = testimagebuffer.slice(offset, offset + bufferSize); - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 0007 ' + oneStep.length); - if (oneStep.length < bufferSize) { - isFinished = true; - } - ret = await incSouce.updateData(oneStep, isFinished, 0, oneStep.length); - if (!ret) { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 updateData failed'); - expect(ret).assertTrue(); - break; - } - offset = offset + oneStep.length; - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 0011 ' + offset); - } - if (ret) { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 updateData success '); - let decodingOptions = { - sampleSize: 1 - }; - incSouce.createPixelMap(decodingOptions, (err, pixelmap) => { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 0014' + pixelmap); - expect(pixelmap != undefined).assertTrue(); - done(); - }) - } else { - expect(false).assertTrue(); - done(); - } - } catch (error) { - expect(false).assertTrue(); - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 updateData failed ' + error); - } - }) + it("SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100", 0, async function (done) { + createIncrementalSourcePromise( + done, + "SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100", + "noSourceOpts" + ); + }); /** * @tc.number : SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 @@ -249,56 +320,56 @@ export default function addImage() { * @tc.desc : 1.create imagesource * 2.update data * 3.create pixelmap - * @tc.size : MEDIUM + * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 */ - it('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200', 0, async function (done) { - try { - let testimagebuffer = testPng; - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 0001 ' + testimagebuffer.length); - let bufferSize = 5000; - let offset = 0; - const incSouce = image.createIncrementalSource(new ArrayBuffer(1)); - let ret; - let isFinished = false; - while (offset < testimagebuffer.length) { - var oneStep = testimagebuffer.slice(offset, offset + bufferSize); - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 0002 ' + oneStep.length); - if (oneStep.length < bufferSize) { - isFinished = true; - } - ret = await new Promise(res => { - incSouce.updateData(oneStep, isFinished, 0, oneStep.length, (err, ret) => { - res(ret); - }) - }) - if (!ret) { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 updateData failed'); - expect(ret).assertTrue(); - break; - } - offset = offset + oneStep.length; - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 0003 ' + offset); - } - if (ret) { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 updateData success '); - let decodingOptions = { - sampleSize: 1 - }; - incSouce.createPixelMap(decodingOptions, (err, pixelmap) => { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 0004' + pixelmap); - expect(pixelmap != undefined).assertTrue(); - done(); - }) - } else { - expect(false).assertTrue(); - done(); - } - } catch (error) { - expect(false).assertTrue(); - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 updateData failed ' + error); - } - }) - }) -} \ No newline at end of file + it("SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200", 0, async function (done) { + let opts = { sourceDensity: 240, pixelFormat: RGBA_8888, size: { height: 4, width: 6 } }; + createIncrementalSourcePromise( + done, + "SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200", + "sourceOpts", + opts + ); + }); + + /** + * @tc.number : SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_CALLBACK_0100 + * @tc.name : createIncrementalSource-updateData-png-callback + * @tc.desc : 1.create imagesource + * 2.update data + * 3.create pixelmap + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it("SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_CALLBACK_0100", 0, async function (done) { + createIncrementalSourceCb( + done, + "SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_CALLBACK_0100", + "noSourceOpts" + ); + }); + + /** + * @tc.number : SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_CALLBACK_0200 + * @tc.name : createIncrementalSource-updateData-png-callback + * @tc.desc : 1.create imagesource + * 2.update data + * 3.create pixelmap + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it("SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_CALLBACK_0200", 0, async function (done) { + let opts = { sourceDensity: 240, pixelFormat: RGBA_8888, size: { height: 4, width: 6 } }; + createIncrementalSourceCb( + done, + "SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_CALLBACK_0200", + "sourceOpts", + opts + ); + }); + }); +} diff --git a/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js b/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js index 703bab5267d35dd069a1ec2a9da802a1b7e8d9bf..39df063192e3fd8d154a5fa5589a60339b66839c 100644 --- a/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js +++ b/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js @@ -241,14 +241,14 @@ describe('PlayerLocalTestAudioAPI', function () { } /* * - * @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_SRC_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SRC_API_0100 * @tc.name : fd is wrong * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AudioPlayer_SRC_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SRC_API_0100', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); fileDescriptor.fd = -1; let mySteps = new Array(ERROR_STATE, END_STATE); @@ -258,14 +258,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_SRC_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SRC_API_0200 * @tc.name : offset is -1 * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AudioPlayer_SRC_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SRC_API_0200', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); fileDescriptor.offset = 1; let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, END_STATE); @@ -275,14 +275,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_SRC_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SRC_API_0300 * @tc.name : length is -1 * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AudioPlayer_SRC_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SRC_API_0300', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); fileDescriptor.length = -1; let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, END_STATE); @@ -292,14 +292,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_SRC_API_0400 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SRC_API_0400 * @tc.name : fdSrc is undefined * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AudioPlayer_SRC_API_0400', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SRC_API_0400', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(ERROR_STATE, END_STATE); initAudioPlayer(); @@ -308,14 +308,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_PLAY_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PLAY_API_0100 * @tc.name : 01.pause->play * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_PLAY_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PLAY_API_0100', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); console.info(`case update`); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, END_STATE); @@ -325,14 +325,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_PLAY_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PLAY_API_0200 * @tc.name : 02.stop->play * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_PLAY_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PLAY_API_0200', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, PLAY_STATE, ERROR_STATE, END_STATE); initAudioPlayer(); @@ -341,14 +341,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_PLAY_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PLAY_API_0300 * @tc.name : 03.seek->play * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_PLAY_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PLAY_API_0300', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, SEEK_TIME, PLAY_STATE, END_STATE); initAudioPlayer(); @@ -357,14 +357,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_PLAY_API_0400 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PLAY_API_0400 * @tc.name : 04.reset->play * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_PLAY_API_0400', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PLAY_API_0400', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, RESET_STATE, PLAY_STATE, ERROR_STATE, END_STATE); initAudioPlayer(); @@ -373,14 +373,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_PAUSE_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PAUSE_API_0100 * @tc.name : 01.createAudioPlayer->play * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_PAUSE_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PAUSE_API_0100', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(PAUSE_STATE, ERROR_STATE, END_STATE); initAudioPlayer(); @@ -389,14 +389,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_PAUSE_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PAUSE_API_0200 * @tc.name : 02.play->pause * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_PAUSE_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PAUSE_API_0200', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, END_STATE); initAudioPlayer(); @@ -405,14 +405,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_PAUSE_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PAUSE_API_0300 * @tc.name : 03.stop->pause * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_PAUSE_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PAUSE_API_0300', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(PLAY_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE, END_STATE); initAudioPlayer(); @@ -421,14 +421,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_PAUSE_API_0400 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PAUSE_API_0400 * @tc.name : 04.seek->pause * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_PAUSE_API_0400', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_PAUSE_API_0400', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, PAUSE_STATE, END_STATE); initAudioPlayer(); @@ -437,14 +437,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_STOP_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_STOP_API_0100 * @tc.name : 01.play->stop * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_STOP_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_STOP_API_0100', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, END_STATE); initAudioPlayer(); @@ -453,14 +453,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_STOP_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_STOP_API_0200 * @tc.name : 02.pause->stop * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_STOP_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_STOP_API_0200', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, STOP_STATE, END_STATE); initAudioPlayer(); @@ -469,14 +469,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_STOP_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_STOP_API_0300 * @tc.name : 03.seek->stop * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_STOP_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_STOP_API_0300', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, STOP_STATE, END_STATE); initAudioPlayer(); @@ -485,14 +485,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_SEEK_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SEEK_API_0100 * @tc.name : 01.play->seek * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_SEEK_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SEEK_API_0100', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, END_STATE); initAudioPlayer(); @@ -501,14 +501,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_SEEK_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SEEK_API_0200 * @tc.name : 02.pause->seek * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_SEEK_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SEEK_API_0200', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, SEEK_TIME, END_STATE); initAudioPlayer(); @@ -517,14 +517,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_SEEK_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SEEK_API_0300 * @tc.name : 03.seek(0) * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_SEEK_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SEEK_API_0300', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, END_STATE); initAudioPlayer(); @@ -533,14 +533,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_RESET_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RESET_API_0100 * @tc.name : 01.play->reset * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_RESET_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RESET_API_0100', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, RESET_STATE, END_STATE); initAudioPlayer(); @@ -549,14 +549,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_RESET_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RESET_API_0200 * @tc.name : 02.pause->reset * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_RESET_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RESET_API_0200', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, RESET_STATE, END_STATE); initAudioPlayer(); @@ -565,14 +565,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_SETVOLUME_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SETVOLUME_API_0100 * @tc.name : 01.createAudioPlayer->setVolume * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_SETVOLUME_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SETVOLUME_API_0100', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); var mySteps = new Array(VOLUME_STATE, VOLUME_VALUE, END_STATE); initAudioPlayer(); @@ -581,14 +581,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_SETVOLUME_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SETVOLUME_API_0200 * @tc.name : 02.play->setVolume * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_SETVOLUME_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SETVOLUME_API_0200', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); var mySteps = new Array(SRC_STATE, PLAY_STATE, VOLUME_STATE, VOLUME_VALUE, END_STATE); initAudioPlayer(); @@ -597,14 +597,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_SETVOLUME_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SETVOLUME_API_0300 * @tc.name : 03.pause->setVolume * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_SETVOLUME_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SETVOLUME_API_0300', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); var mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, VOLUME_STATE, VOLUME_VALUE, END_STATE); initAudioPlayer(); @@ -613,14 +613,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_RELEASE_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RELEASE_API_0100 * @tc.name : 01.play->release * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_RELEASE_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RELEASE_API_0100', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, RELEASE_STATE, END_STATE); initAudioPlayer(); @@ -629,14 +629,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_RELEASE_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RELEASE_API_0200 * @tc.name : 02.pause->release * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_RELEASE_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RELEASE_API_0200', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, RELEASE_STATE, END_STATE); initAudioPlayer(); @@ -645,14 +645,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_RELEASE_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RELEASE_API_0300 * @tc.name : 03.stop->release * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_RELEASE_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RELEASE_API_0300', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, RELEASE_STATE, END_STATE); initAudioPlayer(); @@ -661,14 +661,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_RELEASE_API_0400 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RELEASE_API_0400 * @tc.name : 04.seek->release * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_RELEASE_API_0400', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RELEASE_API_0400', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, RELEASE_STATE, END_STATE); initAudioPlayer(); @@ -677,14 +677,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_RELEASE_API_0400 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RELEASE_API_0400 * @tc.name : 05.reset->release * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_RELEASE_API_0400', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_RELEASE_API_0400', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); let mySteps = new Array(SRC_STATE, PLAY_STATE, RESET_STATE, RELEASE_STATE, END_STATE); initAudioPlayer(); @@ -693,14 +693,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_TIME_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_TIME_API_0100 * @tc.name : 01.get parameters after createAudioPlayer * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_TIME_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_TIME_API_0100', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); initAudioPlayer(); expect(audioPlayer.src).assertEqual(''); @@ -712,14 +712,14 @@ describe('PlayerLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_PLAYER_AUDIOPLAYER_TIME_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_TIME_API_0200 * @tc.name : 02.get parameters after src * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_PLAYER_AUDIOPLAYER_TIME_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_TIME_API_0200', 0, async function (done) { mediaTestBase.isFileOpen(fileDescriptor, done); initAudioPlayer(); audioPlayer.src = fdHead + fileDescriptor.fd; diff --git a/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js b/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js index 62f6e8de6cb8ef16cc19e676adf0381ad2b0d24d..98f94a872ff24787e5301718dba57bb032e30d1c 100644 --- a/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js +++ b/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js @@ -167,14 +167,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0200 * @tc.name : 02.start->prepare * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0200', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(START_STATE, ERROR_STATE, PRE_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -182,14 +182,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0300 * @tc.name : 03.pause->prepare * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0300', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -198,14 +198,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0400 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0400 * @tc.name : 04.resume->prepare * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0400', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0400', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -214,14 +214,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0500 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0500 * @tc.name : 05.stop->prepare * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0500', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0500', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, PRE_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -229,14 +229,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0600 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0600 * @tc.name : 06.reset->prepare * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0600', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0600', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -244,14 +244,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0800 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0800 * @tc.name : 08.all steps->prepare * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0800', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0800', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PRE_STATE, ERROR_STATE, STOP_STATE, PRE_STATE, RESET_STATE, PRE_STATE, RELEASE_STATE, END_STATE); @@ -260,14 +260,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0900 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0900 * @tc.name : 09.prepare called three times * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_0900', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0900', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, PRE_STATE, ERROR_STATE, PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -275,14 +275,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_1000 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1000 * @tc.name : 10.channel:-1 * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_1000', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1000', 0, async function (done) { audioConfig.numberOfChannels = -1; audioConfig.audioSampleRate = 22050; audioConfig.audioEncodeBitRate = 22050; @@ -293,14 +293,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_1100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1100 * @tc.name : 11.channel:-1 * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_1100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1100', 0, async function (done) { audioConfig.numberOfChannels = CHANNEL_TWO; audioConfig.audioSampleRate = -1; audioConfig.audioEncodeBitRate = 22050; @@ -311,14 +311,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_1200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1200 * @tc.name : 12.channel:-1 * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_Prepare_API_1200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1200', 0, async function (done) { audioConfig.numberOfChannels = CHANNEL_TWO; audioConfig.audioSampleRate = 22050; audioConfig.audioEncodeBitRate = -1; @@ -329,14 +329,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0100 * @tc.name : 01.creatAudioRecorder->start * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0100', 0, async function (done) { audioConfig.numberOfChannels = CHANNEL_TWO; audioConfig.audioSampleRate = 22050; audioConfig.audioEncodeBitRate = 22050; @@ -347,14 +347,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0200 * @tc.name : 02.prepare->start * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0200', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -362,14 +362,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0300 * @tc.name : 03.pause->start * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0300', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, START_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -378,14 +378,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0400 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0400 * @tc.name : 04.resume->start * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0400', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0400', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, START_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -394,14 +394,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0500 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0500 * @tc.name : 05.stop->start * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0500', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0500', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, START_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -410,14 +410,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0600 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0600 * @tc.name : 06.reset->start * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0600', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0600', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, START_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -426,14 +426,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0800 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0800 * @tc.name : 08.all steps->start * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0800', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0800', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, START_STATE, ERROR_STATE, PRE_STATE, START_STATE, RESET_STATE, START_STATE, ERROR_STATE, PRE_STATE, START_STATE, @@ -443,14 +443,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0900 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0900 * @tc.name : 09.start called three times * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_START_API_0900', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0900', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, START_STATE, ERROR_STATE, START_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -459,14 +459,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0100 * @tc.name : 01.creatAudioRecorder->pause * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0100', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -474,14 +474,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0200 * @tc.name : 02.prepare->pause * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0200', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -489,14 +489,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0300 * @tc.name : 03.start->pause * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0300', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -504,14 +504,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0400 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0400 * @tc.name : 04.resume->pause * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0400', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0400', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, PAUSE_STATE, RELEASE_STATE, END_STATE); @@ -520,14 +520,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0500 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0500 * @tc.name : 05.stop->pause * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0500', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0500', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -536,14 +536,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0600 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0600 * @tc.name : 06.reset->pause * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0500', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0500', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -552,14 +552,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0800 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0800 * @tc.name : 08.all step->pause * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0800', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0800', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, PAUSE_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE, RESET_STATE, PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -568,14 +568,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0900 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0900 * @tc.name : 09.pause three times * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_PAUSE_API_0900', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0900', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, PAUSE_STATE, ERROR_STATE, PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -584,14 +584,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0100 * @tc.name : 01.creatAudioRecorder->resume * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0100', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -599,14 +599,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0200 * @tc.name : 02.prepare->resume * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0200', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -614,14 +614,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0300 * @tc.name : 03.start->resume * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0300', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -629,14 +629,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0400 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0400 * @tc.name : 04.pause->resume * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0400', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0400', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -644,14 +644,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0500 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0500 * @tc.name : 05.stop->resume * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0500', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0500', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -660,14 +660,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0600 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0600 * @tc.name : 06.reset->resume * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0600', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0600', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -676,14 +676,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0800 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0800 * @tc.name : 08.all->resume * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0800', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0800', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESUME_STATE, ERROR_STATE, PAUSE_STATE, RESUME_STATE, STOP_STATE, RESUME_STATE, ERROR_STATE, @@ -693,14 +693,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0900 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0900 * @tc.name : 09.resume threee times * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESUME_API_0900', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0900', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, RESUME_STATE, ERROR_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -709,14 +709,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0100 * @tc.name : 01.creatAudioRecorder->stop * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0100', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(STOP_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -724,14 +724,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0200 * @tc.name : 02.prepare->stop * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0200', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, STOP_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -739,14 +739,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0300 * @tc.name : 03.start->stop * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0300', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -754,14 +754,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0400 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0400 * @tc.name : 04.pause->stop * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0400', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0400', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, STOP_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -769,14 +769,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0500 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0500 * @tc.name : 05.resume->stop * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0500', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0500', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, STOP_STATE, RELEASE_STATE, END_STATE); @@ -785,14 +785,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0600 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0600 * @tc.name : 06.reset->stop * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0600', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0600', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, STOP_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -801,14 +801,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0800 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0800 * @tc.name : 08.all steps->stop * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0800', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0800', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, STOP_STATE, ERROR_STATE, RESET_STATE, PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, PRE_STATE, RESET_STATE, STOP_STATE, ERROR_STATE, PRE_STATE, RELEASE_STATE, END_STATE); @@ -817,14 +817,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0900 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0900 * @tc.name : 09.stop called three times * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_STOP_API_0900', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0900', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, STOP_STATE, ERROR_STATE, STOP_STATE, ERROR_STATE, RELEASE_STATE, END_STATE); @@ -833,14 +833,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0100 * @tc.name : 01.creatAudioRecorder->reset * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0100', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(RESET_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -848,14 +848,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0200 * @tc.name : 02.prepare->reset * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0200', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, RESET_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -863,14 +863,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0300 * @tc.name : 03.start->reset * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0300', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -878,14 +878,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0400 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0400 * @tc.name : 04.pause->reset * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0400', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0400', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESET_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -893,14 +893,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0500 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0500 * @tc.name : 05.resume->reset * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0500', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0500', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, RESET_STATE, RELEASE_STATE, END_STATE); @@ -909,14 +909,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0600 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0600 * @tc.name : 06.stop->reset * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0600', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0600', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -924,14 +924,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0800 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0800 * @tc.name : 08.all steps->reset * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0800', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0800', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, RESET_STATE, PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, PRE_STATE, START_STATE, RELEASE_STATE, END_STATE); @@ -940,14 +940,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0900 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0900 * @tc.name : 09.reset callend three times * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RESET_API_0900', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0900', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RESET_STATE, RESET_STATE, RELEASE_STATE, END_STATE); @@ -956,14 +956,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0100 * @tc.name : 01.creatAudioRecorder->release * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0100', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -972,14 +972,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0200 * @tc.name : 02.prepare->release * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0200', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0200', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -987,14 +987,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0300 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0300 * @tc.name : 03.start->release * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0300', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0300', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -1002,14 +1002,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0400 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0400 * @tc.name : 04.pause->release * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0400', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0400', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -1017,14 +1017,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0500 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0500 * @tc.name : 05.resume->release * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0500', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0500', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -1032,14 +1032,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0600 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0600 * @tc.name : 06.stop->release * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0600', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0600', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); @@ -1047,14 +1047,14 @@ describe('RecorderLocalTestAudioAPI', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0700 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0700 * @tc.name : 07.reset->release * @tc.desc : Reliability Test * @tc.size : MediumTest * @tc.type : Reliability * @tc.level : Level2 */ - it('SUB_MEDIA_RECORDER_AUDIORECORDER_RELEASE_API_0700', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0700', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RELEASE_STATE, END_STATE); setCallback(mySteps, done); diff --git a/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js b/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js index c21c2701f6f9149590c87ce5888469b640bde340..77a979315642a20adb5fafca3c858bd5a01ee8f1 100644 --- a/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js +++ b/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js @@ -336,14 +336,14 @@ describe('RecorderLocalTestAudioFUNC', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_CODEC_AAC_0350 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0800 * @tc.name : 03.AAC_DifferentSampleRate 96000 * @tc.desc : Audio recordr control test * @tc.size : MediumTest * @tc.type : Function * @tc.level : Level0 */ - it('SUB_MEDIA_RECORDER_CODEC_AAC_0350', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0800', 0, async function (done) { fdObject = await mediaTestBase.getAudioFd('audio_08.m4a'); fdPath = "fd://" + fdObject.fdNumber.toString(); audioConfig.uri = fdPath; @@ -479,14 +479,14 @@ describe('RecorderLocalTestAudioFUNC', function () { }) /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_RECORDER_FORMAT_MP4_0100 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FORMAT_MP4_0100 * @tc.name : 02.AAC,mp4 * @tc.desc : Audio recordr control test * @tc.size : MediumTest * @tc.type : Function * @tc.level : Level0 */ - it('SUB_MULTIMEDIA_MEDIA_RECORDER_FORMAT_MP4_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FORMAT_MP4_0100', 0, async function (done) { fdObject = await mediaTestBase.getFd('audio_14.mp4'); fdPath = "fd://" + fdObject.fdNumber.toString(); audioConfig.uri = fdPath; @@ -503,14 +503,14 @@ describe('RecorderLocalTestAudioFUNC', function () { }) /* * - * @tc.number : SUB_MEDIA_RECORDER_Format_M4A_Function_0200 + * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FORMAT_M4A_0100 * @tc.name : 02.AAC,mp4 * @tc.desc : Audio recordr control test * @tc.size : MediumTest * @tc.type : Function * @tc.level : Level0 */ - it('SUB_MULTIMEDIA_MEDIA_RECORDER_FORMAT_MP4_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FORMAT_M4A_0100', 0, async function (done) { fdObject = await mediaTestBase.getAudioFd('audio_15.m4a'); fdPath = "fd://" + fdObject.fdNumber.toString(); audioConfig.uri = fdPath; diff --git a/notification/ans_standard/BUILD.gn b/notification/ans_standard/BUILD.gn index 983edd21c1d2532d454c75aea5556c6079815705..5e1fd41bd6d02e52c740e1a738ad0a68967b4ca1 100644 --- a/notification/ans_standard/BUILD.gn +++ b/notification/ans_standard/BUILD.gn @@ -16,6 +16,7 @@ group("ans_standard") { testonly = true if (is_standard_system) { deps = [ + "actsNotificationDistributedTest:ActsNotificationDistributedTest", "actsNotificationSlotTest:ActsNotificationSlotTest", "actsNotificationWantAgentTest:ActsNotificationWantAgentTest", "actsnotificationshow:ActsNotificationShowTest", diff --git a/notification/ans_standard/actsNotificationDistributedTest/BUILD.gn b/notification/ans_standard/actsNotificationDistributedTest/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..52609ab77755f8c5dbb436b881adb66ab5163ab8 --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsNotificationDistributedTest") { + hap_profile = "./src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsNotificationDistributedTest" + subsystem_name = "notification" + part_name = "distributed_notification_service" +} +ohos_js_assets("hjs_demo_js_assets") { + js2abc = true + hap_profile = "./src/main/config.json" + source_dir = "./src/main/js" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/notification/ans_standard/actsNotificationDistributedTest/Test.json b/notification/ans_standard/actsNotificationDistributedTest/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..9f1c049575b4f522b1637529f3ffb3910d04e4c6 --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/Test.json @@ -0,0 +1,19 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "180000", + "shell-timeout": "180000", + "bundle-name": "com.example.actsnotificationdistributed", + "package-name": "com.example.actsnotificationdistributed" + }, + "kits": [ + { + "test-file-name": [ + "ActsNotificationDistributedTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/notification/ans_standard/actsNotificationDistributedTest/signature/openharmony_sx.p7b b/notification/ans_standard/actsNotificationDistributedTest/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..c21526ed6d8aa59d47b67380df6fec1a7d8af9dd Binary files /dev/null and b/notification/ans_standard/actsNotificationDistributedTest/signature/openharmony_sx.p7b differ diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/config.json b/notification/ans_standard/actsNotificationDistributedTest/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..48bb9950829934e606e412707bb2c00dcc5c9d67 --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/config.json @@ -0,0 +1,99 @@ +{ + "app": { + "bundleName": "com.example.actsnotificationdistributed", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 5, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsnotificationdistributed", + "name": ".entry", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "reqPermissions": [ + { + "name": "ohos.permission.NOTIFICATION_CONTROLLER" + } + ], + "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 diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/app.js b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/app.js new file mode 100644 index 0000000000000000000000000000000000000000..b58cf3c570b660c6f6f8cdcb1b317d67687deb29 --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info("============== AceApplication onCreate =============="); + }, + onDestroy() { + console.info('=============AceApplication onDestroy============='); + } +}; diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..b6c4207e3d98d227f135ee57bfa49b98cfb93faf --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/pages/index/index.css @@ -0,0 +1,24 @@ +/* + * 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; +} diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..153d713d137f27cf989ffbaee2e886f92898056e --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/pages/index/index.hml @@ -0,0 +1,21 @@ +/* + * 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. + */ + +
+ + Hello, World! + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..312c30c0c27535e4ee98fce4ca802506159ba2d1 --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/MainAbility/pages/index/index.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import file from '@system.file' + +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() { + }, +} + diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/app.js b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/app.js new file mode 100644 index 0000000000000000000000000000000000000000..d5ee271df29e516d1c8929054283e5f2bf5c981c --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/app.js @@ -0,0 +1,31 @@ +/* + * 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"); + } +}; diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..55561b83737c3c31d082fbfa11e5fc987a351104 --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": { + } +} \ No newline at end of file diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..cce1af06761a42add0cac1a0567aa3237eda8cb4 --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + }, + "Files": { + } +} \ No newline at end of file diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..b21c92c6290ea747bd891e2ab673721afc5521ed --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/pages/index/index.css @@ -0,0 +1,30 @@ +.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 diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d94b75c085fa1c16a0b2721609b18c57a7295476 --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestAbility/pages/index/index.js @@ -0,0 +1,26 @@ +/* + * 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'); + } +} + + + diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestRunner/OpenHarmonyTestRunner.js new file mode 100644 index 0000000000000000000000000000000000000000..b9e78ce7cf73f1ade6ba52a408a44e33f5430f0d --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/TestRunner/OpenHarmonyTestRunner.js @@ -0,0 +1,59 @@ +/* + * 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); + }) + } +}; diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/test/ActsNotificationDistributedTest.js b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/test/ActsNotificationDistributedTest.js new file mode 100644 index 0000000000000000000000000000000000000000..c0c258d11fa7c856cf1da0d1a5e239c9bd642a47 --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/test/ActsNotificationDistributedTest.js @@ -0,0 +1,56 @@ +/* + * 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 notification from '@ohos.notification'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' + +export default function ActsNotificationDistributedTest() { + describe('SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST', function () { + let TAG = 'SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST ===>' + console.info(TAG + 'SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST START') + + it('SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST_0100', 0, async function (done) { + console.info(`${TAG} SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST_0100 START`) + notification.isDistributedEnabled((err, data) => { + if (err.code) { + console.info(`${TAG} isDistributedEnabled AsyncCallback err: ${err.code}`) + expect(false).assertTrue() + done() + } else { + console.info(`${TAG} isDistributedEnabled AsyncCallback success: ${data}`) + expect(data).assertTrue() + done() + } + }) + console.info(`${TAG} SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST_0100 END`) + }) + + it('SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST_0200', 0, async function (done) { + console.info(`${TAG} SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST_0200 START`) + notification.isDistributedEnabled().then((data) => { + console.info(`${TAG} isDistributedEnabled Promise success: ${data}`) + expect(data).assertTrue() + done() + }).catch((err) => { + console.info(`${TAG} isDistributedEnabled Promise err: ${err.code}`) + expect(false).assertTrue() + done() + }) + console.info(`${TAG} SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST_0200 END`) + }) + + console.info(TAG + 'SUB_NOTIFICATION_IS_DISTRIBUTED_ENABLED_TEST END') + }) + +} diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/js/test/List.test.js b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..92d4ca2ecbc6bfb2293c4563abd1040452d7f61a --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/js/test/List.test.js @@ -0,0 +1,18 @@ +/* + * 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 ActsNotificationDistributedTest from './ActsNotificationDistributedTest.js' +export default function testsuite() { + ActsNotificationDistributedTest() +} diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/resources/base/element/string.json b/notification/ans_standard/actsNotificationDistributedTest/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..054c46cf82e60c39de9ec845737cdda67a89676d --- /dev/null +++ b/notification/ans_standard/actsNotificationDistributedTest/src/main/resources/base/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "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 diff --git a/notification/ans_standard/actsNotificationDistributedTest/src/main/resources/base/media/icon.png b/notification/ans_standard/actsNotificationDistributedTest/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/notification/ans_standard/actsNotificationDistributedTest/src/main/resources/base/media/icon.png differ diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/src/main/js/test/ActsSubscriber_test_ordered.js b/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/src/main/js/test/ActsSubscriber_test_ordered.js index 4a266e22439751e6461d353acad4712a04e5c825..869ec3ae15bddb82f55d156d0b808b9a8e337f6a 100644 --- a/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/src/main/js/test/ActsSubscriber_test_ordered.js +++ b/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/src/main/js/test/ActsSubscriber_test_ordered.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Subscriber from '@ohos.commonEvent' +import commonEvent from '@ohos.commonEvent' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' export default function ActsSubscriberTestOrder() { @@ -124,28 +124,28 @@ export default function ActsSubscriberTestOrder() { }) } - Subscriber.createSubscriber( + commonEvent.createSubscriber( commonEventSubscribeInfo1 ).then((data)=>{ console.info('===============ActsSubscriberTestOrder_0100==========createSubscriber promise1'); commonEventSubscriber0100 = data; data.getSubscribeInfo().then(()=>{ console.info('===============ActsSubscriberTestOrder_0100=========getSubscribeInfo promise1'); - Subscriber.subscribe(commonEventSubscriber0100, subscriberCallBack0100); + commonEvent.subscribe(commonEventSubscriber0100, subscriberCallBack0100); }); }) - Subscriber.createSubscriber( + commonEvent.createSubscriber( commonEventSubscribeInfo2 ).then((data)=>{ console.info('===============ActsSubscriberTestOrder_0100==========createSubscriber promise2'); commonEventSubscriber0101 = data; data.getSubscribeInfo().then(()=>{ console.info('===============ActsSubscriberTestOrder_0100=========getSubscribeInfo promise2'); - Subscriber.subscribe(commonEventSubscriber0101, subscriberCallBack0101); + commonEvent.subscribe(commonEventSubscriber0101, subscriberCallBack0101); setTimeout(function(){ console.debug('===================ActsSubscriberTestOrder_0100 delay 100ms=================='); - Subscriber.publish('publish_event0100', commonEventPublishData, publishCallback); + commonEvent.publish('publish_event0100', commonEventPublishData, publishCallback); }, 100); }); }) @@ -222,36 +222,36 @@ export default function ActsSubscriberTestOrder() { }) } - Subscriber.createSubscriber( + commonEvent.createSubscriber( commonEventSubscribeInfo1, ).then((data)=>{ console.info('===============ActsSubscriberTestOrder_0200==========createSubscriber promise1'); commonEventSubscriber0200 = data; data.getSubscribeInfo().then(()=>{ console.info('===============ActsSubscriberTestOrder_0200=========getSubscribeInfo promise1'); - Subscriber.subscribe(commonEventSubscriber0200, subscriberCallBack0200); + commonEvent.subscribe(commonEventSubscriber0200, subscriberCallBack0200); }); }) - Subscriber.createSubscriber( + commonEvent.createSubscriber( commonEventSubscribeInfo2, ).then((data)=>{ console.info('===============ActsSubscriberTestOrder_0200==========createSubscriber promise2'); commonEventSubscriber0201 = data; data.getSubscribeInfo().then(()=>{ console.info('===============ActsSubscriberTestOrder_0200=========getSubscribeInfo promise2'); - Subscriber.subscribe(commonEventSubscriber0201, subscriberCallBack0201); + commonEvent.subscribe(commonEventSubscriber0201, subscriberCallBack0201); setTimeout(function(){ console.debug('===================ActsSubscriberTestOrder_0200 delay 100ms=================='); - Subscriber.unsubscribe(commonEventSubscriber0200, unsubscribeCallback); + commonEvent.unsubscribe(commonEventSubscriber0200, unsubscribeCallback); }, 100); setTimeout(function(){ console.debug('===================ActsSubscriberTestOrder_0200 delay 100ms=================='); - Subscriber.publish('publish_event0200', commonEventPublishData1, publishCallback); + commonEvent.publish('publish_event0200', commonEventPublishData1, publishCallback); }, 100); setTimeout(function(){ console.debug('===================ActsSubscriberTestOrder_0200 delay 100ms=================='); - Subscriber.publish('publish_event0201', commonEventPublishData2, publishCallback); + commonEvent.publish('publish_event0201', commonEventPublishData2, publishCallback); }, 100); }); }) @@ -336,30 +336,30 @@ export default function ActsSubscriberTestOrder() { }) } - Subscriber.createSubscriber( + commonEvent.createSubscriber( commonEventSubscribeInfo1, ).then((data)=>{ console.info('===============ActsSubscriberTestOrder_0300==========createSubscriber promise1'); commonEventSubscriber0300 = data; data.getSubscribeInfo().then(()=>{ console.info('===============ActsSubscriberTestOrder_0300=========getSubscribeInfo promise1'); - Subscriber.subscribe(commonEventSubscriber0300, subscriberCallBack0300); + commonEvent.subscribe(commonEventSubscriber0300, subscriberCallBack0300); }); }) - Subscriber.createSubscriber( + commonEvent.createSubscriber( commonEventSubscribeInfo2, ).then((data)=>{ console.info('===============ActsSubscriberTestOrder_0300==========createSubscriber promise2'); commonEventSubscriber0301 = data; data.getSubscribeInfo().then(()=>{ console.info('===============ActsSubscriberTestOrder_0300=========getSubscribeInfo promise2'); - Subscriber.subscribe(commonEventSubscriber0301, subscriberCallBack0301); + commonEvent.subscribe(commonEventSubscriber0301, subscriberCallBack0301); let numindex = 0; for (; numindex < 3; ++numindex) { setTimeout(function(){ console.debug('===================ActsSubscriberTestOrder_0300 delay 100ms=================='); - Subscriber.publish('publish_event0301', commonEventPublishData2, publishCallback); + commonEvent.publish('publish_event0301', commonEventPublishData2, publishCallback); }, 100); } }); @@ -421,7 +421,7 @@ export default function ActsSubscriberTestOrder() { expect().assertFail(); } - Subscriber.createSubscriber( + commonEvent.createSubscriber( commonEventSubscribeInfo1 ).then((data)=>{ console.info('===============ActsSubscriberTestOrder_0400==========createSubscriber promise1'); @@ -429,11 +429,11 @@ export default function ActsSubscriberTestOrder() { data.getSubscribeInfo().then((data)=>{ console.info('===============ActsSubscriberTestOrder_0400=========getSubscribeInfo promise1'); expect(data.events[0]).assertEqual('publish_eventOrder0400'); - Subscriber.subscribe(commonEventSubscriber0400, subscriberCallBack0400); + commonEvent.subscribe(commonEventSubscriber0400, subscriberCallBack0400); }) }) - Subscriber.createSubscriber( + commonEvent.createSubscriber( commonEventSubscribeInfo2 ).then((data)=>{ console.info('===============ActsSubscriberTestOrder_0400==========createSubscriber promise2'); @@ -441,10 +441,10 @@ export default function ActsSubscriberTestOrder() { data.getSubscribeInfo().then((data)=>{ console.info('===============ActsSubscriberTestOrder_0400=========getSubscribeInfo promise2'); expect(data.events[0]).assertEqual('publish_eventOrder0400'); - Subscriber.subscribe(commonEventSubscriber0401, subscriberCallBack0401); + commonEvent.subscribe(commonEventSubscriber0401, subscriberCallBack0401); setTimeout(function(){ console.debug('===================ActsSubscriberTestOrder_0400 delay 100mss=================='); - Subscriber.publish('publish_eventOrder0400', commonEventPublishData, publishCallback); + commonEvent.publish('publish_eventOrder0400', commonEventPublishData, publishCallback); }, 100); }) }) @@ -509,7 +509,7 @@ export default function ActsSubscriberTestOrder() { }) } - Subscriber.createSubscriber( + commonEvent.createSubscriber( commonEventSubscribeInfo1 ).then((data)=>{ console.info('===============ActsSubscriberTestOrder_0500==========createSubscriber promise1'); @@ -517,11 +517,11 @@ export default function ActsSubscriberTestOrder() { data.getSubscribeInfo().then((data)=>{ console.info('===============ActsSubscriberTestOrder_0500==========getSubscribeInfo promise1'); expect(data.events[0]).assertEqual('publish_event0500'); - Subscriber.subscribe(commonEventSubscriber0500, subscriberCallBack0500); + commonEvent.subscribe(commonEventSubscriber0500, subscriberCallBack0500); }) }) - Subscriber.createSubscriber( + commonEvent.createSubscriber( commonEventSubscribeInfo2 ).then((data)=>{ console.info('===============ActsSubscriberTestOrder_0500==========createSubscriber promise2'); @@ -529,10 +529,10 @@ export default function ActsSubscriberTestOrder() { data.getSubscribeInfo().then((data)=>{ console.info('===============ActsSubscriberTestOrder_0500==========getSubscribeInfo promise2'); expect(data.events[0]).assertEqual('publish_event0500'); - Subscriber.subscribe(commonEventSubscriber0501, subscriberCallBack0501); + commonEvent.subscribe(commonEventSubscriber0501, subscriberCallBack0501); setTimeout(function(){ console.debug('===================ActsSubscriberTestOrder_0500 delay 100ms=================='); - Subscriber.publish('publish_event0500', commonEventPublishData, publishCallback); + commonEvent.publish('publish_event0500', commonEventPublishData, publishCallback); }, 100); }) }) diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/src/main/js/test/ActsSubscriber_test_unorder.js b/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/src/main/js/test/ActsSubscriber_test_unorder.js index 4ac2d1c7c0d40577559fc90f375b1b4921e0585c..47eb91853a42797c4dbb8a4f290c989dd87a8858 100644 --- a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/src/main/js/test/ActsSubscriber_test_unorder.js +++ b/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/src/main/js/test/ActsSubscriber_test_unorder.js @@ -159,7 +159,7 @@ export default function ActsSubscriberTestUnorderSystem() { commonEvent.Support.COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED, commonEvent.Support.COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED, commonEvent.Support.COMMON_EVENT_USER_ADDED, - // commonEvent.Support.COMMON_EVENT_USER_REMOVED, + commonEvent.Support.COMMON_EVENT_USER_REMOVED, commonEvent.Support.COMMON_EVENT_ABILITY_ADDED, commonEvent.Support.COMMON_EVENT_ABILITY_REMOVED, commonEvent.Support.COMMON_EVENT_ABILITY_UPDATED, @@ -176,7 +176,8 @@ export default function ActsSubscriberTestUnorderSystem() { commonEvent.Support.COMMON_EVENT_VOLUME_BAD_REMOVAL, commonEvent.Support.COMMON_EVENT_VOLUME_EJECT, commonEvent.Support.COMMON_EVENT_SLOT_CHANGE, - commonEvent.Support.COMMON_EVENT_SPN_INFO_CHANGED + commonEvent.Support.COMMON_EVENT_SPN_INFO_CHANGED, + commonEvent.Support.COMMON_EVENT_QUICK_FIX_APPLY_RESULT ] } let CommonEventSubscriber diff --git a/telephony/telephonyjstest/netmanager_base/register/src/main/js/test/NetworkManagerRegister.test.js b/telephony/telephonyjstest/netmanager_base/register/src/main/js/test/NetworkManagerRegister.test.js index b96c31739cb512eea4c69701f80f052475b5b368..b7bb1a8bfd7d618885c91e57c894dcc430276201 100644 --- a/telephony/telephonyjstest/netmanager_base/register/src/main/js/test/NetworkManagerRegister.test.js +++ b/telephony/telephonyjstest/netmanager_base/register/src/main/js/test/NetworkManagerRegister.test.js @@ -54,60 +54,60 @@ let returnValue = 0; netConn.on('netAvailable', (value) => { if (value === undefined) { - console.info(`${caseName} on netAvailable fail`); + console.info("${caseName} on netAvailable fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable :` + value.netId); + console.info("${caseName} netAvailable :" + value.netId); returnValue = value.netId; } }); netConn.on('netCapabilitiesChange', (value) => { if (value === undefined) { - console.info(`${caseName} netCapabilitiesChange fail`); + console.info("${caseName} netCapabilitiesChange fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle =:` + value.handle.netId); - expect(value.handle.netId).assertEqual(ETH_100); + console.info("${caseName} netCapabilitiesChange handle =:" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); } }); netConn.on('netConnectionPropertiesChange', (value) => { if (value === undefined) { - console.info(`${caseName} netConnectionPropertiesChange fail`); + console.info("${caseName} netConnectionPropertiesChange fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (value) => { if (error) { - console.info(`${caseName} netLost fail`); + console.info("${caseName} netLost fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost: ` + value.netId); + console.info("${caseName} netLost: " + value.netId); } }); netConn.register((error) => { if (error) { - console.info(JSON.stringify(error) + `${caseName} register fail: ${error}`); + console.info(JSON.stringify(error) + "${caseName} register fail: ${error}"); done(); } }); await sleep(DELAY); - console.info(`${caseName} returnVaule : ` + returnValue); + console.info("${caseName} returnVaule : " + returnValue); netConn.unregister((error) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); done(); } done(); }); done(); }); - + /** *@tc.number Telephony_NetworkManager_register_Async_0200 *@tc.name Enter bearerTypes and networkCap asempty, set class NetConnection, @@ -125,75 +125,76 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (value) => { if (value === undefined) { - console.info(`${caseName} on netAvailable fail`); + console.info("${caseName} on netAvailable fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); returnValue = value.netId; } }); netConn.on('netCapabilitiesChange', (value) => { if (value === undefined) { - console.info(`${caseName} netCapabilitiesChange fail`); + console.info("${caseName} netCapabilitiesChange fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle =:` + value.handle.netId); - expect(value.handle.netId).assertEqual(ETH_100); + console.info("${caseName} netCapabilitiesChange handle =:" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); + } }); netConn.on('netConnectionPropertiesChange', (value) => { if (value === undefined) { - console.info(`${caseName} netConnectionPropertiesChange fail`); + console.info("${caseName} netConnectionPropertiesChange fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle =:` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle =:" + value.netHandle.netId); } }); netConn.on('netLost', (value) => { if (error) { - console.info(`${caseName} netLost fail`); + console.info("${caseName} netLost fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost : ` + value.netId); + console.info("${caseName} netLost : " + value.netId); } }); netConn.on('netUnavailable', (value) => { if (error) { - console.info(`${caseName} netUnavailable fail`); + console.info("${caseName} netUnavailable fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable: ` + value.netId); + console.info("${caseName} netUnavailable: " + value.netId); } }); netConn.on('netBlockStatuschange', (value) => { if (error) { - console.info(`${caseName} netBlockStatusChange fail`); + console.info("${caseName} netBlockStatusChange fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange : ` + value.netId); + console.info("${caseName} netBlockStatusChange : " + value.netHandle.netId); } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); } }); await sleep(DELAY); netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregisterresult: ${error}` + JSON.stringify(error)); + console.info("${caseName} unregisterresult: ${error}" + JSON.stringify(error)); done(); } }); done(); }); - + /* *@tc.number Telephony_NetworkManager_register_Async_0300 *@tc.name Enter bearerTypes and networkCap as empty, set class NetConnection, @@ -214,75 +215,75 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable:` + value.netId); + console.info("${caseName} netAvailable:" + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost = :` + value.netId); + console.info("${caseName} netLost = :" + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable = :` + value); + console.info("${caseName} netUnavailable = :" + value); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); } }); await sleep(DELAY); - console.info(`${caseName} netId : ${netId}`); + console.info("${caseName} netId : ${netId}"); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result: ${error}`); + console.info("${caseName} unregister result: ${error}"); } }); done(); }); - + /* *@tc.number Telephony_NetworkManager_register_Async_0400 *@tc.name Enter bearerTypes and networkCap as empty, set class NetConnection, @@ -303,74 +304,74 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable:` + value.netId); + console.info("${caseName} netAvailable:" + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost = :` + value.netId); + console.info("${caseName} netLost = :" + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable = :` + value); + console.info("${caseName} netUnavailable = :" + value); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result: ${error.code},${error.message}`); + console.info("${caseName} unregister result: ${error.code},${error.message}"); } }); done(); }); - + /* *@tc.number Telephony_NetworkManager_register_Async_0500 *@tc.name Enter bearerTypes and networkCap as empty, set class NetConnection, @@ -391,75 +392,75 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable:` + value.netId); + console.info("${caseName} netAvailable:" + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost = :` + value.netId); + console.info("${caseName} netLost = :" + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable = :` + value); + console.info("${caseName} netUnavailable = :" + value); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result: ${error}`); + console.info("${caseName} unregister result: ${error}"); } done(); }); done(); }); - + /* *@tc.number Telephony_NetworkManager_register_Async_0600 *@tc.name Enter bearerTypes and networkCap as empty, set class NetConnection, @@ -480,75 +481,75 @@ let netId = 0; netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable:` + value.netId); + console.info("${caseName} netAvailable:" + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost = :` + value.netId); + console.info("${caseName} netLost = :" + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable = :` + value); + console.info("${caseName} netUnavailable = :" + value); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result: ${error}`); + console.info("${caseName} unregister result: ${error}"); } done(); }); done(); }); - + /* *@tc.number Telephony_NetworkManager_register_Async_0700 *@tc.name Enter bearerTypes and networkCap as empty, set class NetConnection, @@ -569,75 +570,75 @@ let netId = 0; netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable:` + value.netId); + console.info("${caseName} netAvailable:" + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost = :` + value.netId); + console.info("${caseName} netLost = :" + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable = :` + value); + console.info("${caseName} netUnavailable = :" + value); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result: ${error}`); + console.info("${caseName} unregister result: ${error}"); } done(); }); done(); }); - + /* *@tc.number Telephony_NetworkManager_register_Async_0800 *@tc.name Enter bearerTypes and networkCap as empty, set class NetConnection, @@ -658,75 +659,75 @@ let netId = 0; netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable:` + value.netId); + console.info("${caseName} netAvailable:" + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost = :` + value.netId); + console.info("${caseName} netLost = :" + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable = :` + value); + console.info("${caseName} netUnavailable = :" + value); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result: ${error}`); + console.info("${caseName} unregister result: ${error}"); } done(); }); done(); }); - + /* *@tc.number Telephony_NetworkManager_register_Async_0900 *@tc.name Enter bearerTypes and networkCap as empty, set class NetConnection, @@ -747,78 +748,78 @@ let netId = 0; netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable:` + value.netId); + console.info("${caseName} netAvailable:" + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); - expect(value.netId).assertEqual(ETH_100); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); - expect(value.netId).assertEqual(ETH_100); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); - expect(value.netId).assertEqual(ETH_100); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost = :` + value.netId); + console.info("${caseName} netLost = :" + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable = :` + value); + console.info("${caseName} netUnavailable = :" + value); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); } }); await sleep(10000); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result: ${error}`); + console.info("${caseName} unregister result: ${error}"); } done(); }); done(); }); - + /* *@tc.number Telephony_NetworkManager_register_Async_1000 *@tc.name Enter bearerTypes and networkCap as empty, set class NetConnection, @@ -839,85 +840,85 @@ let netId = 0; netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable:` + value.netId); - expect(value.netId).assertEqual(ETH_100); + console.info("${caseName} netAvailable:" + value.netId); + expect(value.netId >= ETH_100).assertTrue(); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); - expect(value.netId).assertEqual(ETH_100); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); - expect(value.netId).assertEqual(ETH_100); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost = :` + value.netId); + console.info("${caseName} netLost = :" + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable = :` + value); + console.info("${caseName} netUnavailable = :" + value); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result: ${error}`); + console.info("${caseName} unregister result: ${error}"); } done(); }); done(); }); - + /** * @tc.number Telephony_NetworkManager_register_Async_1100 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, * call Register () to activate the default network ,and see if the callback information is generated * @tc.desc Function test */ - + it('Telephony_NetworkManager_register_Async_1100', 0, async function (done) { let caseName = 'Telephony_NetworkManager_register_Async_1100'; let netSpecifier = { @@ -932,83 +933,83 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); - expect(value.netId).assertEqual(ETH_100); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value.netId); + console.info("${caseName} netUnavailable " + value.netId); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); done(); }); - + /** * @tc.number Telephony_NetworkManager_register_Async_1200 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, * call Register () to activate the default network ,and see if the callback information is generated * @tc.desc Function test */ - + it('Telephony_NetworkManager_register_Async_1200', 0, async function (done) { let caseName = 'Telephony_NetworkManager_register_Async_1200'; let netSpecifier = { @@ -1023,85 +1024,85 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); - expect(value.netId).assertEqual(ETH_100); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); - expect(value.netId).assertEqual(ETH_100); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value.netId); + console.info("${caseName} netUnavailable " + value.netId); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); done(); }); - - + + /** * @tc.number Telephony_NetworkManager_register_Async_1300 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, * call Register () to activate the default network ,and see if the callback information is generated * @tc.desc Function test */ - + it('Telephony_NetworkManager_register_Async_1300', 0, async function (done) { let caseName = 'Telephony_NetworkManager_register_Async_1300'; let netSpecifier = { @@ -1115,85 +1116,85 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); expect(value.netId).assertEqual(ETH_100); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); - expect(value.handle.netId).assertEqual(ETH_100); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); - expect(value.handle.netId).assertEqual(ETH_100); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); - expect(value.handle.netId).assertEqual(ETH_100); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); + expect(value.netHandle.netId >= ETH_100).assertTrue(); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value); + console.info("${caseName} netUnavailable " + value); } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); done(); }); - - + + /** * @tc.number Telephony_NetworkManager_register_Async_1400 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, * call Register () to activate the default network ,and see if the callback information is generated * @tc.desc Function test */ - + it('Telephony_NetworkManager_register_Async_1400', 0, async function (done) { let caseName = 'Telephony_NetworkManager_register_Async_1400'; let netSpecifier = { @@ -1208,82 +1209,82 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value.netId); + console.info("${caseName} netUnavailable " + value.netId); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); done(); }); - + /** * @tc.number Telephony_NetworkManager_register_Async_1500 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, * call Register () to activate the default network ,and see if the callback information is generated * @tc.desc Function test */ - + it('Telephony_NetworkManager_register_Async_1500', 0, async function (done) { let caseName = 'Telephony_NetworkManager_register_Async_1500'; let netSpecifier = { @@ -1297,83 +1298,83 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); VALUE = value.netId; expect(VALUE).assertEqual(ETH_100); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value); + console.info("${caseName} netUnavailable " + value); } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); done(); }); - - + + /** * @tc.number Telephony_NetworkManager_register_Async_1600 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, * call Register () to activate the default network ,and see if the callback information is generated * @tc.desc Function test */ - + it('Telephony_NetworkManager_register_Async_1600', 0, async function (done) { let caseName = 'Telephony_NetworkManager_register_Async_1600'; let netSpecifier = { @@ -1388,82 +1389,82 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value); + console.info("${caseName} netUnavailable " + value); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); done(); }); - + /** * @tc.number Telephony_NetworkManager_register_Async_1700 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, * call Register () to activate the default network ,and see if the callback information is generated * @tc.desc Function test */ - + it('Telephony_NetworkManager_register_Async_1700', 0, async function (done) { let caseName = 'Telephony_NetworkManager_register_Async_1700'; let netSpecifier = { @@ -1478,82 +1479,82 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value); + console.info("${caseName} netUnavailable " + value); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); done(); }); - + /** * @tc.number Telephony_NetworkManager_register_Async_1800 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, * call Register () to activate the default network ,and see if the callback information is generated * @tc.desc Function test */ - + it('Telephony_NetworkManager_register_Async_1800', 0, async function (done) { let caseName = 'Telephony_NetworkManager_register_Async_1800'; let netSpecifier = { @@ -1568,69 +1569,69 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value); + console.info("${caseName} netUnavailable " + value); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); @@ -1638,82 +1639,82 @@ let netConn1 = connection.createNetConnection(netSpecifier, TIMEOUT); netConn1.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn1.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn1.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn1.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn1.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value); + console.info("${caseName} netUnavailable " + value); netId = true; } }); netConn1.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn1.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); done(); }); - + /** * @tc.number Telephony_NetworkManager_register_Async_1900 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, * call Register () to activate the default network ,and see if the callback information is generated * @tc.desc Function test */ - + it('Telephony_NetworkManager_register_Async_1900', 0, async function (done) { let caseName = 'Telephony_NetworkManager_register_Async_1900'; let netSpecifier = { @@ -1727,75 +1728,75 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value); + console.info("${caseName} netUnavailable " + value); } }); netConn.register((error) => { if (error) { - + done(); } done(); }); done(); }); - + /** * @tc.number Telephony_NetworkManager_register_Async_2000 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, * call Register () to activate the default network ,and see if the callback information is generated * @tc.desc Function test */ - + it('Telephony_NetworkManager_register_Async_2000', 0, async function (done) { let caseName = 'Telephony_NetworkManager_register_Async_2000'; let netSpecifier = { @@ -1833,18 +1834,18 @@ }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } }); done(); }); - + /** * @tc.number Telephony_NetworkManager_register_Async_2100 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, @@ -1865,69 +1866,69 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value); + console.info("${caseName} netUnavailable " + value); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); @@ -1942,75 +1943,75 @@ let netConn1 = connection.createNetConnection(netSpecifier1, TIMEOUT); netConn1.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); } }); netConn1.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn1.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn1.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn1.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn1.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value); + console.info("${caseName} netUnavailable " + value); netId = true; } }); netConn1.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn1.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); done(); }); - + /** * @tc.number Telephony_NetworkManager_register_Async_2200 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, @@ -2031,69 +2032,69 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value.netId); + console.info("${caseName} netUnavailable " + value.netId); netId = true; } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); @@ -2108,75 +2109,75 @@ let netConn1 = connection.createNetConnection(netSpecifier1, TIMEOUT); netConn1.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); } }); netConn1.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); } }); netConn1.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); } }); netConn1.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); } }); netConn1.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn1.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value.netId); + console.info("${caseName} netUnavailable " + value.netId); netId = true; } }); netConn1.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); expect(true).assertTrue() netConn1.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); } done(); }); done(); }); - + /** * @tc.number Telephony_NetworkManager_register_Async_2300 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, @@ -2189,59 +2190,59 @@ let returnValue = 0; netConn.on('netAvailable', (value) => { if (value === undefined) { - console.info(`${caseName} on netAvailable fail`); + console.info("${caseName} on netAvailable fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable` + value.netId); + console.info("${caseName} netAvailable" + value.netId); returnValue = value.netId; } }); netConn.on('netCapabilitiesChange', (value) => { if (value === undefined) { - console.info(`${caseName} on netCapabilitiesChange fail`); + console.info("${caseName} on netCapabilitiesChange fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle ` + value.netHandle.netId); + console.info("${caseName} netCapabilitiesChange handle " + value.netHandle.netId); expect(value.netHandle.netId >= ETH_100 ).assertTrue(); } }); netConn.on('netConnectionPropertiesChange', (value) => { if (value === undefined) { - console.info(`${caseName} on netConnectionPropertiesChange fail`); + console.info("${caseName} on netConnectionPropertiesChange fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange hdndle` + value.netHandle.netId); + console.info("${caseName} netConnectionPropertiesChange hdndle" + value.netHandle.netId); } }); netConn.on('netLost', (value) => { if (error) { - console.info(`${caseName} netLost fail`); + console.info("${caseName} netLost fail"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); await sleep(DELAY); - console.info(`${caseName} returnValue ` + returnValue); + console.info("${caseName} returnValue " + returnValue); netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); done(); } done(); }); done(); }); - + /** * @tc.number Telephony_NetworkManager_unregister_Async_0100 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, @@ -2261,82 +2262,82 @@ let netConn = connection.createNetConnection(netSpecifier, TIMEOUT_1); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); done(); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); done(); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); done(); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); done(); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); done(); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value.netId); + console.info("${caseName} netUnavailable " + value.netId); done(); } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); expect().assertFail(); done(); } - + done(); }); done(); }); - - + + /** * @tc.number Telephony_NetworkManager_unregister_Async_0200 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, @@ -2348,81 +2349,81 @@ let netConn = connection.createNetConnection(); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); done(); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); done(); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); done(); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); done(); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); done(); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value.netId); + console.info("${caseName} netUnavailable " + value.netId); done(); } }); netConn.register((error) => { if (error) { - console.info(`${caseName} register fail ${error}`); + console.info("${caseName} register fail ${error}"); } }); netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); expect().assertFail(); done(); } - + done(); }); done(); }); - + /** * @tc.number Telephony_NetworkManager_unregister_Async_0300 * @tc.name Enter bearerTypes add networkCap as empty ,set class NetConnection, @@ -2434,67 +2435,67 @@ let netConn = connection.createNetConnection(); netConn.on('netAvailable', (error, value) => { if (error) { - console.info(`${caseName} register fail: ${error}`); + console.info("${caseName} register fail: ${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netAvailable : ` + value.netId); + console.info("${caseName} netAvailable : " + value.netId); done(); } }); netConn.on('netBlockStatusChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netBlockStatusChange handle = :` + value.handle.netId); + console.info("${caseName} netBlockStatusChange handle = :" + value.netHandle.netId); done(); } }); netConn.on('netCapabilitiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netCapabilitiesChange handle = :` + value.handle.netId); + console.info("${caseName} netCapabilitiesChange handle = :" + value.netHandle.netId); done(); } }); netConn.on('netConnectionPropertiesChange', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netConnectionPropertiesChange handle = :` + value.handle.netId); + console.info("${caseName} netConnectionPropertiesChange handle = :" + value.netHandle.netId); done(); } }); netConn.on('netLost', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netLost ` + value.netId); + console.info("${caseName} netLost " + value.netId); done(); } }); netConn.on('netUnavailable', (error, value) => { if (error) { - console.info(`${caseName} register fail :${error}`); + console.info("${caseName} register fail :${error}"); expect().assertFail(); done(); } else { - console.info(`${caseName} netUnavailable ` + value.netId); + console.info("${caseName} netUnavailable " + value.netId); done(); } }); netConn.unregister((error) => { if (error) { - console.info(`${caseName} unregister result : ${error}`); + console.info("${caseName} unregister result : ${error}"); expect().assertFail(); done(); } diff --git a/telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js b/telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js index 6d8a34bf3ffa9654cca910fe4447e79d87da6815..5a3ac37cee2747e406aee7f54c96712a89b13e63 100644 --- a/telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js +++ b/telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js @@ -287,7 +287,7 @@ describe('SimManagerTest', function () { const CASE_NAME = 'Telephony_Sim_isSimActive_Async_0700'; sim.isSimActive(env.SLOTID2, (err, data) => { console.info("isSimActive async err info :" + JSON.stringify(err) + "data:" + JSON.stringify(data)); - expect(err.code).assertEqual("202"); + expect(err.code).assertEqual(202); done(); }); }); @@ -307,7 +307,7 @@ describe('SimManagerTest', function () { done(); }).catch(err => { console.info("isSimActive promise err info :" + JSON.stringify(err)); - expect(err.code).assertEqual("202"); + expect(err.code).assertEqual(202); done(); }); }); @@ -322,7 +322,7 @@ describe('SimManagerTest', function () { const CASE_NAME = 'Telephony_Sim_hasSimCard_Async_0600'; sim.hasSimCard(env.SLOTID2, (err, data) => { if (err) { - expect(err.code).assertEqual("202"); + expect(err.code).assertEqual(202); console.info(`${CASE_NAME} fail, err: ${err.message}`); done(); return; @@ -342,7 +342,7 @@ describe('SimManagerTest', function () { try { let data = await sim.hasSimCard(env.SLOTID2); } catch (err) { - expect(err.code).assertEqual("202"); + expect(err.code).assertEqual(202); console.info(`${CASE_NAME} fail, err: ${err.message}`); done(); return; @@ -374,7 +374,7 @@ describe('SimManagerTest', function () { sim.getCardType(env.SLOTID2, (err, cardType) => { if (err) { console.info(`${CASE_NAME} GetCardType error: ${err.message}`); - expect(err.code).assertEqual("202"); + expect(err.code).assertEqual(202); done(); return; } @@ -395,7 +395,7 @@ describe('SimManagerTest', function () { console.info(`${CASE_NAME} test finish.`); } catch (err) { console.info(`${CASE_NAME} GetCardType error: ${err.message}`); - expect(err.code).assertEqual("202"); + expect(err.code).assertEqual(202); } done(); }); @@ -411,7 +411,7 @@ describe('SimManagerTest', function () { sim.hasOperatorPrivileges(env.SLOTID2, (error, result) => { if (error) { console.info(`${CASE_NAME} hasOperatorPrivileges error: ${error.message}`); - expect().assertFail(); + expect(error.code).assertEqual(202); done(); return; } @@ -435,10 +435,81 @@ describe('SimManagerTest', function () { console.info(`${CASE_NAME} test finish.`); } catch (error) { console.info(`${CASE_NAME} hasOperatorPrivileges error: ${error.message}`); - expect().assertFail(); + expect(error.code).assertEqual(202); } done(); }); + /** + * @tc.number Telephony_Sim_getOpKey_CallBack_0100 + * @tc.name Test getOpKey interface + * @tc.desc Obtains the opkey of the SIM card in a specified slot.Returns the opkey; + * returns "-1" if no SIM card is inserted or no opkey matched. + */ + it('Telephony_Sim_getOpKey_CallBack_0100', 0, async function (done) { + sim.getOpKey(0, (err, data) => { + console.info("Telephony_Sim_getOpKey_CallBack_0100 err = " + JSON.stringify(err) + " data = " + JSON.stringify(data)); + if(err){ + expect(err.code).assertEqual(-1); + done(); + return; + } + done(); + }); + }); + + /** + * @tc.number Telephony_Sim_getOpKey_Promise_0100 + * @tc.name Test getOpKey interface + * @tc.desc Obtains the opkey of the SIM card in a specified slot.Returns the opkey; + * returns "-1" if no SIM card is inserted or no opkey matched. + */ + it('Telephony_Sim_getOpKey_Promise_0100', 0, async function (done) { + let promise = sim.getOpKey(0); + promise.then(data => { + console.info("Telephony_Sim_getOpKey_Promise_0100 data = " + JSON.stringify(data)); + done(); + }).catch(err => { + console.info("Telephony_Sim_getOpKey_Promise_0100 err = " + JSON.stringify(err)); + expect(err.code).assertEqual(-1); + done(); + }); + }); + + /** + * @tc.number Telephony_Sim_getOpName_CallBack_0100 + * @tc.name Test getOpName interface + * @tc.desc Obtains the opname of the SIM card in a specified slot. + * returns null if no SIM card is inserted or no opname matched. + */ + it('Telephony_Sim_getOpName_CallBack_0100', 0, async function (done) { + sim.getOpName(0, (err, data) => { + console.info("Telephony_Sim_getOpName_CallBack_0100 err = " + JSON.stringify(err) + " data = " + JSON.stringify(data)); + if(err){ + expect(err.code).assertEqual(-1); + done(); + return; + } + done(); + }); + }); + + /** + * @tc.number Telephony_Sim_getOpName_Promise_0100 + * @tc.name Test getOpName interface + * @tc.desc Obtains the opname of the SIM card in a specified slot. + * returns null if no SIM card is inserted or no opname matched. + */ + it('Telephony_Sim_getOpName_Promise_0100', 0, async function (done) { + let promise = sim.getOpName(0); + promise.then(data => { + console.info("Telephony_Sim_getOpName_Promise_0100 data = " + JSON.stringify(data)); + done(); + }).catch(err => { + console.info("Telephony_Sim_getOpName_Promise_0100 err = " + JSON.stringify(err)); + expect(err.code).assertEqual(-1); + done(); + }); + }); }) }