提交 cfda99f1 编写于 作者: Z z00445003

Merge branch 'master' of gitee.com:openharmony/xts_acts into my_xts_acts

Change-Id: I9e437677d14756cbbc39feba9fc13c7986a3a820
......@@ -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": {
......
......@@ -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 = {
......
......@@ -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")
......
/**
* 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%")
}
}
/**
* 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%")
}
}
/**
* 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%")
}
}
/**
* 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%")
}
}
/**
* 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%")
}
}
/**
* 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%")
}
}
/**
* 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%")
}
}
/**
* 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%")
}
}
/**
* 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%")
}
}
/**
* 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%")
}
}
......@@ -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
......@@ -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 = {
......
......@@ -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) => {
......
/**
* 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();
});
})
}
/**
* 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();
});
})
}
/**
* 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();
});
})
}
/**
* 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();
});
})
}
/**
* 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();
});
})
}
/**
* 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();
});
})
}
/**
* 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();
});
})
}
/**
* 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();
});
})
}
/**
* 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();
});
})
}
/**
* 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();
});
})
}
/**
* 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
......@@ -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
......@@ -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",
]
}
}
# 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",
]
}
}
# 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",
]
}
{
"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
/*
* 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 <iostream>
#include <vector>
#include <cstring>
#include <dirent.h>
#include "gettestfiles.cpp"
#include "runtest.h"
namespace OHOS {
using namespace std;
static vector<std::string> filenames;
std::vector<std::string> runtest::GetFileNames(std::string path)
{
vector<string> 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
/*
* 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 <iostream>
#include <vector>
#include <cstring>
#include <dirent.h>
#include "runtest.h"
static void GetTestNames(std::string path, std::vector<std::string>& 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
/*
* 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 <iostream>
#include <string>
#include <vector>
namespace OHOS {
class runtest {
public:
static int t_setrlim(int r, long lim);
static std::vector<std::string> GetFileNames(std::string path);
};
} // namespace OHOS
#endif // TOOLCHAIN_LIBC_TEST_INCLUDE_RUNTEST_H_
/*
* 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 <cstring>
#include <cerrno>
#include <cstdio>
#include <sys/resource.h>
#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
/*
* 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 <iostream>
#include <cstdlib>
#include <cstring>
#include <cerrno>
#include <ctime>
#include <cstdio>
#include <vector>
#include <csignal>
#include <unistd.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "gtest/gtest.h"
#include "runtest.h"
using namespace std;
using namespace testing::ext;
using namespace testing;
namespace OHOS {
class toolchaintest : public ::testing::TestWithParam<string> {};
static string filepath = "/data/local/tmp/libc-test/src";
static vector<std::string> 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
#!/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
......@@ -13,7 +13,7 @@
{
"test-file-name": [
"ActsRpcHapTest.hap",
"./testcases/ActsRpcHapServer.hap"
"ActsRpcHapServer.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
......@@ -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 = [
......
{
"description": "Configuration for hjunit demo Tests",
}
......@@ -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"
......
......@@ -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;
......
......@@ -16,6 +16,7 @@ group("ans_standard") {
testonly = true
if (is_standard_system) {
deps = [
"actsNotificationDistributedTest:ActsNotificationDistributedTest",
"actsNotificationSlotTest:ActsNotificationSlotTest",
"actsNotificationWantAgentTest:ActsNotificationWantAgentTest",
"actsnotificationshow:ActsNotificationShowTest",
......
# 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"
}
{
"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
{
"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
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info("============== AceApplication onCreate ==============");
},
onDestroy() {
console.info('=============AceApplication onDestroy=============');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册