提交 d31663d5 编写于 作者: B bayanxing

code check

Signed-off-by: Nbayanxing <bayanxing@kaihong.com>
上级 32769de9
......@@ -14,7 +14,7 @@
*/
import Log from '../common/Log.ets';
import events_emitter from '@ohos.events.emitter';
const TAG = 'ets_apiLack_add';
@Entry
......@@ -118,7 +118,26 @@ export default struct CommonColorMode {
.textOverflow({ overflow: TextOverflow.None })
.key("areaText")
.onClick((event) => {
Log.showInfo(TAG, 'area: ' + JSON.stringify(event.target.area))
Log.showInfo(TAG, 'JSON.stringify area : ' + JSON.stringify(event.target.area))
const area = JSON.stringify(event.target.area)
console.info("area value is: " + area)
console.info("area.position value is: " + area.position)
console.info("area.position value is: " + area.position.x)
try {
var backData = {
data: {
"STATUS": area
}
}
let backEvent = {
eventId: 60312,
priority: events_emitter.EventPriority.LOW
}
console.info("areaValue start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("areaValue emit action state err: " + JSON.stringify(err.message))
}
})
Text("common-Repeat")
.width(320)
......@@ -263,6 +282,23 @@ export default struct CommonColorMode {
.key("touchesText")
.onTouch((event) => {
Log.showInfo(TAG, 'touches: ' + JSON.stringify(event.touches))
const touches = JSON.stringify(event.touches)
const touchesValue = JSON.parse(touches)
try {
var backData1 = {
data: {
"STATUS": touchesValue
}
}
let backEvent1 = {
eventId: 60313,
priority: events_emitter.EventPriority.LOW
}
console.info("touchesValue start to emit action state")
events_emitter.emit(backEvent1, backData1)
} catch (err) {
console.info("touchesValue emit action state err: " + JSON.stringify(err.message))
}
})
Text("common-ChangedTouches")
......@@ -280,6 +316,23 @@ export default struct CommonColorMode {
.key("changedTouchesText")
.onTouch((event) => {
Log.showInfo(TAG, 'changedTouches: ' + JSON.stringify(event.changedTouches))
const changedTouches = JSON.stringify(event.changedTouches)
const changedTouchesValue = JSON.parse(changedTouches)
try {
var backData2 = {
data: {
"STATUS": changedTouches
}
}
let backEvent2 = {
eventId: 60314,
priority: events_emitter.EventPriority.LOW
}
console.info("touchesValue start to emit action state")
events_emitter.emit(backEvent2, backData2)
} catch (err) {
console.info("touchesValue emit action state err: " + JSON.stringify(err.message))
}
})
Text("common-KeyCode")
......
......@@ -23,6 +23,7 @@ import canvasActualBoundingBoxAscentJsunit from './canvas.test.ets';
import checkBoxGroupJsunit from './checkBox.test.ets';
import checkBoxGroupPartJsunit from './checkBoxGroup.test.ets';
import commonColorModeJsunit from './common.test.ets';
import configurationApiTest from './configuration.test.ets'
import datePickerLunarJsunit from './datePicker.test.ets';
import enumsCancelJsunit from './enums.test.ets';
import gestureParallelJsunit from './gesture.test.ets';
......@@ -45,9 +46,7 @@ import copyOptionJsunit from './copyOption.test.ets';
export default function testsuite() {
animatorOnframeJsunit()
curvesEaseOutJsunit()
routerStandardJsunit()
uiAppearanceALWAYS_DARKJsunit()
appVersionCodeJsunit()
alertDialogCenterStartJsunit()
canvasActualBoundingBoxAscentJsunit()
......@@ -55,13 +54,11 @@ export default function testsuite() {
checkBoxGroupPartJsunit()
commonColorModeJsunit()
datePickerLunarJsunit()
enumsCancelJsunit()
gestureParallelJsunit()
listtestIdleJsunit()
loadingProgressCircularJsunit()
progressScaleCountJsunit()
radioGroupJsunit()
refreshDragJsunit()
sidebarIconsJsunit()
sliderMovingJsunit()
stateManagementDARKJsunit()
......
// @ts-nocheck
/**
* 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 configuration from '@system.configuration';
import router from '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'
export default function configurationApiTest() {
describe('configurationApiTest', function () {
beforeEach(async function (done) {
await Utils.sleep(1000);
console.info("appVersionCode after each called");
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("appVersionCode after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name colorMode001
* @tc.desic aceColorMode001EtsTest0001
*/
it('colorMode001', 0, async function (done) {
console.info('colorMode001 test START');
const localeInfo = configuration.getLocale();
console.info("[configuration.getLocale] localeInfo: " + JSON.stringify(localeInfo));
console.info("[configuration.getLocale] colorMode: " + localeInfo.colorMode);
console.info("[configuration.getLocale] fontScale: " + localeInfo.fontScale);
expect(localeInfo.colorMode).assertEqual('COLOR_MODE_LIGHT');
expect(localeInfo.fontScale).assertEqual('ltr');
console.info('testConfigurationGetLocale END');
});
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册