Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
caa6846a
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看板
未验证
提交
caa6846a
编写于
8月 26, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5202 JS api覆盖合入master
Merge pull request !5202 from Nicklaus/master
上级
6ffefdd8
f5e29813
变更
72
隐藏空白更改
内联
并排
Showing
72 changed file
with
2995 addition
and
0 deletion
+2995
-0
arkui/BUILD.gn
arkui/BUILD.gn
+1
-0
arkui/ace_js_attribute_api/BUILD.gn
arkui/ace_js_attribute_api/BUILD.gn
+35
-0
arkui/ace_js_attribute_api/Test.json
arkui/ace_js_attribute_api/Test.json
+19
-0
arkui/ace_js_attribute_api/signature/openharmony_sx.p7b
arkui/ace_js_attribute_api/signature/openharmony_sx.p7b
+0
-0
arkui/ace_js_attribute_api/src/main/config.json
arkui/ace_js_attribute_api/src/main/config.json
+109
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/app.js
arkui/ace_js_attribute_api/src/main/js/MainAbility/app.js
+32
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/common/images/icon.png
...ribute_api/src/main/js/MainAbility/common/images/icon.png
+0
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/common/images/video.mp4
...ibute_api/src/main/js/MainAbility/common/images/video.mp4
+3
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/i18n/en-US.json
..._js_attribute_api/src/main/js/MainAbility/i18n/en-US.json
+6
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/i18n/zh-CN.json
..._js_attribute_api/src/main/js/MainAbility/i18n/zh-CN.json
+6
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/animate/router/index.css
...pi/src/main/js/MainAbility/pages/animate/router/index.css
+43
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/animate/router/index.hml
...pi/src/main/js/MainAbility/pages/animate/router/index.hml
+20
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/animate/router/index.js
...api/src/main/js/MainAbility/pages/animate/router/index.js
+113
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/camera/router/index.css
...api/src/main/js/MainAbility/pages/camera/router/index.css
+57
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/camera/router/index.hml
...api/src/main/js/MainAbility/pages/camera/router/index.hml
+29
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/camera/router/index.js
..._api/src/main/js/MainAbility/pages/camera/router/index.js
+47
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/canvas/router/index.css
...api/src/main/js/MainAbility/pages/canvas/router/index.css
+45
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/canvas/router/index.hml
...api/src/main/js/MainAbility/pages/canvas/router/index.hml
+26
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/canvas/router/index.js
..._api/src/main/js/MainAbility/pages/canvas/router/index.js
+51
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/div/router/index.css
...te_api/src/main/js/MainAbility/pages/div/router/index.css
+44
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/div/router/index.hml
...te_api/src/main/js/MainAbility/pages/div/router/index.hml
+58
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/div/router/index.js
...ute_api/src/main/js/MainAbility/pages/div/router/index.js
+155
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/index/index.css
...tribute_api/src/main/js/MainAbility/pages/index/index.css
+27
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/index/index.hml
...tribute_api/src/main/js/MainAbility/pages/index/index.hml
+20
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/index/index.js
...ttribute_api/src/main/js/MainAbility/pages/index/index.js
+34
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.css
..._api/src/main/js/MainAbility/pages/input/router/index.css
+52
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.hml
..._api/src/main/js/MainAbility/pages/input/router/index.hml
+38
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.js
...e_api/src/main/js/MainAbility/pages/input/router/index.js
+60
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/list/router/index.css
...e_api/src/main/js/MainAbility/pages/list/router/index.css
+40
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/list/router/index.hml
...e_api/src/main/js/MainAbility/pages/list/router/index.hml
+23
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/list/router/index.js
...te_api/src/main/js/MainAbility/pages/list/router/index.js
+31
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/routerPush/index.css
...te_api/src/main/js/MainAbility/pages/routerPush/index.css
+27
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/routerPush/index.hml
...te_api/src/main/js/MainAbility/pages/routerPush/index.hml
+20
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/routerPush/index.js
...ute_api/src/main/js/MainAbility/pages/routerPush/index.js
+26
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/routerReplace/index.css
...api/src/main/js/MainAbility/pages/routerReplace/index.css
+27
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/routerReplace/index.hml
...api/src/main/js/MainAbility/pages/routerReplace/index.hml
+20
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/routerReplace/index.js
..._api/src/main/js/MainAbility/pages/routerReplace/index.js
+26
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/text/router/index.css
...e_api/src/main/js/MainAbility/pages/text/router/index.css
+21
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/text/router/index.hml
...e_api/src/main/js/MainAbility/pages/text/router/index.hml
+29
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/text/router/index.js
...te_api/src/main/js/MainAbility/pages/text/router/index.js
+24
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/video/router/index.css
..._api/src/main/js/MainAbility/pages/video/router/index.css
+16
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/video/router/index.hml
..._api/src/main/js/MainAbility/pages/video/router/index.hml
+22
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/video/router/index.js
...e_api/src/main/js/MainAbility/pages/video/router/index.js
+51
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/child/child.css
...i/src/main/js/MainAbility/pages/viewModel/child/child.css
+35
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/child/child.hml
...i/src/main/js/MainAbility/pages/viewModel/child/child.hml
+18
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/child/child.js
...pi/src/main/js/MainAbility/pages/viewModel/child/child.js
+29
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/parent/parent.css
...src/main/js/MainAbility/pages/viewModel/parent/parent.css
+35
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/parent/parent.hml
...src/main/js/MainAbility/pages/viewModel/parent/parent.hml
+20
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/parent/parent.js
.../src/main/js/MainAbility/pages/viewModel/parent/parent.js
+27
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/root/root.css
...api/src/main/js/MainAbility/pages/viewModel/root/root.css
+21
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/root/root.hml
...api/src/main/js/MainAbility/pages/viewModel/root/root.hml
+21
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/root/root.js
..._api/src/main/js/MainAbility/pages/viewModel/root/root.js
+19
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel1/comp/comp.css
...pi/src/main/js/MainAbility/pages/viewModel1/comp/comp.css
+35
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel1/comp/comp.hml
...pi/src/main/js/MainAbility/pages/viewModel1/comp/comp.hml
+19
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel1/comp/comp.js
...api/src/main/js/MainAbility/pages/viewModel1/comp/comp.js
+31
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel1/index/index.css
.../src/main/js/MainAbility/pages/viewModel1/index/index.css
+21
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel1/index/index.hml
.../src/main/js/MainAbility/pages/viewModel1/index/index.hml
+19
-0
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel1/index/index.js
...i/src/main/js/MainAbility/pages/viewModel1/index/index.js
+23
-0
arkui/ace_js_attribute_api/src/main/js/TestAbility/app.js
arkui/ace_js_attribute_api/src/main/js/TestAbility/app.js
+22
-0
arkui/ace_js_attribute_api/src/main/js/TestAbility/i18n/en-US.json
..._js_attribute_api/src/main/js/TestAbility/i18n/en-US.json
+8
-0
arkui/ace_js_attribute_api/src/main/js/TestAbility/i18n/zh-CN.json
..._js_attribute_api/src/main/js/TestAbility/i18n/zh-CN.json
+8
-0
arkui/ace_js_attribute_api/src/main/js/TestAbility/pages/index/index.css
...tribute_api/src/main/js/TestAbility/pages/index/index.css
+30
-0
arkui/ace_js_attribute_api/src/main/js/TestAbility/pages/index/index.hml
...tribute_api/src/main/js/TestAbility/pages/index/index.hml
+5
-0
arkui/ace_js_attribute_api/src/main/js/TestAbility/pages/index/index.js
...ttribute_api/src/main/js/TestAbility/pages/index/index.js
+26
-0
arkui/ace_js_attribute_api/src/main/js/TestRunner/OpenHarmonyTestRunner.js
...ibute_api/src/main/js/TestRunner/OpenHarmonyTestRunner.js
+59
-0
arkui/ace_js_attribute_api/src/main/js/test/List.test.js
arkui/ace_js_attribute_api/src/main/js/test/List.test.js
+23
-0
arkui/ace_js_attribute_api/src/main/js/test/basicabilityapi.test.js
...js_attribute_api/src/main/js/test/basicabilityapi.test.js
+358
-0
arkui/ace_js_attribute_api/src/main/js/test/commonComponentJsApi.test.js
...tribute_api/src/main/js/test/commonComponentJsApi.test.js
+249
-0
arkui/ace_js_attribute_api/src/main/js/test/mediaquery.test.js
.../ace_js_attribute_api/src/main/js/test/mediaquery.test.js
+273
-0
arkui/ace_js_attribute_api/src/main/resources/base/element/string.json
...attribute_api/src/main/resources/base/element/string.json
+28
-0
arkui/ace_js_attribute_api/src/main/resources/base/media/icon.png
...e_js_attribute_api/src/main/resources/base/media/icon.png
+0
-0
arkui/ace_js_attribute_api/src/main/resources/base/media/icon_small.png
...ttribute_api/src/main/resources/base/media/icon_small.png
+0
-0
未找到文件。
arkui/BUILD.gn
浏览文件 @
caa6846a
...
...
@@ -25,6 +25,7 @@ group("arkui") {
"ace_ets_third_test:ActsAceEtsThirdTest",
"ace_ets_web_dev:ActsAceWebDevTest",
"ace_ets_xcomponent:ActsAceXComponentEtsTest",
"ace_js_attribute_api:ActsAceJsApiTest",
"ace_napi_test:ActsAceNapiEtsTest",
"ace_standard:ActsAceStandardTest",
"ace_standard_video:ActsAceStandardVideoTest",
...
...
arkui/ace_js_attribute_api/BUILD.gn
0 → 100644
浏览文件 @
caa6846a
# 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("ActsAceJsApiTest") {
hap_profile = "./src/main/config.json"
deps = [
":ace_js_assets",
":ace_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAceJsApiTest"
subsystem_name = "arkui"
part_name = "ace_engine"
}
ohos_js_assets("ace_js_assets") {
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("ace_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
arkui/ace_js_attribute_api/Test.json
0 → 100644
浏览文件 @
caa6846a
{
"description"
:
"Configuration for ActsAceJsApiTest Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"1000000"
,
"shell-timeout"
:
"1000000"
,
"bundle-name"
:
"com.example.acejsapi"
,
"package-name"
:
"com.example.acejsapi"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAceJsApiTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
\ No newline at end of file
arkui/ace_js_attribute_api/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
caa6846a
文件已添加
arkui/ace_js_attribute_api/src/main/config.json
0 → 100644
浏览文件 @
caa6846a
{
"app"
:
{
"bundleName"
:
"com.example.acejsapi"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
8
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.acejsapi"
,
"name"
:
".entry"
,
"mainAbility"
:
".MainAbility"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"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"
,
"pages/routerPush/index"
,
"pages/routerReplace/index"
,
"pages/video/router/index"
,
"pages/animate/router/index"
,
"pages/camera/router/index"
,
"pages/canvas/router/index"
,
"pages/div/router/index"
,
"pages/input/router/index"
,
"pages/text/router/index"
,
"pages/viewModel/child/child"
,
"pages/viewModel/parent/parent"
,
"pages/viewModel/root/root"
,
"pages/viewModel1/index/index"
,
"pages/viewModel1/comp/comp"
,
"pages/list/router/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
}
},
{
"pages"
:
[
"pages/index/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
],
"testRunner"
:
{
"name"
:
"OpenHarmonyTestRunner"
,
"srcPath"
:
"TestRunner"
},
"srcPath"
:
""
}
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/app.js
0 → 100644
浏览文件 @
caa6846a
/*
* 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
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
export
default
{
onCreate
()
{
console
.
info
(
'
TestApplication onCreate
'
)
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
},
onDestroy
()
{
console
.
info
(
"
TestApplication onDestroy
"
);
}
};
arkui/ace_js_attribute_api/src/main/js/MainAbility/common/images/icon.png
0 → 100644
浏览文件 @
caa6846a
6.6 KB
arkui/ace_js_attribute_api/src/main/js/MainAbility/common/images/video.mp4
0 → 100644
LFS
浏览文件 @
caa6846a
文件已添加
arkui/ace_js_attribute_api/src/main/js/MainAbility/i18n/en-US.json
0 → 100644
浏览文件 @
caa6846a
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
caa6846a
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/animate/router/index.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.container
{
display
:
flex
;
flex-direction
:
column
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
40px
;
text-align
:
center
;
width
:
100%
;
height
:
40px
;
margin
:
10px
;
}
@media
screen
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/animate/router/index.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div class="container" id="div1">
<text id="function1" class="title" ontouchstart="functionTest1">
AnimationResult测试
</text>
</div>
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/animate/router/index.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
var
options
=
{
duration
:
1500
,
easing
:
'
friction
'
,
delay
:
100
,
fill
:
'
forwards
'
,
iterations
:
2
,
direction
:
'
normal
'
,
};
var
frames
=
[
{
transform
:
{
translate
:
'
-120px
'
,
rotate
:
'
10deg
'
,
scale
:
0.2
,
skew
:
'
40deg
'
},
opacity
:
0.1
,
offset
:
0.0
,
width
:
'
40%
'
,
height
:
'
20px
'
,
backgroundColor
:
'
#ff0000
'
,
backgroundPosition
:
'
10px 20px
'
,
transformOrigin
:
'
left top
'
},
{
transform
:
{
translateX
:
'
0px
'
,
translateY
:
'
5px
'
,
rotateX
:
'
10deg
'
,
rotateY
:
'
10deg
'
,
scaleX
:
0.5
,
scaleY
:
0.7
,
skewX
:
'
22deg
'
,
skewY
:
'
30deg
'
},
opacity
:
0.6
,
offset
:
2.0
,
width
:
'
60%
'
,
height
:
'
30px
'
,
backgroundColor
:
'
#ff00ff
'
,
backgroundPosition
:
'
15px 25px
'
,
transformOrigin
:
'
center top
'
},
{
transform
:
{
translateX
:
'
100px
'
,
translateY
:
'
0px
'
,
translateZ
:
'
20px
'
,
rotateX
:
'
0deg
'
,
rotateY
:
'
0deg
'
,
rotateZ
:
'
30deg
'
,
scaleX
:
1
,
scaleY
:
1
,
scaleZ
:
2
,
skewX
:
'
0
'
,
skewY
:
'
0
'
,
skewZ
:
'
30deg
'
},
opacity
:
1
,
offset
:
0.0
,
width
:
'
100%
'
,
height
:
'
30px
'
,
backgroundColor
:
'
#ffff00
'
,
backgroundPosition
:
'
0px
'
,
transformOrigin
:
'
center center
'
},
];
export
default
{
data
:
{
title
:
""
},
onInit
()
{
},
functionTest1
()
{
var
function1
=
this
.
$element
(
'
function1
'
);
var
animationResult
=
function1
.
animate
(
frames
,
options
);
animationResult
.
play
()
animationResult
.
onfinish
=
function
()
{
console
.
info
(
'
The animation is finish
'
)
console
.
info
(
'
The animationResult pending is
'
+
animationResult
.
pending
)
console
.
info
(
'
The animationResult pending is
'
+
animationResult
.
startTime
)
console
.
info
(
'
The animationResult playstate is
'
+
animationResult
.
playstate
)
console
.
info
(
'
The animationResult finished is
'
+
animationResult
.
finished
)
};
animationResult
.
onstart
=
function
()
{
console
.
info
(
'
The animation is start
'
)
console
.
info
(
'
The animationResult pending is
'
+
animationResult
.
pending
)
console
.
info
(
'
The animationResult pending is
'
+
animationResult
.
startTime
)
console
.
info
(
'
The animationResult playstate is
'
+
animationResult
.
playstate
)
console
.
info
(
'
The animationResult finished is
'
+
animationResult
.
finished
)
}
}
}
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/camera/router/index.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.container
{
display
:
flex
;
flex-direction
:
column
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
height
:
100%
;
}
camera
{
width
:
300px
;
height
:
300px
;
}
.testDiv
{
display
:
flex
;
flex-direction
:
column
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
}
.title
{
font-size
:
40px
;
text-align
:
center
;
width
:
100%
;
height
:
60px
;
margin
:
10px
;
padding
:
10px
;
}
@media
screen
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/camera/router/index.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div class="container">
<text id="function1" class="title" on:click="functionTest1">
Camera takePhoto high
</text>
<text id="function2" class="title" on:click="functionTest2">
Camera takePhoto normal
</text>
<text id="function3" class="title" on:click="functionTest3">
Camera takePhoto low
</text>
<camera id="camera1" flash="on" deviceposition="back" @error="cameraError">
</camera>
</div>
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/camera/router/index.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
title
:
""
},
onInit
()
{
},
functionTest1
()
{
var
camera
=
this
.
$element
(
'
camera1
'
);
camera
.
takePhoto
({
quality
:
'
high
'
})
},
functionTest2
()
{
var
camera
=
this
.
$element
(
'
camera1
'
);
camera
.
takePhoto
({
quality
:
'
normal
'
})
},
functionTest3
()
{
var
camera
=
this
.
$element
(
'
camera1
'
);
camera
.
takePhoto
({
quality
:
'
low
'
})
},
cameraError
()
{
console
.
info
(
'
授权失败!
'
)
}
}
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/canvas/router/index.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.container
{
flex-direction
:
column
;
background-color
:
#F1F3F5
;
align-items
:
center
;
width
:
100%
;
}
canvas
{
margin-top
:
300px
;
width
:
600px
;
height
:
500px
;
background-color
:
#fdfdfd
;
border
:
5px
solid
red
;
}
.content
{
width
:
80%
;
margin-top
:
50px
;
margin-bottom
:
50px
;
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
space-around
;
}
text
{
width
:
200px
;
height
:
80px
;
color
:
white
;
border-radius
:
20px
;
text-align
:
center
;
background-color
:
#6060e7
;
margin-bottom
:
30px
;
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/canvas/router/index.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div class="container">
<div class="content">
<canvas ref="canvas"></canvas>
</div>
<div class="content">
<text onclick="save">save</text>
<text onclick="clear">clear</text>
<text onclick="restore">restore</text>
<text onclick="getLineDash">getLineDash</text>
</div>
</div>
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/canvas/router/index.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
ctx
:
''
,
},
onShow
()
{
this
.
ctx
=
this
.
$refs
.
canvas
.
getContext
(
"
2d
"
);
this
.
ctx
.
fillStyle
=
"
red
"
this
.
ctx
.
fillRect
(
200
,
150
,
200
,
200
);
},
save
()
{
// 画笔储存
this
.
ctx
.
save
();
console
.
info
(
'
save succeed
'
)
},
clear
()
{
this
.
ctx
.
clearRect
(
0
,
0
,
600
,
500
);
// 该变画笔颜色
this
.
ctx
.
fillStyle
=
"
#2133d2
"
;
},
restore
()
{
this
.
ctx
.
beginPath
();
// 画笔恢复
this
.
ctx
.
restore
();
this
.
ctx
.
fillRect
(
200
,
150
,
200
,
200
);
},
getLineDash
()
{
this
.
ctx
.
arc
(
100
,
75
,
50
,
0
,
6.28
);
this
.
ctx
.
setLineDash
([
10
,
20
]);
this
.
ctx
.
stroke
();
var
info
=
this
.
ctx
.
getLineDash
();
console
.
info
(
'
getLineDash:
'
+
info
)
}
}
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/div/router/index.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.container
{
flex-direction
:
column
;
width
:
100%
;
margin-top
:
10px
;
display
:
flex
;
}
.title
{
width
:
200px
;
height
:
70px
;
color
:
white
;
border-radius
:
20px
;
text-align
:
center
;
background-color
:
#6060e7
;
margin-bottom
:
30px
;
}
.text
{
width
:
100%
;
height
:
100px
;
font-size
:
40px
;
margin-left
:
12px
;
}
.group
{
width
:
100%
;
align-content
:
center
;
justify-content
:
center
;
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/div/router/index.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div id = "div1" class="container">
<div class="group">
<text id="function1" class="title" onclick="functionTest1">linear</text>
<text id="function2" class="title" onclick="functionTest2">ease</text>
<text id="function3" class="title" onclick="functionTest3">ease-in</text>
</div>
<div class="group">
<text id="function4" class="title" onclick="functionTest4">ease-out</text>
<text id="function5" class="title" onclick="functionTest5">ease-in-out</text>
<text id="function6" class="title" onclick="functionTest6">friction</text>
</div>
<div class="group">
<text id="function7" class="title" onclick="functionTest7">extreme-deceleration</text>
<text id="function8" class="title" onclick="functionTest8">sharp</text>
<text id="function9" class="title" onclick="functionTest9">rhythm</text>
</div>
<div class="group">
<text id="function10" class="title" onclick="functionTest10">smooth</text>
<text id="function11" class="title" onclick="functionTest11">cubic-bezier</text>
<text id="function12" class="title" onclick="functionTest12">steps</text>
</div>
<text id = "text1" class="text">列表文本1</text>
<text id = "text2" class="text">列表文本2</text>
<text id = "text3" class="text">列表文本3</text>
<text id = "text4" class="text">列表文本4</text>
<text id = "text5" class="text">列表文本5</text>
<text id = "text6" class="text">列表文本6</text>
<text id = "text7" class="text">列表文本7</text>
<text id = "text8" class="text">列表文本8</text>
<text id = "text9" class="text">列表文本9</text>
<text id = "text10" class="text">列表文本10</text>
<text id = "text11" class="text">列表文本11</text>
<text id = "text12" class="text">列表文本12</text>
<text id = "text13" class="text">列表文本13</text>
<text id = "text14" class="text">列表文本14</text>
<text id = "text15" class="text">列表文本15</text>
<text id = "text16" class="text">列表文本16</text>
<text id = "text17" class="text">列表文本17</text>
<text id = "text18" class="text">列表文本18</text>
<text id = "text19" class="text">列表文本19</text>
<text id = "text20" class="text">列表文本20</text>
<text id = "text21" class="text">列表文本21</text>
</div>
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/div/router/index.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
title
:
""
,
},
functionTest1
()
{
var
div
=
this
.
$element
(
'
div1
'
);
div
.
scrollTo
({
id
:
"
text12
"
,
duration
:
200
,
timingFunction
:
"
linear
"
,
complete
:
()
=>
{
console
.
info
(
'
scrollTo complete
'
)
}
})
},
functionTest2
()
{
var
div
=
this
.
$element
(
'
div1
'
);
div
.
scrollTo
({
id
:
"
text12
"
,
duration
:
200
,
timingFunction
:
"
ease
"
,
complete
:
()
=>
{
console
.
info
(
'
scrollTo complete
'
)
}
})
},
functionTest3
()
{
var
div
=
this
.
$element
(
'
div1
'
);
div
.
scrollTo
({
id
:
"
text12
"
,
duration
:
200
,
timingFunction
:
"
ease-in
"
,
complete
:
()
=>
{
console
.
info
(
'
scrollTo complete
'
)
}
})
},
functionTest4
()
{
var
div
=
this
.
$element
(
'
div1
'
);
div
.
scrollTo
({
id
:
"
text12
"
,
duration
:
200
,
timingFunction
:
"
ease-out
"
,
complete
:
()
=>
{
console
.
info
(
'
scrollTo complete
'
)
}
})
},
functionTest5
()
{
var
div
=
this
.
$element
(
'
div1
'
);
div
.
scrollTo
({
id
:
"
text12
"
,
duration
:
200
,
timingFunction
:
"
ease-in-out
"
,
complete
:
()
=>
{
console
.
info
(
'
scrollTo complete
'
)
}
})
},
functionTest6
()
{
var
div
=
this
.
$element
(
'
div1
'
);
div
.
scrollTo
({
id
:
"
text12
"
,
duration
:
200
,
timingFunction
:
"
friction
"
,
complete
:
()
=>
{
console
.
info
(
'
scrollTo complete
'
)
}
})
},
functionTest7
()
{
var
div
=
this
.
$element
(
'
div1
'
);
div
.
scrollTo
({
id
:
"
text12
"
,
duration
:
200
,
timingFunction
:
"
extreme-deceleration
"
,
complete
:
()
=>
{
console
.
info
(
'
scrollTo complete
'
)
}
})
},
functionTest8
()
{
var
div
=
this
.
$element
(
'
div1
'
);
div
.
scrollTo
({
id
:
"
text12
"
,
duration
:
200
,
timingFunction
:
"
sharp
"
,
complete
:
()
=>
{
console
.
info
(
'
scrollTo complete
'
)
}
})
},
functionTest9
()
{
var
div
=
this
.
$element
(
'
div1
'
);
div
.
scrollTo
({
id
:
"
text12
"
,
duration
:
200
,
timingFunction
:
"
rhythm
"
,
complete
:
()
=>
{
console
.
info
(
'
scrollTo complete
'
)
}
})
},
functionTest10
()
{
var
div
=
this
.
$element
(
'
div1
'
);
div
.
scrollTo
({
id
:
"
text12
"
,
duration
:
200
,
timingFunction
:
"
smooth
"
,
complete
:
()
=>
{
console
.
info
(
'
scrollTo complete
'
)
}
})
},
functionTest11
()
{
var
div
=
this
.
$element
(
'
div1
'
);
div
.
scrollTo
({
id
:
"
text12
"
,
duration
:
200
,
timingFunction
:
"
cubic-bezier
"
,
complete
:
()
=>
{
console
.
info
(
'
scrollTo complete
'
)
}
})
},
functionTest12
()
{
var
div
=
this
.
$element
(
'
div1
'
);
div
.
scrollTo
({
id
:
"
text12
"
,
duration
:
200
,
timingFunction
:
"
steps
"
,
complete
:
()
=>
{
console
.
info
(
'
scrollTo complete
'
)
}
})
}
}
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/index/index.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
40px
;
color
:
#000000
;
opacity
:
0.9
;
}
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/index/index.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div class="container">
<text class="title">
Hello {{ title }}
</text>
</div>
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/index/index.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
export
default
{
data
:
{
title
:
""
},
onInit
()
{
console
.
info
(
'
[test page log] index onInit
'
)
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
[test page log] index onShow
'
)
},
onHide
()
{
console
.
info
(
'
[test page log] index onHide
'
)
},
}
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.container
{
display
:
flex
;
flex-direction
:
column
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
height
:
100%
;
}
.testDiv
{
display
:
flex
;
flex-direction
:
column
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
}
.title
{
font-size
:
40px
;
text-align
:
center
;
width
:
100%
;
height
:
60px
;
margin
:
10px
;
padding
:
10px
;
}
@media
screen
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div class="container">
<div id="testDiv" class="testDiv">
</div>
<input id="function1" class="title" onclick="functionTest1">
Element setStyle
</input>
<input id="function2" class="title" onclick="functionTest2">
Element setAttribute
</input>
<input id="function3" class="title" onclick="functionTest3">
Element addChild
</input>
<input id="function4" class="title" onclick="functionTest4">
Element rotation
</input>
<input id="function5" class="title" onclick="functionTest5">
watch test
</input>
<input id="function6" class="title" onclick="functionTest6">
set/delete test
</input>
</div>
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
title
:
""
,
watchVal
:
"
123
"
,
Version
:
"
1.0
"
},
onInit
()
{
this
.
$watch
(
"
watchVal
"
,
"
onwatch
"
)
},
functionTest1
()
{
var
function1
=
this
.
$element
(
'
function1
'
);
var
result
=
function1
.
setStyle
(
"
font-size
"
,
"
50px
"
)
console
.
info
(
'
setStyle result is
'
+
result
)
},
functionTest2
()
{
var
function2
=
this
.
$element
(
'
function2
'
);
function2
.
setAttribute
(
"
type
"
,
"
password
"
)
},
functionTest3
()
{
},
functionTest4
()
{
var
function2
=
this
.
$element
(
'
function2
'
);
function2
.
rotation
({
focus
:
true
})
},
functionTest5
()
{
//将watchVal从123改为456,触发onwatch事件
this
.
watchVal
=
"
456
"
},
functionTest6
()
{
this
.
$set
(
'
Version
'
,
'
2.0
'
);
console
.
info
(
"
Version =
"
+
this
.
Version
);
this
.
$delete
(
'
Version
'
);
// log print:Version = undefined
console
.
info
(
"
Version =
"
+
this
.
Version
);
},
onwatch
(
newVal
,
oldVal
)
{
console
.
log
(
"
watch newVal =
"
+
newVal
+
"
,oldVal =
"
+
oldVal
)
}
}
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/list/router/index.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.container
{
flex-direction
:
column
;
width
:
100%
;
margin-top
:
10px
;
}
.title
{
height
:
50px
;
font-size
:
16px
;
color
:
grey
;
margin-top
:
40px
;
margin-left
:
30px
;
}
.text
{
font-size
:
20px
;
font-weight
:
500
;
margin-left
:
12px
;
}
.list
{
width
:
96%
;
margin-left
:
5%
;
height
:
350px
;
columns
:
1
;
background-color
:
blue
;
overflow
:
scroll
;
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/list/router/index.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div class="container">
<text class="title" onclick="click">默认列表</text>
<list class="list" id="list">
<list-item for="{{array}}" class="listItem">
<text class="text">{{$item.value}}</text>
</list-item>
</list>
</div>
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/list/router/index.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
title
:
""
,
"
array
"
:
[
{
"
value
"
:
"
列表文本
"
},
{
"
value
"
:
"
列表文本
"
},
{
"
value
"
:
"
列表文本
"
},
{
"
value
"
:
"
列表文本
"
},
],
},
click
()
{
console
.
log
(
'
scrollArrow begin...
'
)
this
.
$element
(
"
list
"
).
scrollArrow
({
reverse
:
true
,
smooth
:
false
});
}
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/routerPush/index.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.container
{
width
:
454px
;
height
:
454px
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
width
:
200px
;
font-size
:
30px
;
text-align
:
center
;
}
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/routerPush/index.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div class="container">
<text class="title">
{{ title }}
</text>
</div>
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/routerPush/index.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
title
:
"
router push test
"
},
onShow
()
{
console
.
info
(
'
[test page log] routerPush onShow
'
);
},
onHide
()
{
console
.
info
(
'
[test page log] routerPush ohHide
'
);
},
}
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/routerReplace/index.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.container
{
width
:
454px
;
height
:
454px
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
width
:
200px
;
font-size
:
30px
;
text-align
:
center
;
}
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/routerReplace/index.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div class="container">
<text class="title">
{{ title }}
</text>
</div>
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/routerReplace/index.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
title
:
"
router replace test
"
},
onShow
()
{
console
.
info
(
'
[test page log] routerReplace onShow
'
);
},
onHide
()
{
console
.
info
(
'
[test page log] routerReplace ohHide
'
);
},
}
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/text/router/index.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.container
{
background-color
:
#f8f8ff
;
flex
:
1
;
flex-direction
:
column
;
align-content
:
center
;
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/text/router/index.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div class="container">
<!-- 传递数值为0时: "0 people" 阿拉伯语中此处匹配key为zero的词条-->
<text>{{ $tc('strings.plurals', 0) }}</text>
<!-- 传递数值为1时: "one person" 阿拉伯语中此处匹配key为one的词条-->
<text>{{ $tc('strings.plurals', 1) }}</text>
<!-- 传递数值为2时: "2 people" 阿拉伯语中此处匹配key为two的词条-->
<text>{{ $tc('strings.plurals', 2) }}</text>
<!-- 传递数值为6时: "6 people" 阿拉伯语中此处匹配key为few的词条-->
<text>{{ $tc('strings.plurals', 6) }}</text>
<!-- 传递数值为50时: "50 people" 阿拉伯语中此处匹配key为many的词条-->
<text>{{ $tc('strings.plurals', 50) }}</text>
<!-- 传递数值为100时: "100 people" 阿拉伯语中此处匹配key为other的词条-->
<text>{{ $tc('strings.plurals', 100) }}</text>
</div>
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/text/router/index.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
text
:
'
开始
'
,
isShow
:
false
,
},
textClicked
(
e
)
{
this
.
text
=
e
.
detail
.
text
;
}
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/video/router/index.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/video/router/index.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div style="justify-content: center;align-items: center;">
<video id='videoId' src="/common/images/video.mp4" muted='false' autoplay='false' poster='/common/images/example.jpg'
controls="true" onprepared='preparedCallback' onstart='startCallback' onpause='pauseCallback'
onfinish='finishCallback' onerror='errorCallback' onseeking='seekingCallback' onseeked='seekedCallback'
ontimeupdate='timeupdateCallback' style="object-fit:fill; width:80%; height: 400px;"
onlongpress='changeFullScreenChange' onclick="changeStartPause" loop='true' starttime = '3'></video>
</div>
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/video/router/index.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
event
:
''
,
seekingtime
:
''
,
timeupdatetime
:
''
,
seekedtime
:
''
,
isStart
:
true
,
isfullscreenchange
:
false
,
duration
:
''
,
},
preparedCallback
:
function
(
e
){
this
.
event
=
'
视频连接成功
'
;
this
.
duration
=
e
.
duration
;},
startCallback
:
function
(){
this
.
event
=
'
视频开始播放
'
;},
pauseCallback
:
function
(){
this
.
event
=
'
视频暂停播放
'
;},
finishCallback
:
function
(){
this
.
event
=
'
视频播放结束
'
;},
errorCallback
:
function
(){
this
.
event
=
'
视频播放错误
'
;},
seekingCallback
:
function
(
e
){
this
.
seekingtime
=
e
.
currenttime
;},
timeupdateCallback
:
function
(
e
){
this
.
timeupdatetime
=
e
.
currenttime
;},
changeStartPause
:
function
()
{
if
(
this
.
isStart
)
{
this
.
$element
(
'
videoId
'
).
pause
();
this
.
isStart
=
false
;
}
else
{
this
.
$element
(
'
videoId
'
).
start
();
this
.
isStart
=
true
;
}
},
changeFullScreenChange
:
function
()
{
//全屏
if
(
!
this
.
isfullscreenchange
)
{
this
.
$element
(
'
videoId
'
).
requestFullscreen
({
screenOrientation
:
'
default
'
});
this
.
isfullscreenchange
=
true
;
}
else
{
this
.
$element
(
'
videoId
'
).
exitFullscreen
();
this
.
isfullscreenchange
=
false
;
}
}
}
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/child/child.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.item
{
width
:
700px
;
flex-direction
:
column
;
height
:
300px
;
align-items
:
center
;
margin-top
:
100px
;
}
.text-style
{
width
:
100%
;
text-align
:
center
;
font-weight
:
500
;
font-family
:
Courier
;
font-size
:
36px
;
}
.title-style
{
font-weight
:
500
;
font-family
:
Courier
;
font-size
:
50px
;
color
:
#483d8b
;
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/child/child.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div class="item" onclick="textClicked">
<text class="text-style" onclick="childClicked">child component clicked</text>
<text class="text-style" if="{{showsome}}">hello child component</text>
</div>
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/child/child.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
showsome
:
false
,
text
:
'
I am child component!
'
,
},
childClicked
()
{
this
.
showsome
=
!
this
.
showsome
;
console
.
info
(
'
child component get parent text
'
);
console
.
info
(
this
.
$parent
().
text
);
console
.
info
(
'
child component get root text
'
);
console
.
info
(
this
.
$root
().
text
);
return
"
childClicked fuction return something
"
},
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/parent/parent.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.item
{
width
:
700px
;
flex-direction
:
column
;
height
:
300px
;
align-items
:
center
;
margin-top
:
100px
;
}
.text-style
{
width
:
100%
;
text-align
:
center
;
font-weight
:
500
;
font-family
:
Courier
;
font-size
:
36px
;
}
.title-style
{
font-weight
:
500
;
font-family
:
Courier
;
font-size
:
50px
;
color
:
#483d8b
;
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/parent/parent.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<element name='childComp' src='../child/child.hml'></element>
<div class="item" onclick="textClicked">
<text class="text-style" onclick="parentClicked">parent component click</text>
<text class="text-style" if="{{showsome}}">hello parent component!</text>
<childComp id = "selfDefineChild"></childComp>
</div>
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/parent/parent.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
showsome
:
false
,
text
:
'
I am parent component!
'
,
},
parentClicked
()
{
this
.
showsome
=
!
this
.
showsome
;
console
.
info
(
'
parent component get parent text
'
);
console
.
info
(
`
${
this
.
$parent
().
text
}
`
);
console
.
info
(
"
parent component get child function
"
);
console
.
info
(
`
${
this
.
$child
(
'
selfDefineChild
'
).
childClicked
()}
`
);
},
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/root/root.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.container
{
background-color
:
#f8f8ff
;
flex
:
1
;
flex-direction
:
column
;
align-content
:
center
;
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/root/root.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<element name='parentComp' src='../parent/parent.hml'></element>
<div class="container">
<div class="container">
<text>{{text}}</text>
<parentComp></parentComp>
</div>
</div>
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel/root/root.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
text
:
'
I am root!
'
,
},
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel1/comp/comp.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.item
{
width
:
700px
;
flex-direction
:
column
;
height
:
300px
;
align-items
:
center
;
margin-top
:
100px
;
}
.text-style
{
width
:
100%
;
text-align
:
center
;
font-weight
:
500
;
font-family
:
Courier
;
font-size
:
36px
;
}
.title-style
{
font-weight
:
500
;
font-family
:
Courier
;
font-size
:
50px
;
color
:
#483d8b
;
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel1/comp/comp.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<div class="item">
<text class="title-style">{{title}}</text>
<text class="text-style" onclick="childClicked" focusable="true">点击这里查看隐藏文本</text>
<text class="text-style" if="{{showObj}}">hello world</text>
</div>
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel1/comp/comp.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
props
:
{
title
:
{
default
:
'
title
'
,
},
showObject
:
{},
},
data
()
{
return
{
showObj
:
this
.
showObject
,
};
},
childClicked
()
{
this
.
$emit
(
'
eventType1
'
,
{
text
:
'
收到子组件参数
'
});
this
.
showObj
=
!
this
.
showObj
;
},
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel1/index/index.css
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
.container
{
background-color
:
#f8f8ff
;
flex
:
1
;
flex-direction
:
column
;
align-content
:
center
;
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel1/index/index.hml
0 → 100644
浏览文件 @
caa6846a
<!--/**
* 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.
*/-->
<element name='comp' src='../comp/comp.hml'></element>
<div class="container">
<text>父组件:{{text}}</text>
<comp title="自定义组件" show-object="{{isShow}}" @event-type1="textClicked"></comp>
</div>
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/viewModel1/index/index.js
0 → 100644
浏览文件 @
caa6846a
/**
* 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.
*/
export
default
{
data
:
{
text
:
'
开始
'
,
isShow
:
false
,
},
textClicked
(
e
)
{
this
.
text
=
e
.
detail
.
text
;
},
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/TestAbility/app.js
0 → 100644
浏览文件 @
caa6846a
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
arkui/ace_js_attribute_api/src/main/js/TestAbility/i18n/en-US.json
0 → 100644
浏览文件 @
caa6846a
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
},
"Files"
:
{
}
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/TestAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
caa6846a
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
},
"Files"
:
{
}
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/TestAbility/pages/index/index.css
0 → 100644
浏览文件 @
caa6846a
.container
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
60px
;
text-align
:
center
;
width
:
100%
;
height
:
40%
;
margin
:
10px
;
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
\ No newline at end of file
arkui/ace_js_attribute_api/src/main/js/TestAbility/pages/index/index.hml
0 → 100644
浏览文件 @
caa6846a
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
arkui/ace_js_attribute_api/src/main/js/TestAbility/pages/index/index.js
0 → 100644
浏览文件 @
caa6846a
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
}
}
arkui/ace_js_attribute_api/src/main/js/TestRunner/OpenHarmonyTestRunner.js
0 → 100644
浏览文件 @
caa6846a
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s itName
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s package
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
}
}
return
targetParams
.
trim
()
}
export
default
{
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
},
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.MainAbility
'
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
console
.
info
(
'
debug value :
'
+
debug
)
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
exitCode
);
})
}
};
arkui/ace_js_attribute_api/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
caa6846a
/*
* 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
basicabilityapi
from
'
./basicabilityapi.test.js
'
import
mediaqueryTest
from
'
./mediaquery.test.js
'
import
aceJsApiAndAttr
from
'
./commonComponentJsApi.test.js
'
export
default
function
testsuite
()
{
basicabilityapi
()
mediaqueryTest
()
aceJsApiAndAttr
()
}
arkui/ace_js_attribute_api/src/main/js/test/basicabilityapi.test.js
0 → 100644
浏览文件 @
caa6846a
/*
* 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
configuration
from
'
@system.configuration
'
;
import
prompt
from
'
@system.prompt
'
;
import
router
from
'
@system.router
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
;
export
default
function
basicabilityapi
()
{
describe
(
'
basicabilityapi
'
,
function
()
{
let
testResult
;
let
testResultFail
;
let
test
;
beforeAll
(
function
()
{
testResult
=
true
;
testResultFail
=
false
;
test
=
"
success
"
});
beforeEach
(
function
()
{
});
afterEach
(
function
()
{
});
afterAll
(
function
()
{
});
async
function
backToIndex
(){
let
backToIndexPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
router
.
back
({
uri
:
'
pages/index/index
'
});
resolve
();
},
500
);
});
let
clearPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
router
.
clear
();
resolve
();
},
500
);
});
await
backToIndexPromise
.
then
(()
=>
{
return
clearPromise
;
});
}
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0300
* @tc.name testRouterPush
* @tc.desc Go to the specified page of the application.
*/
it
(
'
testRouterPush
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterPush START
'
);
let
options
=
{
uri
:
'
pages/routerPush/index
'
}
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
router
.
push
(
options
);
resolve
();
});
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.push] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/routerPush/
"
).
assertEqual
(
pages
.
path
);
console
.
info
(
"
[router.push] getLength:
"
+
router
.
getLength
());
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterPush SUCCESS
'
);
resolve
();
},
500
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
});
await
backToIndex
();
console
.
info
(
'
testRouterPush END
'
);
done
();
});
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0310
* @tc.name testRouterPushNotExist
* @tc.desc Test push not exist page.
*/
it
(
'
testRouterPushNotExist
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterPushNotExist START
'
);
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
router
.
push
({
uri
:
'
pages/routerNotExist/index
'
});
resolve
();
});
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
pages
=
router
.
getState
();
console
.
info
(
"
testRouterPushNotExist getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/index/
"
).
assertEqual
(
pages
.
path
);
console
.
info
(
"
testRouterPushNotExist getLength:
"
+
router
.
getLength
());
expect
(
"
1
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterPushNotExist success
'
);
resolve
();
},
500
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
});
console
.
info
(
'
testRouterPushNotExist END
'
);
done
();
});
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0400
* @tc.name testRouterReplace
* @tc.desc Replace the current page with a page in the application, and destroy the replaced page.
*/
it
(
'
testRouterReplace
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterReplace START
'
);
let
options
=
{
uri
:
'
pages/routerPush/index
'
}
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
router
.
push
(
options
);
resolve
();
});
let
repleasePage
=
{
uri
:
'
pages/routerReplace/index
'
}
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
router
.
replace
(
repleasePage
);
resolve
();
},
500
);
});
//替换堆栈数量不会变
let
promise3
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.replace] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/routerReplace/
"
).
assertEqual
(
pages
.
path
);
console
.
info
(
"
[router.replace] getLength:
"
+
router
.
getLength
());
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterReplace SUCCESS
'
);
resolve
();
},
1000
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
}).
then
(()
=>
{
return
promise3
;
});
await
backToIndex
();
console
.
info
(
'
testRouterReplace END
'
);
done
();
});
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0410
* @tc.name testRouterReplaceNotExist
* @tc.desc Test replace not exist page.
*/
it
(
'
testRouterReplaceNotExist
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterReplaceNotExist START
'
);
await
setTimeout
(()
=>
{
router
.
replace
({
uri
:
'
pages/routerNotExist/index
'
});
},
500
);
await
setTimeout
(()
=>
{
let
pages
=
router
.
getState
();
console
.
info
(
"
testRouterReplaceNotExist getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/index/
"
).
assertEqual
(
pages
.
path
);
console
.
info
(
"
testRouterReplaceNotExist getLength:
"
+
router
.
getLength
());
expect
(
"
1
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterReplaceNotExist END
'
);
done
();
},
1000
);
});
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0500
* @tc.name testRouterBack
* @tc.desc Return to the previous page or the specified page.
*/
it
(
'
testRouterBack
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterBack START
'
);
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
router
.
push
({
uri
:
'
pages/routerPush/index
'
});
resolve
();
});
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
router
.
back
({
uri
:
'
pages/index/index
'
});
resolve
();
},
500
);
});
let
promise3
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.back] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/index/
"
).
assertEqual
(
pages
.
path
);
console
.
info
(
"
[router.back] getLength:
"
+
router
.
getLength
());
expect
(
"
1
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterBack SUCCESS
'
);
resolve
();
},
1000
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
}).
then
(()
=>
{
return
promise3
;
});
console
.
info
(
'
testRouterBack END
'
);
done
();
});
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0600
* @tc.name testRouterClear
* @tc.desc Clear all historical pages in the page stack, and only keep the current page as the top page.
*/
it
(
'
testRouterClear
'
,
0
,
function
()
{
console
.
info
(
'
testRouterClear START
'
);
router
.
clear
();
console
.
info
(
"
[router.clear] router.getLength:
"
+
router
.
getLength
());
expect
(
"
1
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterClear END
'
);
});
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0700
* @tc.name testRouterLength
* @tc.desc Get the number of pages currently in the page stack.
*/
it
(
'
testRouterLength
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterLength START
'
);
let
size
=
router
.
getLength
();
console
.
info
(
'
[router.getLength] pages stack size =
'
+
size
);
expect
(
size
).
assertEqual
(
'
1
'
);
let
options
=
{
uri
:
'
pages/routerPush/index
'
}
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
router
.
push
(
options
);
resolve
();
});
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
console
.
info
(
"
testRouterLength getLength:
"
+
router
.
getLength
());
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterLength SUCCESS
'
);
resolve
();
},
500
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
});
await
backToIndex
();
console
.
info
(
'
testRouterLength END
'
);
done
();
});
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0800
* @tc.name testRouterGetState
* @tc.desc Get the status information of the current page.
*/
it
(
'
testRouterGetState
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterGetState START
'
);
await
setTimeout
(()
=>
{
let
page
=
router
.
getState
();
console
.
info
(
'
[router.getState] index:
'
+
page
.
index
);
console
.
info
(
'
[router.getState] name:
'
+
page
.
name
);
console
.
info
(
'
[router.getState] path:
'
+
page
.
path
);
expect
(
page
.
index
).
assertEqual
(
1
);
expect
(
page
.
name
).
assertEqual
(
'
index
'
);
expect
(
page
.
path
).
assertEqual
(
'
pages/index/
'
);
console
.
info
(
'
testRouterGetState END
'
);
done
();
},
500
);
});
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_1100
* @tc.name testConfigurationGetLocale
* @tc.desc Get the current language and region of the app. Synchronize with the language and region.
*/
it
(
'
testConfigurationGetLocale
'
,
0
,
function
()
{
console
.
info
(
'
testConfigurationGetLocale START
'
);
const
localeInfo
=
configuration
.
getLocale
();
console
.
info
(
"
[configuration.getLocale] localeInfo:
"
+
JSON
.
stringify
(
localeInfo
));
console
.
info
(
"
[configuration.getLocale] language:
"
+
localeInfo
.
language
);
console
.
info
(
"
[configuration.getLocale] countryOrRegion:
"
+
localeInfo
.
countryOrRegion
);
console
.
info
(
"
[configuration.getLocale] dir:
"
+
localeInfo
.
dir
);
expect
(
localeInfo
.
language
).
assertEqual
(
'
zh
'
);
expect
(
localeInfo
.
dir
).
assertEqual
(
'
ltr
'
);
console
.
info
(
'
testConfigurationGetLocale END
'
);
});
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_1200
* @tc.name testSetTimeout
* @tc.desc Set up a timer that executes a function or a specified piece of code after the timer expires.
*/
it
(
'
testSetTimeout
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testSetTimeout START
'
);
let
startTime
=
new
Date
().
getTime
();
const
delay
=
200
;
await
setTimeout
(
function
(
v1
,
v2
)
{
let
endTime
=
new
Date
().
getTime
();
console
.
info
(
"
[setTimeout] startTime:
"
+
startTime
);
console
.
info
(
"
[setTimeout] endTime:
"
+
endTime
);
console
.
info
(
'
[setTimeout] delay:
'
+
(
endTime
-
startTime
));
console
.
info
(
'
[setTimeout] v1:
'
+
v1
);
console
.
info
(
'
[setTimeout] v2:
'
+
v2
);
expect
(
'
test
'
).
assertEqual
(
v1
);
expect
(
'
message
'
).
assertEqual
(
v2
);
expect
(
endTime
-
startTime
>=
delay
).
assertTrue
();
console
.
info
(
'
testSetTimeout END
'
);
done
();
},
delay
,
'
test
'
,
'
message
'
);
});
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_1400
* @tc.name testSetInterval
* @tc.desc Call a function or execute a code segment repeatedly, with a fixed time delay between each call.
*/
it
(
'
testSetInterval
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testSetInterval START
'
);
let
res
=
0
;
let
intervalID
=
setInterval
(
function
()
{
res
++
;
},
100
);
await
setTimeout
(
function
()
{
expect
(
9
).
assertEqual
(
res
);
console
.
info
(
'
testSetInterval SUCCESS
'
);
clearInterval
(
intervalID
);
console
.
info
(
'
testSetInterval END
'
);
done
();
},
1000
);
});
});
}
arkui/ace_js_attribute_api/src/main/js/test/commonComponentJsApi.test.js
0 → 100644
浏览文件 @
caa6846a
/*
* 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
router
from
'
@system.router
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
;
export
default
function
aceJsApiAndAttr
()
{
describe
(
'
aceJsApiAndAttr
'
,
function
()
{
async
function
sleep
(
time
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
time
)
}).
then
(()
=>
{
console
.
info
(
`sleep
${
time
}
over...`
)
})
}
async
function
backToIndex
()
{
let
backToIndexPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
router
.
back
({
uri
:
'
pages/index/index
'
});
resolve
();
},
500
);
});
let
clearPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
router
.
clear
();
resolve
();
},
500
);
});
await
backToIndexPromise
.
then
(()
=>
{
return
clearPromise
;
});
}
/**
* run after testcase
*/
afterEach
(
async
function
()
{
console
.
info
(
'
[aceJsTest] after each called
'
)
await
backToIndex
();
await
sleep
(
5000
)
});
/**
* @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100
* @tc.name testVideoComponent
* @tc.desc ACE
*/
it
(
'
testVideoComponent
'
,
0
,
async
function
(
done
)
{
let
result
;
let
options
=
{
uri
:
'
pages/video/router/index
'
}
try
{
result
=
router
.
push
(
options
)
console
.
info
(
"
push video page success
"
+
JSON
.
stringify
(
result
));
}
catch
(
err
)
{
console
.
error
(
"
push video page error
"
+
JSON
.
stringify
(
result
));
}
await
sleep
(
5000
)
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.video] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/video/router/
"
).
assertEqual
(
pages
.
path
);
done
();
});
/**
* @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0200
* @tc.name testAnimateComponent
* @tc.desc ACE
*/
it
(
'
testAnimateComponent
'
,
0
,
async
function
(
done
)
{
let
result
;
let
options
=
{
uri
:
'
pages/animate/router/index
'
}
try
{
result
=
router
.
push
(
options
)
console
.
info
(
"
push animate page success
"
+
JSON
.
stringify
(
result
));
}
catch
(
err
)
{
console
.
error
(
"
push animate page error
"
+
JSON
.
stringify
(
result
));
}
await
sleep
(
5000
)
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.animate] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/animate/router/
"
).
assertEqual
(
pages
.
path
);
done
();
});
/**
* @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0300
* @tc.name testCameraComponent
* @tc.desc ACE
*/
it
(
'
testCameraComponent
'
,
0
,
async
function
(
done
)
{
let
result
;
let
options
=
{
uri
:
'
pages/camera/router/index
'
}
try
{
result
=
router
.
push
(
options
)
console
.
info
(
"
push camera page success
"
+
JSON
.
stringify
(
result
));
}
catch
(
err
)
{
console
.
error
(
"
push camera page error
"
+
JSON
.
stringify
(
result
));
}
await
sleep
(
5000
)
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.camera] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/camera/router/
"
).
assertEqual
(
pages
.
path
);
done
();
});
/**
* @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0400
* @tc.name testCanvasComponent
* @tc.desc ACE
*/
it
(
'
testCanvasComponent
'
,
0
,
async
function
(
done
)
{
let
result
;
let
options
=
{
uri
:
'
pages/canvas/router/index
'
}
try
{
result
=
router
.
push
(
options
)
console
.
info
(
"
push canvas page success
"
+
JSON
.
stringify
(
result
));
}
catch
(
err
)
{
console
.
error
(
"
push canvas page error
"
+
JSON
.
stringify
(
result
));
}
await
sleep
(
5000
)
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.canvas] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/canvas/router/
"
).
assertEqual
(
pages
.
path
);
done
();
});
/**
* @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0500
* @tc.name testDivComponent
* @tc.desc ACE
*/
it
(
'
testDivComponent
'
,
0
,
async
function
(
done
)
{
let
result
;
let
options
=
{
uri
:
'
pages/div/router/index
'
}
try
{
result
=
router
.
push
(
options
)
console
.
info
(
"
push div page success
"
+
JSON
.
stringify
(
result
));
}
catch
(
err
)
{
console
.
error
(
"
push div page error
"
+
JSON
.
stringify
(
result
));
}
await
sleep
(
5000
)
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.div] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/div/router/
"
).
assertEqual
(
pages
.
path
);
done
();
});
/**
* @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0600
* @tc.name testInputComponent
* @tc.desc ACE
*/
it
(
'
testInputComponent
'
,
0
,
async
function
(
done
)
{
let
result
;
let
options
=
{
uri
:
'
pages/input/router/index
'
}
try
{
result
=
router
.
push
(
options
)
console
.
info
(
"
push input page success
"
+
JSON
.
stringify
(
result
));
}
catch
(
err
)
{
console
.
error
(
"
push input page error
"
+
JSON
.
stringify
(
result
));
}
await
sleep
(
5000
)
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.input] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/input/router/
"
).
assertEqual
(
pages
.
path
);
done
();
});
/**
* @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0700
* @tc.name testListComponent
* @tc.desc ACE
*/
it
(
'
testListComponent
'
,
0
,
async
function
(
done
)
{
let
result
;
let
options
=
{
uri
:
'
pages/list/router/index
'
}
try
{
result
=
router
.
push
(
options
)
console
.
info
(
"
push list page success
"
+
JSON
.
stringify
(
result
));
}
catch
(
err
)
{
console
.
error
(
"
push list page error
"
+
JSON
.
stringify
(
result
));
}
await
sleep
(
5000
)
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.list] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/list/router/
"
).
assertEqual
(
pages
.
path
);
done
();
});
/**
* @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0800
* @tc.name testTextComponent
* @tc.desc ACE
*/
it
(
'
testTextComponent
'
,
0
,
async
function
(
done
)
{
let
result
;
let
options
=
{
uri
:
'
pages/text/router/index
'
}
try
{
result
=
router
.
push
(
options
)
console
.
info
(
"
push text page success
"
+
JSON
.
stringify
(
result
));
}
catch
(
err
)
{
console
.
error
(
"
push text page error
"
+
JSON
.
stringify
(
result
));
}
await
sleep
(
5000
)
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.text] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/text/router/
"
).
assertEqual
(
pages
.
path
);
done
();
});
});
}
arkui/ace_js_attribute_api/src/main/js/test/mediaquery.test.js
0 → 100644
浏览文件 @
caa6846a
/*
* 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
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
mediaquery
from
'
@system.mediaquery
'
;
export
default
function
mediaqueryTest
()
{
describe
(
'
mediaqueryTest
'
,
function
()
{
let
testResult
;
let
test
;
beforeAll
(
function
()
{
testResult
=
false
;
test
=
"
success
"
});
it
(
'
addListener
'
,
0
,
function
()
{
console
.
info
(
'
MediaQuery addListener start
'
);
var
mMediaQueryList
=
mediaquery
.
matchMedia
(
'
(min-height:0)
'
);
// mMediaQueryList.onreadystatechange = function(){
function
minWidthMatch
(
e
){
if
(
e
.
matches
){
//do something
expect
(
e
.
matches
).
assertEqual
(
true
);
console
.
info
(
'
MediaQuery addListener success
'
);
expect
(
test
).
assertEqual
(
'
success
'
);
}
else
{
expect
(
e
.
matches
).
assertEqual
(
true
);
console
.
info
(
'
MediaQuery addListener fail
'
);
expect
(
test
).
assertEqual
(
'
fail
'
);
}
}
mMediaQueryList
.
addListener
(
minWidthMatch
)
console
.
info
(
'
MediaQuery addListener end
'
);
// }
});
it
(
'
matchMedia
'
,
0
,
function
()
{
console
.
info
(
'
matchMedia start
'
);
var
mMediaQueryList
=
mediaquery
.
matchMedia
(
'
(min-height:0)
'
);
var
med
=
mMediaQueryList
.
media
console
.
info
(
"
media:
"
+
med
)
mMediaQueryList
.
onchange
=
function
(){
console
.
info
(
'
MediaQuery detonate onchange
'
)
}
function
minWidthMatch
(
e
){
if
(
e
.
matches
){
console
.
info
(
"
MediaQuery matches:
"
+
e
.
matches
)
console
.
info
(
"
MediaQuery onchangeMessage:
"
+
e
.
onchange
)
console
.
info
(
'
MediaQuery matchMedia success
'
);
expect
(
test
).
assertEqual
(
'
success
'
);
}
else
{
console
.
info
(
'
MediaQuery matchMedia fail
'
);
expect
(
test
).
assertEqual
(
'
fail
'
);
}
console
.
info
(
'
MediaQuery matchMedia end
'
);
}
mMediaQueryList
.
addListener
(
minWidthMatch
);
});
it
(
'
orientation
'
,
0
,
function
()
{
console
.
info
(
'
orientation test start
'
);
var
mMediaQueryList
=
mediaquery
.
matchMedia
(
'
(orientation:landscape)
'
);
var
med
=
mMediaQueryList
.
media
console
.
info
(
"
orientation onchangeMessage:
"
+
mMediaQueryList
.
onchange
)
function
orientationMatch
(
e
){
if
(
e
.
matches
){
//do something
console
.
info
(
"
MediaQuery orientation matches:
"
+
e
.
matches
)
console
.
info
(
'
MediaQuery orientation success
'
);
expect
(
test
).
assertEqual
(
'
success
'
);
}
else
{
console
.
info
(
'
MediaQuery orientation fail
'
);
expect
(
test
).
assertEqual
(
'
fail
'
);
}
}
mMediaQueryList
.
addListener
(
orientationMatch
)
console
.
info
(
'
MediaQuery orientation test end
'
)
});
it
(
'
rmeoveListener
'
,
0
,
function
()
{
console
.
info
(
'
rmeoveListener start
'
);
var
mMediaQueryList
=
mediaquery
.
matchMedia
(
'
(max-width:466)
'
);
function
maxWidthMatch
(
e
){
if
(
e
.
matches
){
//do something
console
.
info
(
'
MediaQuery rmeoveListener success
'
);
expect
(
test
).
assertEqual
(
'
success
'
);
}
else
{
console
.
info
(
'
MediaQuery rmeoveListener fail
'
);
expect
(
test
).
assertEqual
(
'
fail
'
);
}
}
mMediaQueryList
.
addListener
(
maxWidthMatch
)
mMediaQueryList
.
removeListener
(
maxWidthMatch
)
console
.
info
(
'
MediaQuery removeListener end
'
)
});
it
(
'
maxHeight
'
,
0
,
function
()
{
console
.
info
(
'
maxHeight start
'
);
var
mMediaQueryList
=
mediaquery
.
matchMedia
(
'
(max-width:10000)
'
);
// mMediaQueryList.onreadystatechange = function(){
function
maxHeightMatch
(
e
){
if
(
e
.
matches
){
//do something
console
.
info
(
'
MediaQuery maxHeight success
'
);
expect
(
test
).
assertEqual
(
'
success
'
);
}
else
{
console
.
info
(
'
MediaQuery maxHeight fail
'
);
expect
(
test
).
assertEqual
(
'
fail
'
);
}
}
// }
mMediaQueryList
.
addListener
(
maxHeightMatch
)
console
.
info
(
'
MediaQuery maxHeight end
'
)
});
it
(
'
deviceType
'
,
0
,
function
()
{
console
.
info
(
'
deviceType start
'
);
var
mMediaQueryList
=
mediaquery
.
matchMedia
(
'
(deviceType:phone)
'
);
function
deviceTypeMatch
(
e
){
if
(
e
.
matches
){
//do something
console
.
info
(
'
MediaQuery deviceType success
'
);
expect
(
test
).
assertEqual
(
'
success
'
);
}
else
{
console
.
info
(
'
MediaQuery deviceType fail
'
);
expect
(
test
).
assertEqual
(
'
fail
'
);
}
}
mMediaQueryList
.
addListener
(
deviceTypeMatch
)
console
.
info
(
'
MediaQuery deviceType end
'
)
});
it
(
'
logicOnly
'
,
0
,
function
()
{
console
.
info
(
'
MediaQuery logicOnly start
'
);
var
mMediaQueryList
=
mediaquery
.
matchMedia
(
'
only screen and(deviceType:phone)and(max-height:100000)
'
);
// mMediaQueryList.onreadystatechange = function(){
function
logicOnlyMatch
(
e
){
if
(
e
.
matches
){
//do something
console
.
info
(
'
MediaQuery logicOnly success
'
);
expect
(
test
).
assertEqual
(
'
success
'
);
}
else
{
console
.
info
(
'
MediaQuery logicOnly fail
'
);
expect
(
test
).
assertEqual
(
'
fail
'
);
}
}
mMediaQueryList
.
addListener
(
logicOnlyMatch
)
console
.
info
(
'
MediaQuery logicOnly end
'
)
//}
});
it
(
'
logicNot
'
,
0
,
function
()
{
console
.
info
(
'
logicOnly start
'
);
var
mMediaQueryList
=
mediaquery
.
matchMedia
(
'
not screen and(deviceType:tv)
'
);
// mMediaQueryList.onreadystatechange = function(){
function
logicNotMatch
(
e
){
if
(
e
.
matches
){
//do something
console
.
info
(
'
MediaQuery logicNot success
'
);
expect
(
test
).
assertEqual
(
'
success
'
);
}
else
{
console
.
info
(
'
MediaQuery logicNot fail
'
);
expect
(
test
).
assertEqual
(
'
fail
'
);
}
}
mMediaQueryList
.
addListener
(
logicNotMatch
)
console
.
info
(
'
MediaQuery logicNot end
'
)
//}
});
it
(
'
logicAnd
'
,
0
,
function
()
{
console
.
info
(
'
MediaQuery logicAnd start
'
);
var
mMediaQueryList
=
mediaquery
.
matchMedia
(
'
screen and(deviceType:phone)
'
);
function
logicAndMatch
(
e
){
if
(
e
.
matches
){
//do something
expect
(
e
.
matches
).
assertEqual
(
true
)
console
.
info
(
'
MediaQuery logicAnd success
'
);
expect
(
test
).
assertEqual
(
'
success
'
);
}
else
{
expect
(
e
.
matches
).
assertEqual
(
true
)
console
.
info
(
'
MediaQuery logicAnd fail
'
);
expect
(
test
).
assertEqual
(
'
fail
'
);
}
}
mMediaQueryList
.
addListener
(
logicAndMatch
)
console
.
info
(
'
MediaQuery logicAnd end
'
)
});
it
(
'
logicComma
'
,
0
,
function
()
{
console
.
info
(
'
MediaQuery logicComma start
'
);
var
mMediaQueryList
=
mediaquery
.
matchMedia
(
'
screen and(min-height:0),(round-screen:true)
'
);
function
logicCommaMatch
(
e
){
if
(
e
.
matches
){
//do something
expect
(
e
.
matches
).
assertEqual
(
true
)
console
.
info
(
'
MediaQuery logicComma success
'
);
expect
(
test
).
assertEqual
(
'
success
'
);
}
else
{
expect
(
e
.
matches
).
assertEqual
(
true
)
console
.
info
(
'
MediaQuery logicComma fail
'
);
expect
(
test
).
assertEqual
(
'
fail
'
);
}
}
mMediaQueryList
.
addListener
(
logicCommaMatch
)
console
.
info
(
'
MediaQuery logicComma end
'
)
});
it
(
'
logicOr
'
,
0
,
function
()
{
console
.
info
(
'
MediaQuery logicOr start
'
);
var
mMediaQueryList
=
mediaquery
.
matchMedia
(
'
screen and(max-device-height:2000)or(round-screen:true)
'
);
function
logicOrMatch
(
e
){
if
(
e
.
matches
){
//do something
expect
(
e
.
matches
).
assertEqual
(
true
)
console
.
info
(
'
MediaQuery logicOr success
'
);
expect
(
test
).
assertEqual
(
'
success
'
);
}
else
{
expect
(
e
.
matches
).
assertEqual
(
true
)
console
.
info
(
'
MediaQuery logicOr fail
'
);
expect
(
test
).
assertEqual
(
'
fail
'
);
}
}
mMediaQueryList
.
addListener
(
logicOrMatch
)
console
.
info
(
'
MediaQuery logicOr end
'
)
});
it
(
'
logic1
'
,
0
,
function
()
{
console
.
info
(
'
MediaQuery logic>= start
'
);
var
mMediaQueryList
=
mediaquery
.
matchMedia
(
'
screen and(height>=0)
'
);
function
logicOrMatch
(
e
){
if
(
e
.
matches
){
//do something
expect
(
e
.
matches
).
assertEqual
(
true
)
console
.
info
(
'
MediaQuery logic>= success
'
);
expect
(
test
).
assertEqual
(
'
success
'
);
}
else
{
expect
(
e
.
matches
).
assertEqual
(
true
)
console
.
info
(
'
MediaQuery logic>= fail
'
);
expect
(
test
).
assertEqual
(
'
fail
'
);
}
}
mMediaQueryList
.
addListener
(
logicOrMatch
)
console
.
info
(
'
MediaQuery logic>= end
'
)
})
});}
arkui/ace_js_attribute_api/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
caa6846a
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"entry_MainAbility"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Empty Ability"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
]
}
arkui/ace_js_attribute_api/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
caa6846a
6.6 KB
arkui/ace_js_attribute_api/src/main/resources/base/media/icon_small.png
0 → 100644
浏览文件 @
caa6846a
5.8 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录