Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
636c1e4a
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
接近 2 年 前同步成功
通知
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看板
提交
636c1e4a
编写于
4月 04, 2023
作者:
Y
yaocui
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://gitee.com/yaocui_moring/xts_acts
上级
4746ded7
233f205d
变更
56
隐藏空白更改
内联
并排
Showing
56 changed file
with
912 addition
and
673 deletion
+912
-673
ability/ability_runtime/actsserviceabilityclienttest/BUILD.gn
...ity/ability_runtime/actsserviceabilityclienttest/BUILD.gn
+1
-5
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/Test.json
...eabilityclienttest/actsserviceabilityclienttest/Test.json
+1
-3
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/config.json
...enttest/actsserviceabilityclienttest/src/main/config.json
+18
-0
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/js/ServiceAbility1/service.js
...eabilityclienttest/src/main/js/ServiceAbility1/service.js
+2
-2
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/js/ServiceAbility2/service.js
...eabilityclienttest/src/main/js/ServiceAbility2/service.js
+2
-2
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/js/test/StServiceAbilityClient.test.js
...lienttest/src/main/js/test/StServiceAbilityClient.test.js
+2
-2
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/resources/base/element/string.json
...ityclienttest/src/main/resources/base/element/string.json
+4
-0
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/config.json
...ctsserviceabilityserverrelyhap/entry/src/main/config.json
+0
-87
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/AbilityStage.ts
...ceabilityserverrelyhap/entry/src/main/ets/AbilityStage.ts
+0
-21
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
...rverrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
+0
-44
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
...verrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
+0
-38
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/second.ets
...errelyhap/entry/src/main/ets/MainAbility/pages/second.ets
+0
-43
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/element/string.json
...relyhap/entry/src/main/resources/base/element/string.json
+0
-36
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/media/icon.png
...erverrelyhap/entry/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/BUILD.gn
...clienttest/actsserviceabilityserversecondrelyhap/BUILD.gn
+0
-40
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/config.json
...viceabilityserversecondrelyhap/entry/src/main/config.json
+0
-87
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/AbilityStage.ts
...ityserversecondrelyhap/entry/src/main/ets/AbilityStage.ts
+0
-21
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
...condrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
+0
-30
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/app.ets
...erversecondrelyhap/entry/src/main/ets/MainAbility/app.ets
+0
-22
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
...ondrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
+0
-38
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/second.ets
...ndrelyhap/entry/src/main/ets/MainAbility/pages/second.ets
+0
-43
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/element/string.json
...relyhap/entry/src/main/resources/base/element/string.json
+0
-36
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/media/icon.png
...econdrelyhap/entry/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/signature/openharmony_sx.p7b
...ceabilityserversecondrelyhap/signature/openharmony_sx.p7b
+0
-0
arkui/BUILD.gn
arkui/BUILD.gn
+1
-0
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridItemJsunit.test.ets
...ponent_ui/entry/src/main/ets/test/GridItemJsunit.test.ets
+15
-19
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridRowJsunit.test.ets
...mponent_ui/entry/src/main/ets/test/GridRowJsunit.test.ets
+25
-7
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextOffset.test.ets
...eTween/Flex_AlignContent_SpaceBetween_TextOffset.test.ets
+1
-1
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddLayoutWeight.test.ets
...ustifyContent/Center/AlignCenter_AddLayoutWeight.test.ets
+1
-1
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddLayoutWeight.test.ets
...Flex/justifyContent/End/AlignEnd_AddLayoutWeight.test.ets
+1
-1
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddPadding.test.ets
...test/Flex/justifyContent/End/AlignEnd_AddPadding.test.ets
+3
-3
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddAllSpace.test.ets
...Content/SpaceEvenly/AlignSpaceEvenly_AddAllSpace.test.ets
+3
-3
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddLayoutWeight.test.ets
...ent/SpaceEvenly/AlignSpaceEvenly_AddLayoutWeight.test.ets
+1
-1
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.test.ets
.../justifyContent/Start/AlignStart_AddLayoutWeight.test.ets
+1
-1
arkui/ace_ets_web_dev_four/AppScope/app.json
arkui/ace_ets_web_dev_four/AppScope/app.json
+21
-0
arkui/ace_ets_web_dev_four/AppScope/resources/base/element/string.json
..._web_dev_four/AppScope/resources/base/element/string.json
+8
-0
arkui/ace_ets_web_dev_four/AppScope/resources/base/media/app_icon.png
...s_web_dev_four/AppScope/resources/base/media/app_icon.png
+0
-0
arkui/ace_ets_web_dev_four/BUILD.gn
arkui/ace_ets_web_dev_four/BUILD.gn
+16
-15
arkui/ace_ets_web_dev_four/Test.json
arkui/ace_ets_web_dev_four/Test.json
+26
-0
arkui/ace_ets_web_dev_four/entry/src/main/ets/Application/AbilityStage.ts
...b_dev_four/entry/src/main/ets/Application/AbilityStage.ts
+9
-0
arkui/ace_ets_web_dev_four/entry/src/main/ets/MainAbility/MainAbility.ts
...eb_dev_four/entry/src/main/ets/MainAbility/MainAbility.ts
+37
-0
arkui/ace_ets_web_dev_four/entry/src/main/ets/MainAbility/pages/web.ets
...web_dev_four/entry/src/main/ets/MainAbility/pages/web.ets
+88
-0
arkui/ace_ets_web_dev_four/entry/src/main/ets/MainAbility/pages/webTwo.ets
..._dev_four/entry/src/main/ets/MainAbility/pages/webTwo.ets
+97
-0
arkui/ace_ets_web_dev_four/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...ur/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
arkui/ace_ets_web_dev_four/entry/src/main/ets/test/List.test.ets
...ce_ets_web_dev_four/entry/src/main/ets/test/List.test.ets
+19
-21
arkui/ace_ets_web_dev_four/entry/src/main/ets/test/Utils.ets
arkui/ace_ets_web_dev_four/entry/src/main/ets/test/Utils.ets
+169
-0
arkui/ace_ets_web_dev_four/entry/src/main/ets/test/WebJsunit.test.ets
...s_web_dev_four/entry/src/main/ets/test/WebJsunit.test.ets
+58
-0
arkui/ace_ets_web_dev_four/entry/src/main/ets/test/WebTwoJsunit.test.ets
...eb_dev_four/entry/src/main/ets/test/WebTwoJsunit.test.ets
+78
-0
arkui/ace_ets_web_dev_four/entry/src/main/module.json
arkui/ace_ets_web_dev_four/entry/src/main/module.json
+49
-0
arkui/ace_ets_web_dev_four/entry/src/main/resources/base/element/string.json
...ev_four/entry/src/main/resources/base/element/string.json
+32
-0
arkui/ace_ets_web_dev_four/entry/src/main/resources/base/media/icon.png
...web_dev_four/entry/src/main/resources/base/media/icon.png
+0
-0
arkui/ace_ets_web_dev_four/entry/src/main/resources/base/profile/main_pages.json
...our/entry/src/main/resources/base/profile/main_pages.json
+6
-0
arkui/ace_ets_web_dev_four/entry/src/main/resources/rawfile/icon.png
...ts_web_dev_four/entry/src/main/resources/rawfile/icon.png
+0
-0
arkui/ace_ets_web_dev_four/entry/src/main/resources/rawfile/music.html
..._web_dev_four/entry/src/main/resources/rawfile/music.html
+10
-0
arkui/ace_ets_web_dev_four/signature/openharmony_sx.p7b
arkui/ace_ets_web_dev_four/signature/openharmony_sx.p7b
+0
-0
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/test/TaskPool.test.js
...s/taskpool_lib_standard/src/main/js/test/TaskPool.test.js
+29
-0
未找到文件。
ability/ability_runtime/actsserviceabilityclienttest/BUILD.gn
浏览文件 @
636c1e4a
...
...
@@ -16,10 +16,6 @@ import("//test/xts/tools/build/suite.gni")
group("serviceability") {
testonly = true
if (is_standard_system) {
deps = [
"actsserviceabilityclienttest:ActsServiceAbilityClientTest",
"actsserviceabilityserverrelyhap:ActsServiceAbilityServerRelyHap",
"actsserviceabilityserversecondrelyhap:ActsServiceAbilityServerSecondRelyHap",
]
deps = [ "actsserviceabilityclienttest:ActsServiceAbilityClientTest" ]
}
}
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/Test.json
浏览文件 @
636c1e4a
...
...
@@ -11,9 +11,7 @@
"kits"
:
[
{
"test-file-name"
:
[
"ActsServiceAbilityClientTest.hap"
,
"ActsServiceAbilityServerRelyHap.hap"
,
"ActsServiceAbilityServerSecondRelyHap.hap"
"ActsServiceAbilityClientTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
...
...
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/config.json
浏览文件 @
636c1e4a
...
...
@@ -63,6 +63,24 @@
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
},
{
"srcPath"
:
"ServiceAbility1"
,
"name"
:
".ServiceAbility1"
,
"icon"
:
"$media:icon"
,
"srcLanguage"
:
"js"
,
"description"
:
"$string:description_serviceability"
,
"visible"
:
true
,
"type"
:
"service"
},
{
"srcPath"
:
"ServiceAbility2"
,
"name"
:
".ServiceAbility2"
,
"icon"
:
"$media:icon"
,
"srcLanguage"
:
"js"
,
"description"
:
"$string:description_serviceability"
,
"visible"
:
true
,
"type"
:
"service"
}
],
"js"
:
[
...
...
ability/ability_runtime/actsserviceabilityclienttest/actsserviceability
serverrelyhap/entry/src/main/ets/ServiceAbility/service.t
s
→
ability/ability_runtime/actsserviceabilityclienttest/actsserviceability
clienttest/src/main/js/ServiceAbility1/service.j
s
100644 → 100755
浏览文件 @
636c1e4a
...
...
@@ -15,8 +15,8 @@
import
rpc
from
"
@ohos.rpc
"
;
import
particleAbility
from
'
@ohos.ability.particleAbility
'
import
commonEvent
from
'
@ohos.commonEvent
'
var
serversecond_bundleName
=
"
com.amsst.stserviceability
serversecond
"
;
var
serversecond_abilityName
=
"
com.amsst.stserviceability
serversecond.ServiceAbility
"
;
var
serversecond_bundleName
=
"
com.amsst.stserviceability
client
"
;
var
serversecond_abilityName
=
"
com.amsst.stserviceability
client.ServiceAbility2
"
;
var
mConnIdJs
;
class
StubTest
extends
rpc
.
RemoteObject
{
constructor
(
des
)
{
...
...
ability/ability_runtime/actsserviceabilityclienttest/actsserviceability
serversecondrelyhap/entry/src/main/ets/ServiceAbility/service.t
s
→
ability/ability_runtime/actsserviceabilityclienttest/actsserviceability
clienttest/src/main/js/ServiceAbility2/service.j
s
100644 → 100755
浏览文件 @
636c1e4a
...
...
@@ -15,8 +15,8 @@
import
rpc
from
"
@ohos.rpc
"
;
import
particleAbility
from
'
@ohos.ability.particleAbility
'
import
commonEvent
from
'
@ohos.commonEvent
'
var
server_bundleName
=
"
com.amsst.stserviceability
server
"
;
var
server_abilityName
=
"
com.amsst.stserviceability
server.ServiceAbility
"
;
var
server_bundleName
=
"
com.amsst.stserviceability
client
"
;
var
server_abilityName
=
"
com.amsst.stserviceability
client.ServiceAbility1
"
;
var
mConnIdJs
;
class
StubTest
extends
rpc
.
RemoteObject
{
constructor
(
des
)
{
...
...
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/js/test/StServiceAbilityClient.test.js
浏览文件 @
636c1e4a
...
...
@@ -19,8 +19,8 @@ import rpc from "@ohos.rpc";
import
{
describe
,
afterEach
,
it
,
expect
}
from
'
@ohos/hypium
'
export
default
function
ActsStServiceAbilityTest
()
{
describe
(
'
ActsStServiceAbilityTest
'
,
function
()
{
let
bundleName
=
"
com.amsst.stserviceability
server
"
;
let
abilityName
=
"
com.amsst.stserviceability
server.ServiceAbility
"
;
let
bundleName
=
"
com.amsst.stserviceability
client
"
;
let
abilityName
=
"
com.amsst.stserviceability
client.ServiceAbility1
"
;
let
subscriber0100
;
let
CommonEventSubscribeInfo0100
=
{
...
...
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/resources/base/element/string.json
浏览文件 @
636c1e4a
...
...
@@ -23,6 +23,10 @@
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"description_serviceability"
,
"value"
:
"hap sample empty service"
}
]
}
\ No newline at end of file
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/config.json
已删除
100644 → 0
浏览文件 @
4746ded7
{
"app"
:
{
"bundleName"
:
"com.amsst.stserviceabilityserver"
,
"vendor"
:
"test"
,
"version"
:
{
"code"
:
1000110
,
"name"
:
"1.1.1"
},
"apiVersion"
:
{
"compatible"
:
8
,
"target"
:
9
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.amsst.stserviceabilityserver"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
,
"deviceType"
:
[
"default"
,
"tablet"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"MainAbility"
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:description_mainability"
,
"formsEnabled"
:
false
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"srcPath"
:
"ServiceAbility"
,
"name"
:
".ServiceAbility"
,
"icon"
:
"$media:icon"
,
"srcLanguage"
:
"ets"
,
"description"
:
"$string:description_serviceability"
,
"visible"
:
true
,
"type"
:
"service"
}
],
"js"
:
[
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
,
"pages/second"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
],
"defPermissions"
:
[
{
"name"
:
"com.ohos.screenlock.DataAbilityShellProvider.PROVIDER"
}
]
}
}
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/AbilityStage.ts
已删除
100644 → 0
浏览文件 @
4746ded7
/*
* 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
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
MyAbilityStage onCreate
"
);
}
}
\ No newline at end of file
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
已删除
100644 → 0
浏览文件 @
4746ded7
/*
* 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
Ability
from
'
@ohos.app.ability.UIAbility
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
"
jws onCreate
"
);
}
onDestroy
()
{
console
.
log
(
"
jws onDestroy
"
);
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
"
jws onWindowStageCreate
"
);
}
onWindowStageDestroy
()
{
console
.
log
(
"
jws onWindowStageDestroy
"
);
}
onForeground
()
{
console
.
log
(
"
jws onForeground
"
);
}
onBackground
()
{
console
.
log
(
"
jws onBackground
"
);
}
call
(){
}
}
\ No newline at end of file
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
已删除
100644 → 0
浏览文件 @
4746ded7
/*
* 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 {Core} from '@ohos/hypium'
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('onShow finish')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
core.execute()
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/second.ets
已删除
100644 → 0
浏览文件 @
4746ded7
/*
* 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';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
4746ded7
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"ServiceExtAbility"
},
{
"name"
:
"description_mainability"
,
"value"
:
"eTS_Empty Ability"
},
{
"name"
:
"description_serviceability"
,
"value"
:
"hap sample empty service"
},
{
"name"
:
"description_dataability"
,
"value"
:
"hap sample empty provider"
},
{
"name"
:
"description_mainability2"
,
"value"
:
"eTS_Empty Ability"
},
{
"name"
:
"entry_MainAbility2"
,
"value"
:
"entry_MainAbility2"
},
{
"name"
:
"description_testdataability"
,
"value"
:
"hap sample empty provider"
},
{
"name"
:
"permreason_dataability"
,
"value"
:
"request dataability premission"
}
]
}
\ No newline at end of file
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/media/icon.png
已删除
100644 → 0
浏览文件 @
4746ded7
6.6 KB
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/BUILD.gn
已删除
100644 → 0
浏览文件 @
4746ded7
# 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("//test/xts/tools/build/suite.gni")
ohos_hap_assist_suite("ActsServiceAbilityServerSecondRelyHap") {
hap_name = "ActsServiceAbilityServerSecondRelyHap"
js_build_mode = "debug"
hap_profile = "entry/src/main/config.json"
testonly = true
deps = [
":serviceability_resources",
":serviceability_ts_assets",
]
certificate_profile = "signature/openharmony_sx.p7b"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_js_assets("serviceability_ts_assets") {
source_dir = "entry/src/main/ets"
hap_profile = "entry/src/main/config.json"
ets2abc = true
}
ohos_resources("serviceability_resources") {
sources = [ "entry/src/main/resources" ]
hap_profile = "entry/src/main/config.json"
}
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/config.json
已删除
100644 → 0
浏览文件 @
4746ded7
{
"app"
:
{
"bundleName"
:
"com.amsst.stserviceabilityserversecond"
,
"vendor"
:
"test"
,
"version"
:
{
"code"
:
1000110
,
"name"
:
"1.1.1"
},
"apiVersion"
:
{
"compatible"
:
8
,
"target"
:
9
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.amsst.stserviceabilityserversecond"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
,
"deviceType"
:
[
"default"
,
"tablet"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"MainAbility"
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:description_mainability"
,
"formsEnabled"
:
false
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"srcPath"
:
"ServiceAbility"
,
"name"
:
".ServiceAbility"
,
"icon"
:
"$media:icon"
,
"srcLanguage"
:
"ets"
,
"description"
:
"$string:description_serviceability"
,
"visible"
:
true
,
"type"
:
"service"
}
],
"js"
:
[
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
,
"pages/second"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
],
"defPermissions"
:
[
{
"name"
:
"com.ohos.screenlock.DataAbilityShellProvider.PROVIDER"
}
]
}
}
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/AbilityStage.ts
已删除
100644 → 0
浏览文件 @
4746ded7
/*
* 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
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
MyAbilityStage onCreate
"
);
}
}
\ No newline at end of file
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
已删除
100644 → 0
浏览文件 @
4746ded7
import
Ability
from
'
@ohos.app.ability.UIAbility
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
"
jws onCreate
"
);
}
onDestroy
()
{
console
.
log
(
"
jws onDestroy
"
);
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
"
jws onWindowStageCreate
"
);
}
onWindowStageDestroy
()
{
console
.
log
(
"
jws onWindowStageDestroy
"
);
}
onForeground
()
{
console
.
log
(
"
jws onForeground
"
);
}
onBackground
()
{
console
.
log
(
"
jws onBackground
"
);
}
call
(){
}
}
\ No newline at end of file
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/app.ets
已删除
100644 → 0
浏览文件 @
4746ded7
/*
* 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('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
已删除
100644 → 0
浏览文件 @
4746ded7
/*
* 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 {Core} from '@ohos/hypium'
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('onShow finish')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
core.execute()
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/second.ets
已删除
100644 → 0
浏览文件 @
4746ded7
/*
* 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';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
4746ded7
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"ServiceExtAbility"
},
{
"name"
:
"description_mainability"
,
"value"
:
"eTS_Empty Ability"
},
{
"name"
:
"description_serviceability"
,
"value"
:
"hap sample empty service"
},
{
"name"
:
"description_dataability"
,
"value"
:
"hap sample empty provider"
},
{
"name"
:
"description_mainability2"
,
"value"
:
"eTS_Empty Ability"
},
{
"name"
:
"entry_MainAbility2"
,
"value"
:
"entry_MainAbility2"
},
{
"name"
:
"description_testdataability"
,
"value"
:
"hap sample empty provider"
},
{
"name"
:
"permreason_dataability"
,
"value"
:
"request dataability premission"
}
]
}
\ No newline at end of file
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/media/icon.png
已删除
100644 → 0
浏览文件 @
4746ded7
6.6 KB
ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/signature/openharmony_sx.p7b
已删除
100644 → 0
浏览文件 @
4746ded7
文件已删除
arkui/BUILD.gn
浏览文件 @
636c1e4a
...
...
@@ -29,6 +29,7 @@ group("arkui") {
"ace_ets_test:ActsAceEtsTest",
"ace_ets_third_test:ActsAceEtsThirdTest",
"ace_ets_web_dev:ActsAceWebDevTest",
"ace_ets_web_dev_four:ActsAceWebDevFourTest",
"ace_ets_web_dev_three:ActsAceWebDevThreeTest",
"ace_ets_web_dev_two:ActsAceWebDevTwoTest",
"ace_ets_xcomponent:ActsAceXComponentEtsTest",
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridItemJsunit.test.ets
浏览文件 @
636c1e4a
...
...
@@ -166,14 +166,12 @@ export default function GridItemJsunit() {
it('GridJsunit_0500', 0, async function (done) {
// Verify the columnsTemplate of Grid component
console.info('[GridJsunit_0500] START');
let gridItem1 = CommonFunc.getComponentRect('gridItem1');
let left1 = gridItem1.left
let gridItem2 = CommonFunc.getComponentRect('gridItem1');
let right1 = gridItem2.right
let gridItem1 = CommonFunc.getComponentRect('0');
let right1 = gridItem1.right;
await CommonFunc.sleep(1000);
let gridItem3 = CommonFunc.getComponentRect('
3
');
let
right2 = gridItem3.right
expect(
right2 - left1 - 4 * 6).assertEqual((right1 - left1) * 5
);
let gridItem3 = CommonFunc.getComponentRect('
1
');
let
left3 = gridItem3.left;
expect(
left3 - right1).assertEqual(vp2px(4)
);
console.info('[GridJsunit_0500] END');
done();
});
...
...
@@ -183,12 +181,10 @@ export default function GridItemJsunit() {
console.info('[GridJsunit_0600] START');
await CommonFunc.sleep(1000);
let gridItem1 = CommonFunc.getComponentRect('0');
let top1 = gridItem1.top
let gridItem2 = CommonFunc.getComponentRect('gridItem3');
let top2 = gridItem2.top
let gridItem3 = CommonFunc.getComponentRect('gridItem3');
let bottom2 = gridItem3.bottom
expect((bottom2 - top2) * 4 + 7.5).assertEqual(bottom2 - top1 - 5 * 3);
let bottom1 = gridItem1.bottom;
let gridItem3 = CommonFunc.getComponentRect('4');
let top3 = gridItem3.top;
expect(top3 - bottom1).assertEqual(vp2px(5));
console.info('[GridJsunit_0600] END');
done();
});
...
...
@@ -199,10 +195,10 @@ export default function GridItemJsunit() {
await CommonFunc.sleep(1000);
let driver = await UiDriver.create()
let gridItem1 = CommonFunc.getComponentRect('gridItem1');
let right1 = gridItem1.right
let right1 = gridItem1.right
;
let gridItem2 = CommonFunc.getComponentRect('0');
let left1 = gridItem2.left
expect(left1 - right1).assertEqual(
6
);
let left1 = gridItem2.left
;
expect(left1 - right1).assertEqual(
vp2px(4)
);
console.info('[GridJsunit_0700] END');
done();
});
...
...
@@ -216,10 +212,10 @@ export default function GridItemJsunit() {
await CommonFunc.sleep(1000);
let driver = await UiDriver.create()
let gridItem1 = CommonFunc.getComponentRect('gridItem1');
let bottom1 = gridItem1.bottom
let bottom1 = gridItem1.bottom
;
let gridItem2 = CommonFunc.getComponentRect('gridItem3');
let top1 = gridItem2.top
expect(top1 - bottom1).assertEqual(
7.5
);
let top1 = gridItem2.top
;
expect(top1 - bottom1).assertEqual(
vp2px(5)
);
console.info('[GridJsunit_0800] END');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridRowJsunit.test.ets
浏览文件 @
636c1e4a
...
...
@@ -57,7 +57,11 @@ export default function GridRowJsunit() {
expect(obj.$attrs.columns).assertEqual('4');
expect(obj.$attrs.breakpoints).assertEqual('4');
expect(obj.$attrs.direction).assertEqual('4');
expect(obj.$attrs.gutter).assertEqual('<7.500000, 15.000000');
// fix the vp2px
let x = vp2px(5).toFixed(6);
let y = vp2px(10).toFixed(6);
let str = '<' + x + ', '+y;
expect(obj.$attrs.gutter).assertEqual(str);
console.info('[GridRowJsunit_0100] END');
done();
});
...
...
@@ -65,13 +69,15 @@ export default function GridRowJsunit() {
it('GridRowJsunit_0200', 0, async function (done) {
// Modify the properties of component GridRow
console.info('[GridRowJsunit_0200] START');
globalThis.value.message.notify({name:'columns',value:
12
})
globalThis.value.message.notify({name:'columns',value:
'12'
})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'gutter',value:
{ x: 12, y: 27}
})
globalThis.value.message.notify({name:'gutter',value:
'x: 7.5, y: 15'
})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'breakpoints',value:
{ value: ["200vp", "400vp", "600vp"], reference: BreakpointsReference.ComponentSize }
})
globalThis.value.message.notify({name:'breakpoints',value:
'12'
})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'grDirection',value:GridRowDirection.RowReverse })
globalThis.value.message.notify({name:'grDirection',value:'12'})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'currentBp',value:'sm'})
await CommonFunc.sleep(2000);
// Get the propoties value of the GridRow component
...
...
@@ -83,9 +89,12 @@ export default function GridRowJsunit() {
console.info("[GridRowJsunit_0200] direction: " + JSON.stringify(obj.$attrs.direction));
console.info("[GridRowJsunit_0200] gutter: " + JSON.stringify(obj.$attrs.gutter));
expect(obj.$attrs.columns).assertEqual('12');
expect(obj.$attrs.gutter).assertEqual('<18.000000, 40.500000');
expect(obj.$attrs.breakpoints).assertEqual('12');
expect(obj.$attrs.direction).assertEqual('12');
let x = vp2px(5).toFixed(6);
let y = vp2px(10).toFixed(6);
let str = '<' + x + ', '+y;
expect(obj.$attrs.gutter).assertEqual(str);
console.info('[GridRowJsunit_0200] END');
done();
});
...
...
@@ -113,9 +122,12 @@ export default function GridRowJsunit() {
console.info("[GridRowJsunit_0300] direction: " + JSON.stringify(obj.$attrs.direction));
console.info("[GridRowJsunit_0300] gutter: " + JSON.stringify(obj.$attrs.gutter));
expect(obj.$attrs.columns).assertEqual('12');
expect(obj.$attrs.gutter).assertEqual('<18.000000, 40.500000');
expect(obj.$attrs.breakpoints).assertEqual('12');
expect(obj.$attrs.direction).assertEqual('12');
let x = vp2px(5).toFixed(6);
let y = vp2px(10).toFixed(6);
let str = '<' + x + ', '+y;
expect(obj.$attrs.gutter).assertEqual(str);
console.info('[GridRowJsunit_0300] END');
done();
});
...
...
@@ -126,8 +138,14 @@ export default function GridRowJsunit() {
let strJson = getInspectorByKey('gridRow_default');
let obj = JSON.parse(strJson);
console.info("[GridRowJsunit_0400] component obj is: " + JSON.stringify(obj));
console.info("[GridRowJsunit_0400] columns: " + JSON.stringify(obj.$attrs.columns));
console.info("[GridRowJsunit_0400] breakpoints: " + JSON.stringify(obj.$attrs.breakpoints));
console.info("[GridRowJsunit_0400] direction: " + JSON.stringify(obj.$attrs.direction));
console.info("[GridRowJsunit_0400] gutter: " + JSON.stringify(obj.$attrs.gutter));
expect(obj.$attrs.columns).assertEqual('12');
expect(obj.$attrs.gutter).assertEqual('<0.000000, 0.000000');
expect(obj.$attrs.breakpoints).assertEqual('12');
expect(obj.$attrs.direction).assertEqual('12');
console.info('[GridRowJsunit_0400] END');
done();
});
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextOffset.test.ets
浏览文件 @
636c1e4a
...
...
@@ -81,7 +81,7 @@ export default function flex_AlignContent_SpaceBetween_TextOffsetTest() {
expect(fourthText.bottom).assertEqual(flexContainer.bottom); //行首贴边行尾溢出
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom));
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(
distanceBefore
);
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(
Math.round(distanceBefore)
);
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1000] END');//其余组件行间距相等,未改变
done();
});
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddLayoutWeight.test.ets
浏览文件 @
636c1e4a
...
...
@@ -110,7 +110,7 @@ export default function AlignCenter_AddLayoutWeight() {
expect(Center_AddLayoutWeight_013.right).assertEqual(Center_AddLayoutWeight_01.right);
let oneWidth = Math.round(Center_AddLayoutWeight_011.right - Center_AddLayoutWeight_011.left);
let twoWidth = Math.round(Center_AddLayoutWeight_012.right - Center_AddLayoutWeight_012.left);
expect(
twoWidth / oneWidth
).assertEqual(2);
expect(
Math.round(twoWidth / oneWidth)
).assertEqual(2);
expect(twoWidth + oneWidth).assertEqual(vp2px(350));
expect(Math.round(Center_AddLayoutWeight_013.right - Center_AddLayoutWeight_013.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddLayoutWeight_011.bottom - Center_AddLayoutWeight_011.top)).assertEqual(vp2px(50));
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddLayoutWeight.test.ets
浏览文件 @
636c1e4a
...
...
@@ -110,7 +110,7 @@ export default function AlignEnd_AddLayoutWeight() {
expect(End_AddLayoutWeight_013.right).assertEqual(End_AddLayoutWeight_01.right);
let oneWidth = Math.round(End_AddLayoutWeight_011.right - End_AddLayoutWeight_011.left);
let twoWidth = Math.round(End_AddLayoutWeight_012.right - End_AddLayoutWeight_012.left);
expect(
twoWidth / oneWidth
).assertEqual(2);
expect(
Math.round(twoWidth / oneWidth)
).assertEqual(2);
expect(twoWidth + oneWidth).assertEqual(vp2px(350));
expect(Math.round(End_AddLayoutWeight_013.right - End_AddLayoutWeight_013.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddLayoutWeight_011.bottom - End_AddLayoutWeight_011.top)).assertEqual(vp2px(50));
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddPadding.test.ets
浏览文件 @
636c1e4a
...
...
@@ -74,9 +74,9 @@ export default function AlignEnd_AddPadding() {
expect(Math.round(End_AddPadding_011.bottom - End_AddPadding_011.top)).assertEqual(vp2px(50));
expect(Math.round(End_AddPadding_012.bottom - End_AddPadding_012.top)).assertEqual(vp2px(100));
expect(Math.round(End_AddPadding_013.bottom - End_AddPadding_013.top)).assertEqual(vp2px(150));
expect(Math.round(End_AddPadding_011.right - End_AddPadding_011.left)).assertEqual(
vp2px(440/3
));
expect(Math.round(End_AddPadding_012.right - End_AddPadding_012.left)).assertEqual(
vp2px(440/3
));
expect(Math.round(End_AddPadding_013.right - End_AddPadding_013.left)).assertEqual(
vp2px(440/3
));
expect(Math.round(End_AddPadding_011.right - End_AddPadding_011.left)).assertEqual(
Math.round(vp2px(440/3)
));
expect(Math.round(End_AddPadding_012.right - End_AddPadding_012.left)).assertEqual(
Math.round(vp2px(440/3)
));
expect(Math.round(End_AddPadding_013.right - End_AddPadding_013.left)).assertEqual(
Math.round(vp2px(440/3)
));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0300] END');
done();
});
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddAllSpace.test.ets
浏览文件 @
636c1e4a
...
...
@@ -77,9 +77,9 @@ export default function AlignSpaceEvenly_AddAllSpace() {
expect(Math.round(SpaceEvenly_AddAllSpace_011.bottom - SpaceEvenly_AddAllSpace_011.top)).assertEqual(vp2px(50));
expect(Math.round(SpaceEvenly_AddAllSpace_012.bottom - SpaceEvenly_AddAllSpace_012.top)).assertEqual(vp2px(100));
expect(Math.round(SpaceEvenly_AddAllSpace_013.bottom - SpaceEvenly_AddAllSpace_013.top)).assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddAllSpace_011.right - SpaceEvenly_AddAllSpace_011.left)).assertEqual(
vp2px(440/3
));
expect(Math.round(SpaceEvenly_AddAllSpace_012.right - SpaceEvenly_AddAllSpace_012.left)).assertEqual(
vp2px(440/3
));
expect(Math.round(SpaceEvenly_AddAllSpace_013.right - SpaceEvenly_AddAllSpace_013.left)).assertEqual(
vp2px(440/3
));
expect(Math.round(SpaceEvenly_AddAllSpace_011.right - SpaceEvenly_AddAllSpace_011.left)).assertEqual(
Math.round(vp2px(440/3)
));
expect(Math.round(SpaceEvenly_AddAllSpace_012.right - SpaceEvenly_AddAllSpace_012.left)).assertEqual(
Math.round(vp2px(440/3)
));
expect(Math.round(SpaceEvenly_AddAllSpace_013.right - SpaceEvenly_AddAllSpace_013.left)).assertEqual(
Math.round(vp2px(440/3)
));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_0600] END');
done();
});
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddLayoutWeight.test.ets
浏览文件 @
636c1e4a
...
...
@@ -122,7 +122,7 @@ export default function AlignSpaceEvenly_AddLayoutWeight() {
.assertEqual(vp2px(150));
let oneWidth = Math.round(SpaceEvenly_AddLayoutWeight_011.right - SpaceEvenly_AddLayoutWeight_011.left);
let twoWidth = Math.round(SpaceEvenly_AddLayoutWeight_012.right - SpaceEvenly_AddLayoutWeight_012.left);
expect(
twoWidth / oneWidth
).assertEqual(2);
expect(
Math.round(twoWidth / oneWidth)
).assertEqual(2);
expect(twoWidth + oneWidth).assertEqual(vp2px(350));
expect(Math.round(SpaceEvenly_AddLayoutWeight_013.right - SpaceEvenly_AddLayoutWeight_013.left)).
assertEqual(vp2px(150));
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.test.ets
浏览文件 @
636c1e4a
...
...
@@ -110,7 +110,7 @@ export default function AlignStart_AddLayoutWeight() {
expect(Start_AddLayoutWeight_013.right).assertEqual(Start_AddLayoutWeight_01.right);
let oneWidth = Math.round(Start_AddLayoutWeight_011.right - Start_AddLayoutWeight_011.left);
let twoWidth = Math.round(Start_AddLayoutWeight_012.right - Start_AddLayoutWeight_012.left);
expect(
twoWidth / oneWidth
).assertEqual(2);
expect(
Math.round(twoWidth / oneWidth)
).assertEqual(2);
expect(twoWidth + oneWidth).assertEqual(vp2px(350));
expect(Math.round(Start_AddLayoutWeight_013.right - Start_AddLayoutWeight_013.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddLayoutWeight_011.bottom - Start_AddLayoutWeight_011.top)).assertEqual(vp2px(50));
...
...
arkui/ace_ets_web_dev_four/AppScope/app.json
0 → 100644
浏览文件 @
636c1e4a
{
"app"
:
{
"bundleName"
:
"com.open.harmony.acewebfourtest"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
10
,
"targetAPIVersion"
:
10
,
"car"
:
{
"apiCompatibleVersion"
:
10
,
"singleUser"
:
false
}
}
}
\ No newline at end of file
arkui/ace_ets_web_dev_four/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
636c1e4a
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
arkui/ace_ets_web_dev_four/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
636c1e4a
15.1 KB
a
bility/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap
/BUILD.gn
→
a
rkui/ace_ets_web_dev_four
/BUILD.gn
浏览文件 @
636c1e4a
# Copyright (c) 202
2
Huawei Device Co., Ltd.
# Copyright (c) 202
1
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
...
...
@@ -13,28 +13,29 @@
import("//test/xts/tools/build/suite.gni")
ohos_
hap_assist_suite("ActsServiceAbilityServerRelyHap
") {
hap_
name = "ActsServiceAbilityServerRelyHap
"
ohos_
js_hap_suite("ActsAceWebDevFourTest
") {
hap_
profile = "entry/src/main/module.json
"
js_build_mode = "debug"
hap_profile = "entry/src/main/config.json"
testonly = true
deps = [
":
serviceability_resource
s",
":
serviceability_ts_asset
s",
":
ace_ets_web_dev_js_asset
s",
":
ace_ets_web_dev_resource
s",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
subsystem_name = "ability"
part_name = "ability_runtime"
hap_name = "ActsAceWebDevFourTest"
}
ohos_js_assets("serviceability_ts_assets") {
ohos_app_scope("ace_ets_web_dev_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_ets_web_dev_js_assets") {
source_dir = "entry/src/main/ets"
hap_profile = "entry/src/main/config.json"
ets2abc = true
}
ohos_resources("
serviceability
_resources") {
ohos_resources("
ace_ets_web_dev
_resources") {
sources = [ "entry/src/main/resources" ]
hap_profile = "entry/src/main/config.json"
deps = [ ":ace_ets_web_dev_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
arkui/ace_ets_web_dev_four/Test.json
0 → 100644
浏览文件 @
636c1e4a
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"180000"
,
"bundle-name"
:
"com.open.harmony.acewebfourtest"
,
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
"kits"
:
[{
"test-file-name"
:
[
"ActsAceWebDevFourTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"power-shell setmode 602"
]
}
]
}
\ No newline at end of file
arkui/ace_ets_web_dev_four/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
636c1e4a
import
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
arkui/ace_ets_web_dev_four/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
636c1e4a
import
Ability
from
'
@ohos.app.ability.UIAbility
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate windowStage=
"
+
windowStage
)
globalThis
.
windowStage
=
windowStage
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/web
"
,
null
)
}
onWindowStageDestroy
()
{
//Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
arkui/ace_ets_web_dev_four/entry/src/main/ets/MainAbility/pages/web.ets
0 → 100644
浏览文件 @
636c1e4a
/*
* Copyright (c) 2021~2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import events_emitter from '@ohos.events.emitter';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import { Hypium } from '@ohos/hypium';
import testsuite from '../../test/List.test';
import Utils from '../../test/Utils';
import web_webview from '@ohos.web.webview';
import fileio from '@ohos.fileio';
import prompt from '@system.prompt';
let loadedUrl;
@Entry
@Component
struct Index {
controller: web_webview.WebviewController = new web_webview.WebviewController();
@State outputStr: string = ''
@State playing: boolean = false
@State str:string="emitOnLoadIntercept"
onPageShow(){
let valueChangeEvent={
eventId:10,
priority:events_emitter.EventPriority.LOW
};
events_emitter.on(valueChangeEvent,this.valueChangeCallBack);
}
private valueChangeCallBack=(eventData)=>{
console.info("web page valueChangeCallBack");
if(eventData != null){
console.info("valueChangeCallBack:"+ JSON.stringify(eventData));
if(eventData.data.ACTION != null){
this.str = eventData.data.ACTION;
}
}
}
aboutToAppear(){
let abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
let abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build(){
Column(){
Row(){
Button("web click").key('webcomponent').onClick(async ()=>{
console.info("key==>"+this.str)
switch(this.str){
case "emitOnLoadIntercept":{
this.controller.loadUrl("https://www.baidu.com/")
break;
}
default:
console.info("can not match case")
}
})
}
Web({src:"www.example.com",controller:this.controller})
.onLoadIntercept((event) => {
console.log('url:' + event.data.getRequestUrl())
Utils.emitEvent(event.data.getRequestUrl(),2)
console.log('isMainFrame:' + event.data.isMainFrame())
console.log('isRedirect:' + event.data.isRedirect())
console.log('isRequestGesture:' + event.data.isRequestGesture())
return false
})
.onErrorReceive((event) => {
console.log('getErrorInfo:' + event.error.getErrorInfo())
Utils.emitEvent(event.error.getErrorInfo(),3)
})
}
}
}
\ No newline at end of file
arkui/ace_ets_web_dev_four/entry/src/main/ets/MainAbility/pages/webTwo.ets
0 → 100644
浏览文件 @
636c1e4a
/*
* 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 events_emitter from '@ohos.events.emitter';
import Utils from '../../test/Utils';
import web_webview from '@ohos.web.webview';
function Uint8ArrayToString(dataArray) {
var dataString = ''
for (var i = 0; i < dataArray.length; i++) {
dataString += String.fromCharCode(dataArray[i])
}
return dataString
}
function ParseX509CertInfo(x509CertArray) {
let res: string = 'getCertificate success: len = ' + x509CertArray.length;
for (let i = 0; i < x509CertArray.length; i++) {
res += ', index = ' + i + ', issuer name = '
+ Uint8ArrayToString(x509CertArray[i].getIssuerName().data) + ', subject name = '
+ Uint8ArrayToString(x509CertArray[i].getSubjectName().data) + ', valid start = '
+ x509CertArray[i].getNotBeforeTime()
+ ', valid end = ' + x509CertArray[i].getNotAfterTime()
}
return res
}
@Entry
@Component
struct Second {
@State outputStr: string = ''
webviewCtl: web_webview.WebviewController = new web_webview.WebviewController();
@State str:string="emitGetCertificate"
onPageShow(){
let valueChangeEvent={
eventId:10,
priority:events_emitter.EventPriority.LOW
};
events_emitter.on(valueChangeEvent,this.valueChangeCallBack);
}
private valueChangeCallBack=(eventData)=>{
console.info("web page valueChangeCallBack");
if(eventData != null){
console.info("valueChangeCallBack:"+ JSON.stringify(eventData));
if(eventData.data.ACTION != null){
this.str = eventData.data.ACTION;
}
}
}
build(){
Column(){
Row(){
Button("web click").key('webcomponenttwo').onClick(async ()=>{
console.info("key==>"+this.str);
switch(this.str){
case "emitGetCertificate":{
this.webviewCtl.loadUrl('https://www.baidu.com')
try {
this.webviewCtl.getCertificate().then(x509CertArray => {
this.outputStr = ParseX509CertInfo(x509CertArray);
console.info('11111111111111'+this.outputStr)
Utils.emitEvent(this.outputStr,4)
})
} catch (error) {
this.outputStr = 'getCertificate failed: ' + error.code + ", errMsg: " + error.message;
}
break;
}
default:
console.info("can not match case");
}
})
}
Web({ src: 'https://www.example.com', controller: this.webviewCtl })
.fileAccess(true)
.javaScriptAccess(true)
.domStorageAccess(true)
.onlineImageAccess(true)
.onPageEnd((e) => {
this.outputStr = 'onPageEnd : url = ' + e.url
})
}
}
}
\ No newline at end of file
arkui/ace_ets_web_dev_four/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
636c1e4a
/*
* 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
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
)
}
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a com.example.myapplication.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
a
bility/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/app
.ets
→
a
rkui/ace_ets_web_dev_four/entry/src/main/ets/test/List.test
.ets
浏览文件 @
636c1e4a
/*
* 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('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import webJsunit from './WebJsunit.test'
import webTwoJsunit from './WebTwoJsunit.test'
export default function testsuite() {
webJsunit()
webTwoJsunit()
}
\ No newline at end of file
arkui/ace_ets_web_dev_four/entry/src/main/ets/test/Utils.ets
0 → 100644
浏览文件 @
636c1e4a
/*
* 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 events_emitter from '@ohos.events.emitter';
import { expect } from "@ohos/hypium";
export default class Utils {
static sleep(time){
return new Promise((resolve,reject)=>{
setTimeout(()=>{
resolve("ok")
},time)
}).then(()=>{
console.info(`sleep ${time} over...`)
})
}
static registerEvent(testCaseName,expectedValue,eventId,done){
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
try{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.ACTION).assertEqual(expectedValue);
console.info(`[${testCaseName}] END`);
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
done()
}
let innerEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(innerEvent,callBack)
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
}
static emitEvent(actualValue,eventId){
try {
let backData = {
data: {
"ACTION": actualValue
}
}
let backEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
console.info("webFlag start to emit action state");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("webFlag emit action state err: " + JSON.stringify(err));
}
}
static registerEventTwo(testCaseName,eventId,done){
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
try{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.actualValue).assertLarger(backData.data.expectedValue-100);
expect(backData.data.actualValue).assertLess(backData.data.expectedValue-(-100));
console.info(`[${testCaseName}] END`);
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
done()
}
let innerEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(innerEvent,callBack)
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
}
static emitEventTwo(expectedValue,actualValue,eventId){
try {
let backData = {
data: {
"expectedValue":expectedValue,
"actualValue":actualValue
}
}
let backEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
console.info("webFlag start to emit action state");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("webFlag emit action state err: " + JSON.stringify(err));
}
}
static registerContainEvent(testCaseName,expectedValue,eventId,done){
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
try{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.ACTION).assertContain(expectedValue);
console.info(`[${testCaseName}] END`);
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
done()
}
let innerEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(innerEvent,callBack)
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
}
static commitKey(emitKey){
try {
let backData = {
data: {
"ACTION": emitKey
}
}
let backEvent = {
eventId:10,
priority:events_emitter.EventPriority.LOW
}
console.info("start send emitKey");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("emit emitKey err: " + JSON.stringify(err));
}
}
static registerLargerEvent(testCaseName,eventId,done){
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
try{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.actualValue).assertLarger(backData.data.expectedValue);
console.info(`[${testCaseName}] END`);
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
done()
}
let innerEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(innerEvent,callBack)
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
}
}
\ No newline at end of file
arkui/ace_ets_web_dev_four/entry/src/main/ets/test/WebJsunit.test.ets
0 → 100644
浏览文件 @
636c1e4a
/*
* 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.
*/
// @ts-nocheck
import { describe, beforeEach, afterEach, it, expect } from "@ohos/hypium";
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
let emitKey = "emitOnLoadIntercept";
export default function webJsunit() {
describe('ActsAceWebDevTest', function () {
beforeEach(async function (done) {
await Utils.sleep(2000);
console.info("web beforeEach start");
done();
})
afterEach(async function (done) {
console.info("web afterEach start:"+emitKey);
try {
let backData = {
data: {
"ACTION": emitKey
}
}
let backEvent = {
eventId:10,
priority:events_emitter.EventPriority.LOW
}
console.info("start send emitKey");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("emit emitKey err: " + JSON.stringify(err));
}
await Utils.sleep(2000);
done();
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_002
*tc.name OnLoadIntercept *tc.desic Injects the JavaScript object into window and invoke the function in window
*/
it('OnLoadIntercept',0,async function(done){
emitKey="emitOnLoadIntercept";
Utils.registerEvent("OnLoadIntercept","https://www.baidu.com/",2,done);
sendEventByKey('webcomponent',10,'');
})
})
}
arkui/ace_ets_web_dev_four/entry/src/main/ets/test/WebTwoJsunit.test.ets
0 → 100644
浏览文件 @
636c1e4a
/*
* 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.
*/
// @ts-nocheck
import { describe, beforeEach, afterEach, it, expect, beforeAll} from "@ohos/hypium";
import events_emitter from '@ohos.events.emitter';
import router from '@system.router';
import Utils from './Utils.ets';
let emitKey = "emitGetCertificate";
export default function webTwoJsunit() {
describe('overviewTest', function () {
beforeAll(async function (done) {
let options = {
uri: 'MainAbility/pages/webTwo',
}
try {
router.clear();
let pages = router.getState();
console.info("get webTwo state success " + JSON.stringify(pages));
if (!("webTwo" == pages.name)) {
console.info("get webTwo state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push webTwo page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push webTwo page error: " + err);
}
done()
});
beforeEach(async function (done) {
await Utils.sleep(2000);
console.info("web beforeEach start");
done();
})
afterEach(async function (done) {
console.info("web afterEach start:"+emitKey);
try {
let backData = {
data: {
"ACTION": emitKey
}
}
let backEvent = {
eventId:10,
priority:events_emitter.EventPriority.LOW
}
console.info("start send emitKey");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("emit emitKey err: " + JSON.stringify(err));
}
await Utils.sleep(2000);
done();
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_001
*tc.name GetCertificate
*tc.desic Sets allow the Web access overview mode
*/
it('GetCertificate',0,async function(done){
emitKey="emitOverviewModeAccessFalse";
Utils.registerEvent("GetCertificate","getCertificate success: len = 0",4,done);
sendEventByKey('webcomponenttwo',10,'');
})
})
}
\ No newline at end of file
arkui/ace_ets_web_dev_four/entry/src/main/module.json
0 → 100644
浏览文件 @
636c1e4a
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"tablet"
,
"default"
,
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"metadata"
:
[
{
"name"
:
"ArkTSPartialUpdate"
,
"value"
:
"false"
}
],
"abilities"
:
[{
"name"
:
"com.example.myapplication.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}]
}],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.LOCATION"
},
{
"name"
:
"ohos.permission.INTERNET"
}
]
}
}
\ No newline at end of file
arkui/ace_ets_web_dev_four/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
636c1e4a
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
arkui/ace_ets_web_dev_four/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
636c1e4a
15.1 KB
arkui/ace_ets_web_dev_four/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
636c1e4a
{
"src"
:
[
"MainAbility/pages/web"
,
"MainAbility/pages/webTwo"
]
}
\ No newline at end of file
arkui/ace_ets_web_dev_four/entry/src/main/resources/rawfile/icon.png
0 → 100644
浏览文件 @
636c1e4a
15.1 KB
arkui/ace_ets_web_dev_four/entry/src/main/resources/rawfile/music.html
0 → 100644
浏览文件 @
636c1e4a
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
music
</title>
</head>
<body>
<audio
src=
"../base/media/gequ.mp3"
loop=
"loop"
controls=
"controls"
autoplay=
"autoplay"
></audio>
</body>
</html>
a
bility/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap
/signature/openharmony_sx.p7b
→
a
rkui/ace_ets_web_dev_four
/signature/openharmony_sx.p7b
浏览文件 @
636c1e4a
无法预览此类型文件
commonlibrary/ets_utils/taskpool_lib_standard/src/main/js/test/TaskPool.test.js
浏览文件 @
636c1e4a
...
...
@@ -925,6 +925,35 @@ describe('ActsAbilityTest', function () {
done
();
})
it
(
'
TaskPoolTestClass062
'
,
0
,
async
function
(
done
)
{
async
function
func
(
value1
,
value2
)
{
"
use concurrent
"
let
result
=
await
new
Promise
((
resolve
,
reject
)
=>
{
let
value
=
value1
+
value2
;
resolve
(
value
);
})
return
result
;
}
var
result
=
await
taskpool
.
execute
(
func
,
10
,
20
);
expect
(
result
).
assertEqual
(
30
);
done
();
})
it
(
'
TaskPoolTestClass063
'
,
0
,
async
function
(
done
)
{
async
function
func
(
value1
,
value2
)
{
"
use concurrent
"
let
result
=
await
new
Promise
((
resolve
,
reject
)
=>
{
let
value
=
value1
+
value2
;
resolve
(
value
);
})
return
result
;
}
var
task
=
new
taskpool
.
Task
(
func
,
10
,
20
);
var
result
=
await
taskpool
.
execute
(
task
);
expect
(
result
).
assertEqual
(
30
);
done
();
})
/**
* @tc.number : TaskPoolTestClass049
* @tc.name : Async Function Cancel task
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录