Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f39fc766
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f39fc766
编写于
6月 25, 2023
作者:
S
sunjiakun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UXII8.2 xts
Signed-off-by:
N
sunjiakun
<
sunjiakun3@huawei.com
>
上级
41bf9425
变更
22
展开全部
隐藏空白更改
内联
并排
Showing
22 changed file
with
4940 addition
and
0 deletion
+4940
-0
arkui/ace_ets_components_ux/BUILD.gn
arkui/ace_ets_components_ux/BUILD.gn
+1
-0
arkui/ace_ets_components_ux/ace_ets_component_search/.idea/.gitignore
...s_components_ux/ace_ets_component_search/.idea/.gitignore
+3
-0
arkui/ace_ets_components_ux/ace_ets_component_search/.idea/ace_ets_component_search.iml
...e_ets_component_search/.idea/ace_ets_component_search.iml
+9
-0
arkui/ace_ets_components_ux/ace_ets_component_search/.idea/misc.xml
...ets_components_ux/ace_ets_component_search/.idea/misc.xml
+6
-0
arkui/ace_ets_components_ux/ace_ets_component_search/.idea/modules.xml
..._components_ux/ace_ets_component_search/.idea/modules.xml
+8
-0
arkui/ace_ets_components_ux/ace_ets_component_search/AppScope/app.json
..._components_ux/ace_ets_component_search/AppScope/app.json
+19
-0
arkui/ace_ets_components_ux/ace_ets_component_search/AppScope/resources/base/element/string.json
...ponent_search/AppScope/resources/base/element/string.json
+8
-0
arkui/ace_ets_components_ux/ace_ets_component_search/AppScope/resources/base/media/app_icon.png
...mponent_search/AppScope/resources/base/media/app_icon.png
+0
-0
arkui/ace_ets_components_ux/ace_ets_component_search/BUILD.gn
...i/ace_ets_components_ux/ace_ets_component_search/BUILD.gn
+43
-0
arkui/ace_ets_components_ux/ace_ets_component_search/Test.json
.../ace_ets_components_ux/ace_ets_component_search/Test.json
+26
-0
arkui/ace_ets_components_ux/ace_ets_component_search/signature/openharmony_sx.p7b
..._ux/ace_ets_component_search/signature/openharmony_sx.p7b
+0
-0
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/ets/TestAbility/TestAbility.ets
...component_search/src/main/ets/TestAbility/TestAbility.ets
+64
-0
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/ets/TestAbility/pages/Index.ets
...component_search/src/main/ets/TestAbility/pages/Index.ets
+285
-0
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...t_search/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+84
-0
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/ets/test/List.test.ets
.../ace_ets_component_search/src/main/ets/test/List.test.ets
+19
-0
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/ets/test/Search.ets
..._ux/ace_ets_component_search/src/main/ets/test/Search.ets
+4274
-0
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/ets/test/Utils.ets
...s_ux/ace_ets_component_search/src/main/ets/test/Utils.ets
+25
-0
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/module.json
...mponents_ux/ace_ets_component_search/src/main/module.json
+37
-0
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/resources/base/element/color.json
...mponent_search/src/main/resources/base/element/color.json
+8
-0
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/resources/base/element/string.json
...ponent_search/src/main/resources/base/element/string.json
+16
-0
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/resources/base/media/icon.png
...s_component_search/src/main/resources/base/media/icon.png
+0
-0
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/resources/base/profile/test_pages.json
...nt_search/src/main/resources/base/profile/test_pages.json
+5
-0
未找到文件。
arkui/ace_ets_components_ux/BUILD.gn
浏览文件 @
f39fc766
...
...
@@ -23,6 +23,7 @@ group("componentUxTest") {
"ace_ets_component_datepicker:ActsAceDatePickerTest",
"ace_ets_component_progress:ActsAceProgressTest",
"ace_ets_component_radio:ActsAceRadioTest",
"ace_ets_component_search:ActsAceSearchTest",
"ace_ets_component_select:ActsAceSelectTest",
"ace_ets_component_sidebar:ActsAceSideBarTest",
"ace_ets_component_slider:ActsAceSliderTest",
...
...
arkui/ace_ets_components_ux/ace_ets_component_search/.idea/.gitignore
0 → 100644
浏览文件 @
f39fc766
# Default ignored files
/shelf/
/workspace.xml
arkui/ace_ets_components_ux/ace_ets_component_search/.idea/ace_ets_component_search.iml
0 → 100644
浏览文件 @
f39fc766
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
inherit-compiler-output=
"true"
>
<exclude-output
/>
<content
url=
"file://$MODULE_DIR$"
/>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</module>
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_search/.idea/misc.xml
0 → 100644
浏览文件 @
f39fc766
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
>
<output
url=
"file://$PROJECT_DIR$/out"
/>
</component>
</project>
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_search/.idea/modules.xml
0 → 100644
浏览文件 @
f39fc766
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/.idea/ace_ets_component_search.iml"
filepath=
"$PROJECT_DIR$/.idea/ace_ets_component_search.iml"
/>
</modules>
</component>
</project>
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_search/AppScope/app.json
0 → 100644
浏览文件 @
f39fc766
{
"app"
:
{
"bundleName"
:
"com.example.acesearchtest"
,
"vendor"
:
"example"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
10
,
"targetAPIVersion"
:
10
,
"car"
:
{
"apiCompatibleVersion"
:
10
,
"singleUser"
:
false
}
}
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_search/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
f39fc766
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"MyApplication"
}
]
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_search/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
f39fc766
6.6 KB
arkui/ace_ets_components_ux/ace_ets_component_search/BUILD.gn
0 → 100644
浏览文件 @
f39fc766
# 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("ActsAceSearchTest") {
hap_profile = "src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_ets_component_search_js_assets",
":ace_ets_component_search_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceSearchTest"
part_name = "ace_engine"
subsystem_name = "arkui"
}
ohos_app_scope("ace_ets_component_search_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_ets_component_search_js_assets") {
source_dir = "src/main/ets"
}
ohos_resources("ace_ets_component_search_resources") {
sources = [ "src/main/resources" ]
deps = [ ":ace_ets_component_search_profile" ]
hap_profile = "src/main/module.json"
}
arkui/ace_ets_components_ux/ace_ets_component_search/Test.json
0 → 100644
浏览文件 @
f39fc766
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"bundle-name"
:
"com.example.acesearchtest"
,
"module-name"
:
"entry_test"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
"kits"
:
[{
"test-file-name"
:
[
"ActsAceSearchTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"power-shell setmode 602"
]
}
]
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_search/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
f39fc766
文件已添加
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/ets/TestAbility/TestAbility.ets
0 → 100644
浏览文件 @
f39fc766
/*
* Copyright (c) 2023 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 hilog from '@ohos.hilog';
import Ability from '@ohos.app.ability.UIAbility'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import testsuite from '../test/List.test'
import Window from '@ohos.window'
export default class TestAbility extends Ability {
onCreate(want, launchParam) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? '');
}
onDestroy() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}
onWindowStageCreate(windowStage: Window.WindowStage) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
windowStage.loadContent('TestAbility/pages/Index', (err, data) => {
if (err.code) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR);
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}
onForeground() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}
onBackground() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/ets/TestAbility/pages/Index.ets
0 → 100644
浏览文件 @
f39fc766
/*
* Copyright (c) 2023 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 events_emitter from '@ohos.events.emitter';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import { Hypium } from '@ohos/hypium';
import hilog from '@ohos.hilog';
import testsuite from '../../test/List.test'
@Entry
@Component
struct SliderExample {
@State caretWidthNumber: number = 5
@State caretWidthString: string = '15px'
@State caretWidthResource: Resource = $r('sys.float.ohos_id_text_margin_vertical')
@State caretColorColor: Color = Color.Red
@State caretColorNumber: number = 0x000000
@State caretColorString: string = '#ff9a35'
@State caretColorResource: Resource = $r('sys.color.ohos_id_color_connected')
@State leftSearchIconSizeNumber: number = 20
@State leftSearchIconSizeString: string = '50px'
@State leftSearchIconSizeResource: Resource = $r('sys.float.ohos_id_text_paragraph_margin_m')
@State leftSearchIconColorColor: Color = Color.Red
@State leftSearchIconColorNumber: number = 0x000000
@State leftSearchIconColorString: string = '#ff9a35'
@State leftSearchIconColorResource: Resource = $r('sys.color.ohos_id_color_connected')
@State searchSrcPath: string = 'common/icon.png'
@State searchSrcPathResource: Resource = $r('sys.media.ohos_app_icon')
@State rightButtonStyleParam: CancelButtonStyle = CancelButtonStyle.INPUT
@State rightCancelIconSizeNumber: number = 20
@State rightCancelIconSizeString: string = '50px'
@State rightCancelIconSizeResource: Resource = $r('sys.float.ohos_id_text_paragraph_margin_m')
@State rightCancelIconColorColor: Color = Color.Red
@State rightCancelIconColorNumber: number = 0x000000
@State rightCancelIconColorString: string = '#ff9a35'
@State rightCancelIconColorResource: Resource = $r('sys.color.ohos_id_color_connected')
@State rightIconSrcPath: string = 'common/icon.png'
@State rightIconSrcPathResource: Resource = $r('sys.media.ohos_app_icon')
@State searchButtonFontSizeNumber: number = 20
@State searchButtonFontSizeString: string = '10vp'
@State searchButtonFontSizeResource: Resource = $r('sys.float.ohos_id_text_paragraph_margin_m')
@State searchButtonFontColorColor: Color = Color.Blue
@State searchButtonFontColorNumber: number = 0x000000
@State searchButtonFontColorString: string = '#ff9a35'
@State searchButtonFontColorResource: Resource = $r('sys.color.ohos_id_color_connected')
@State textColorColor: Color = Color.Red
@State textColorNumber: number = 0x000000
@State textColorString: string = '#ff9a35'
@State textColorResource: Resource = $r('sys.color.ohos_id_color_connected')
@State placeholderFont: Font = { size: '16sp', weight: FontWeight.Normal }
@State textFont: Font = { size: '16sp', weight: FontWeight.Normal }
private stateChangCallBack = (eventData) => {
console.info("search page state change called:" + JSON.stringify(eventData));
this.caretWidthNumber = eventData.data.caretWidthNumber;
this.caretWidthString = eventData.data.caretWidthString;
this.caretWidthResource = eventData.data.caretWidthResource;
this.caretColorColor = eventData.data.caretColorColor;
this.caretColorNumber = eventData.data.caretColorNumber;
this.caretColorString = eventData.data.caretColorString;
this.caretColorResource = eventData.data.caretColorResource;
this.leftSearchIconSizeNumber = eventData.data.leftSearchIconSizeNumber;
this.leftSearchIconSizeString = eventData.data.leftSearchIconSizeString;
this.leftSearchIconSizeResource = eventData.data.leftSearchIconSizeResource;
this.leftSearchIconColorColor = eventData.data.leftSearchIconColorColor;
this.leftSearchIconColorNumber = eventData.data.leftSearchIconColorNumber;
this.leftSearchIconColorString = eventData.data.leftSearchIconColorString;
this.leftSearchIconColorResource = eventData.data.leftSearchIconColorResource;
this.searchSrcPath = eventData.data.searchSrcPath;
this.searchSrcPathResource = eventData.data.searchSrcPathResource;
this.rightButtonStyleParam = eventData.data.rightButtonStyleParam;
this.rightCancelIconSizeNumber = eventData.data.rightCancelIconSizeNumber;
this.rightCancelIconSizeString = eventData.data.rightCancelIconSizeString;
this.rightCancelIconSizeResource = eventData.data.rightCancelIconSizeResource;
this.rightCancelIconColorColor = eventData.data.rightCancelIconColorColor;
this.rightCancelIconColorNumber = eventData.data.rightCancelIconColorNumber;
this.rightCancelIconColorString = eventData.data.rightCancelIconColorString;
this.rightCancelIconColorResource = eventData.data.rightCancelIconColorResource;
this.rightIconSrcPath = eventData.data.rightIconSrcPath;
this.rightIconSrcPathResource = eventData.data.rightIconSrcPathResource;
this.searchButtonFontSizeNumber = eventData.data.searchButtonFontSizeNumber;
this.searchButtonFontSizeString = eventData.data.searchButtonFontSizeString;
this.searchButtonFontSizeResource = eventData.data.searchButtonFontSizeResource;
this.searchButtonFontColorColor = eventData.data.searchButtonFontColorColor;
this.searchButtonFontColorNumber = eventData.data.searchButtonFontColorNumber;
this.searchButtonFontColorString = eventData.data.searchButtonFontColorString;
this.searchButtonFontColorResource = eventData.data.searchButtonFontColorResource;
this.textColorColor = eventData.data.textColorColor;
this.textColorNumber = eventData.data.textColorNumber;
this.textColorString = eventData.data.textColorString;
this.textColorResource = eventData.data.textColorResource;
}
aboutToAppear(){
var stateChangeEvent = {
eventId: 183,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(stateChangeEvent, this.stateChangCallBack);
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
Column() {
Search({ value: '', placeholder: 'Type to search...' })
.searchButton('Search')
.key('searchTestDefault')
Search({ value: '', placeholder: 'Type to search...' })
.caretStyle({
color: $r('sys.color.ohos_id_color_text_primary_activated')
})
.searchIcon({
color: $r('sys.color.ohos_id_color_secondary'),
})
.cancelButton({
icon: {
color: $r('sys.color.ohos_id_color_secondary'),
}
})
.searchButton(
'Search',
{
fontSize: $r('sys.float.ohos_id_text_size_body1'),
fontColor: $r('sys.color.ohos_id_color_text_primary_activated')
}
)
.key('searchTestDefaultValue')
Search({ value: '', placeholder: 'Type to search...' })
.width(300)
.height(40)
.margin(5)
.caretStyle({
width: this.caretWidthNumber,
color: this.caretColorNumber
})
.searchIcon({
size: this.leftSearchIconSizeNumber,
color: this.leftSearchIconColorNumber,
src: this.searchSrcPath
})
.cancelButton({
style: this.rightButtonStyleParam,
icon: {
size: this.rightCancelIconSizeNumber,
color: this.rightCancelIconColorNumber,
src: this.rightIconSrcPath
}
})
.searchButton(
'Search',
{
fontSize: this.searchButtonFontSizeNumber,
fontColor: this.searchButtonFontColorNumber
}
)
.placeholderFont(this.placeholderFont)
.textFont(this.textFont)
.fontColor(this.textColorNumber)
.key('searchTestNumber')
Search({ value: '', placeholder: 'Type to search...' })
.width(300)
.height(40)
.margin(5)
.caretStyle({
width: this.caretWidthString,
color: this.caretColorString
})
.searchIcon({
size: this.leftSearchIconSizeString,
color: this.leftSearchIconColorString,
src: this.searchSrcPath
})
.cancelButton({
style: this.rightButtonStyleParam,
icon: {
size: this.rightCancelIconSizeString,
color: this.rightCancelIconColorString,
src: this.rightIconSrcPath
}
})
.searchButton(
'Search',
{
fontSize: this.searchButtonFontSizeString,
fontColor: this.searchButtonFontColorString
}
)
.placeholderFont(this.placeholderFont)
.textFont(this.textFont)
.fontColor(this.textColorString)
.key('searchTestString')
Search({ value: '', placeholder: 'Type to search...' })
.width(300)
.height(40)
.margin(5)
.caretStyle({
width: this.caretWidthResource,
color: this.caretColorResource
})
.searchIcon({
size: this.leftSearchIconSizeResource,
color: this.leftSearchIconColorResource,
src: this.searchSrcPathResource
})
.cancelButton({
style: this.rightButtonStyleParam,
icon: {
size: this.rightCancelIconSizeResource,
color: this.rightCancelIconColorResource,
src: this.rightIconSrcPathResource
}
})
.searchButton(
'Search',
{
fontSize: this.searchButtonFontSizeResource,
fontColor: this.searchButtonFontColorResource
}
)
.placeholderFont(this.placeholderFont)
.textFont(this.textFont)
.fontColor(this.textColorResource)
.key('searchTestResource')
Search({ value: '', placeholder: 'Type to search...' })
.width(300)
.height(40)
.margin(5)
.caretStyle({
width: this.caretWidthNumber,
color: this.caretColorColor
})
.searchIcon({
size: this.leftSearchIconSizeNumber,
color: this.leftSearchIconColorColor,
src: this.searchSrcPath
})
.cancelButton({
style: this.rightButtonStyleParam,
icon: {
size: this.rightCancelIconSizeNumber,
color: this.rightCancelIconColorColor,
src: this.rightIconSrcPath
}
})
.searchButton(
'Search',
{
fontSize: this.searchButtonFontSizeNumber,
fontColor: this.searchButtonFontColorColor
}
)
.placeholderFont(this.placeholderFont)
.textFont(this.textFont)
.fontColor(this.textColorColor)
.key('searchTestColor')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
f39fc766
/*
* Copyright (c) 2023 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
hilog
from
'
@ohos.hilog
'
;
import
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
]);
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
;
}
}
return
targetParams
.
trim
();
}
async
function
onAbilityCreateCallback
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
onAbilityCreateCallback
'
);
}
async
function
addAbilityMonitorCallback
(
err
):
Promise
<
void
>
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
addAbilityMonitorCallback : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner OnPrepare
'
);
}
async
onRun
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun run
'
);
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
();
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
let
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.TestAbility
'
;
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
);
let
cmd
=
'
aa start -d 0 -a TestAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
;
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
);
let
debug
=
abilityDelegatorArguments
.
parameters
[
'
-D
'
];
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
;
}
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
cmd : %{public}s
'
,
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
d
)
=>
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : err : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
stdResult
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
exitCode
??
''
);
});
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun end
'
);
}
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
f39fc766
/*
* Copyright (c) 2023 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 search from './Search'
export default function testsuite() {
search()
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/ets/test/Search.ets
0 → 100644
浏览文件 @
f39fc766
此差异已折叠。
点击以展开。
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/ets/test/Utils.ets
0 → 100644
浏览文件 @
f39fc766
/*
* Copyright (c) 2023 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 class Utils {
static sleep(time){
return new Promise((resolve,reject)=>{
setTimeout(()=>{
resolve("ok")
},time)
}).then(()=>{
console.info(`sleep ${time} over...`)
})
}
}
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/module.json
0 → 100644
浏览文件 @
f39fc766
{
"module"
:
{
"name"
:
"entry_test"
,
"type"
:
"feature"
,
"description"
:
"$string:module_test_desc"
,
"mainElement"
:
"TestAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:test_pages"
,
"abilities"
:
[
{
"name"
:
"TestAbility"
,
"srcEntrance"
:
"./ets/TestAbility/TestAbility.ets"
,
"description"
:
"$string:TestAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:TestAbility_label"
,
"visible"
:
true
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:start_window_background"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}
]
}
]
}
}
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
f39fc766
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
f39fc766
{
"string"
:
[
{
"name"
:
"module_test_desc"
,
"value"
:
"test ability description"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"the test ability"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"test label"
}
]
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
f39fc766
6.6 KB
arkui/ace_ets_components_ux/ace_ets_component_search/src/main/resources/base/profile/test_pages.json
0 → 100644
浏览文件 @
f39fc766
{
"src"
:
[
"TestAbility/pages/Index"
]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录