Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2d89fafd
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2d89fafd
编写于
7月 30, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 30, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4715 Adapt to the new framework
Merge pull request !4715 from jiyong/local-20220730-0002
上级
ce0b98c0
b6fea1bd
变更
49
显示空白变更内容
内联
并排
Showing
49 changed file
with
1057 addition
and
201 deletion
+1057
-201
ability/ability_runtime/actscalltest/systemcallentrytest/Test.json
...bility_runtime/actscalltest/systemcallentrytest/Test.json
+5
-3
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/MainAbility.ts
...llentrytest/entry/src/main/ets/MainAbility/MainAbility.ts
+1
-1
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/pages/index/index.ets
...test/entry/src/main/ets/MainAbility/pages/index/index.ets
+9
-20
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/pages/second/second.ets
...st/entry/src/main/ets/MainAbility/pages/second/second.ets
+0
-0
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/TestAbility/TestAbility.ts
...llentrytest/entry/src/main/ets/TestAbility/TestAbility.ts
+44
-0
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/TestAbility/pages/index.ets
...lentrytest/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+72
-0
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
...temcallentrytest/entry/src/main/ets/test/Ability.test.ets
+41
-41
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/List.test.ets
...systemcallentrytest/entry/src/main/ets/test/List.test.ets
+2
-2
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+2
-2
barrierfree/accessibilityelement/Test.json
barrierfree/accessibilityelement/Test.json
+5
-3
barrierfree/accessibilityelement/entry/src/main/ets/MainAbility/MainAbility.ts
...lityelement/entry/src/main/ets/MainAbility/MainAbility.ts
+24
-1
barrierfree/accessibilityelement/entry/src/main/ets/MainAbility/pages/index/index.ets
...ment/entry/src/main/ets/MainAbility/pages/index/index.ets
+1
-20
barrierfree/accessibilityelement/entry/src/main/ets/TestAbility/TestAbility.ts
...lityelement/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
barrierfree/accessibilityelement/entry/src/main/ets/TestAbility/pages/index.ets
...ityelement/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
barrierfree/accessibilityelement/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...nt/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
barrierfree/accessibilityelement/entry/src/main/ets/test/AccessibilityElement.test.ets
...ent/entry/src/main/ets/test/AccessibilityElement.test.ets
+3
-3
barrierfree/accessibilityelement/entry/src/main/ets/test/List.test.ets
...ccessibilityelement/entry/src/main/ets/test/List.test.ets
+2
-2
barrierfree/accessibilityelement/entry/src/main/resources/base/profile/main_pages.json
...ent/entry/src/main/resources/base/profile/main_pages.json
+1
-1
barrierfree/accessibilityevent/BUILD.gn
barrierfree/accessibilityevent/BUILD.gn
+4
-4
barrierfree/accessibilityevent/Test.json
barrierfree/accessibilityevent/Test.json
+5
-3
barrierfree/accessibilityevent/entry/src/main/ets/MainAbility/MainAbility.ts
...bilityevent/entry/src/main/ets/MainAbility/MainAbility.ts
+24
-1
barrierfree/accessibilityevent/entry/src/main/ets/MainAbility/pages/index/index.ets
...vent/entry/src/main/ets/MainAbility/pages/index/index.ets
+1
-20
barrierfree/accessibilityevent/entry/src/main/ets/TestAbility/TestAbility.ts
...bilityevent/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
barrierfree/accessibilityevent/entry/src/main/ets/TestAbility/pages/index.ets
...ilityevent/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
barrierfree/accessibilityevent/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...nt/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
barrierfree/accessibilityevent/entry/src/main/ets/test/AccessibilityEventTest.test.ets
...t/entry/src/main/ets/test/AccessibilityEventTest.test.ets
+3
-3
barrierfree/accessibilityevent/entry/src/main/ets/test/List.test.ets
.../accessibilityevent/entry/src/main/ets/test/List.test.ets
+2
-2
barrierfree/accessibilityevent/entry/src/main/resources/base/profile/main_pages.json
...ent/entry/src/main/resources/base/profile/main_pages.json
+1
-1
barrierfree/accessibilityextension/BUILD.gn
barrierfree/accessibilityextension/BUILD.gn
+4
-4
barrierfree/accessibilityextension/Test.json
barrierfree/accessibilityextension/Test.json
+6
-4
barrierfree/accessibilityextension/entry/src/main/ets/MainAbility/MainAbility.ts
...tyextension/entry/src/main/ets/MainAbility/MainAbility.ts
+10
-1
barrierfree/accessibilityextension/entry/src/main/ets/MainAbility/pages/index/index.ets
...sion/entry/src/main/ets/MainAbility/pages/index/index.ets
+1
-20
barrierfree/accessibilityextension/entry/src/main/ets/TestAbility/TestAbility.ts
...tyextension/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
barrierfree/accessibilityextension/entry/src/main/ets/TestAbility/pages/index.ets
...yextension/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
barrierfree/accessibilityextension/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...on/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
barrierfree/accessibilityextension/entry/src/main/ets/test/AccessibilityExtension.test.ets
...n/entry/src/main/ets/test/AccessibilityExtension.test.ets
+3
-3
barrierfree/accessibilityextension/entry/src/main/ets/test/List.test.ets
...essibilityextension/entry/src/main/ets/test/List.test.ets
+2
-2
barrierfree/accessibilityextension/entry/src/main/resources/base/profile/main_pages.json
...ion/entry/src/main/resources/base/profile/main_pages.json
+1
-1
barrierfree/accessibilityextensioncontext/BUILD.gn
barrierfree/accessibilityextensioncontext/BUILD.gn
+5
-5
barrierfree/accessibilityextensioncontext/Test.json
barrierfree/accessibilityextensioncontext/Test.json
+5
-3
barrierfree/accessibilityextensioncontext/entry/src/main/ets/MainAbility/MainAbility.ts
...sioncontext/entry/src/main/ets/MainAbility/MainAbility.ts
+10
-1
barrierfree/accessibilityextensioncontext/entry/src/main/ets/MainAbility/pages/index/index.ets
...text/entry/src/main/ets/MainAbility/pages/index/index.ets
+0
-18
barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestAbility/TestAbility.ts
...sioncontext/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestAbility/pages/index.ets
...ioncontext/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...xt/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/AccessibilityExtensionContext.test.ets
.../src/main/ets/test/AccessibilityExtensionContext.test.ets
+3
-3
barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/List.test.ets
...ityextensioncontext/entry/src/main/ets/test/List.test.ets
+2
-2
barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/profile/main_pages.json
...ext/entry/src/main/resources/base/profile/main_pages.json
+1
-1
未找到文件。
ability/ability_runtime/actscalltest/systemcallentrytest/Test.json
浏览文件 @
2d89fafd
{
{
"description"
:
"Configuration for hjunit demo Tests"
,
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"
OH
JSUnitTest"
,
"test-timeout"
:
"300000"
,
"test-timeout"
:
"300000"
,
"package"
:
"com.example.systemcalltest"
,
"bundle-name"
:
"com.example.systemcalltest"
,
"shell-timeout"
:
"60000"
"module-name"
:
"com.example.systemcalltest"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
},
"kits"
:
[
"kits"
:
[
{
{
...
...
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
2d89fafd
...
@@ -71,7 +71,7 @@ export default class MainAbility extends Ability {
...
@@ -71,7 +71,7 @@ export default class MainAbility extends Ability {
// Main window is created, set main page for this ability
// Main window is created, set main page for this ability
console
.
log
(
"
SystemCallTest MainAbility onWindowStageCreate
"
)
console
.
log
(
"
SystemCallTest MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/
pages/index/index
"
,
null
)
}
}
onWindowStageDestroy
()
{
onWindowStageDestroy
()
{
...
...
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/pages/index/index.ets
→
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/
MainAbility/
pages/index/index.ets
浏览文件 @
2d89fafd
...
@@ -12,10 +12,9 @@
...
@@ -12,10 +12,9 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import file from '@system.file';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
import testsuite from '../../../test/List.test'
import testsuite from "../../test/List.test.ets"
@Entry
@Entry
...
@@ -24,22 +23,12 @@ struct Index {
...
@@ -24,22 +23,12 @@ struct Index {
aboutToAppear(){
aboutToAppear(){
console.info("start run testcase!!!!")
console.info("start run testcase!!!!")
const core = Core.getInstance()
var abilityDelegator: any
const expectExtend = new ExpectExtend({
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
'id': 'extend'
var abilityDelegatorArguments: any
})
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
core.addService('expect', expectExtend)
console.info('start run testcase!!!')
const reportExtend = new ReportExtend(file)
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
core.addService('report', reportExtend)
core.init()
core.subscribeEvent('task', reportExtend)
const configService = core.getDefaultService('config')
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters))
globalThis.abilityWant.parameters.timeout = 10000;
configService.setConfig(globalThis.abilityWant.parameters)
testsuite(globalThis.abilityContext)
core.execute()
}
}
build() {
build() {
...
...
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/pages/second/second.ets
→
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/
MainAbility/
pages/second/second.ets
浏览文件 @
2d89fafd
文件已移动
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
2d89fafd
/*
* 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.application.Ability
'
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
TestAbility onCreate
'
)
}
onDestroy
()
{
console
.
log
(
'
TestAbility onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
setUIContent
(
this
.
context
,
'
TestAbility/pages/index
'
,
null
)
globalThis
.
abilityContext
=
this
.
context
;
}
onWindowStageDestroy
()
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
log
(
'
TestAbility onForeground
'
)
}
onBackground
()
{
console
.
log
(
'
TestAbility onBackground
'
)
}
};
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
2d89fafd
/*
* 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 '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
2d89fafd
/*
* 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
'
])
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.systemcalltest.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
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
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
2d89fafd
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"deccjsunit/index
"
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"@ohos/hypium
"
import
commonEvent
from
'@ohos.commonEvent'
import
commonEvent
from
'@ohos.commonEvent'
import
missionManager
from
'@ohos.application.missionManager'
import
missionManager
from
'@ohos.application.missionManager'
import
appManager
from
'@ohos.application.appManager'
import
appManager
from
'@ohos.application.appManager'
...
@@ -129,7 +129,7 @@ function clearDepProcess(bundleNames, callback, undoneCallBack) {
...
@@ -129,7 +129,7 @@ function clearDepProcess(bundleNames, callback, undoneCallBack) {
}
}
}
}
export
default
function
abilityTest
(
abilityContext
)
{
export
default
function
abilityTest
()
{
describe
(
'ActsAbilityTest'
,
function
()
{
describe
(
'ActsAbilityTest'
,
function
()
{
beforeEach
(
async
(
done
)
=>
{
beforeEach
(
async
(
done
)
=>
{
...
@@ -195,7 +195,7 @@ export default function abilityTest(abilityContext) {
...
@@ -195,7 +195,7 @@ export default function abilityTest(abilityContext) {
subscriber
=
await
commonEvent
.
createSubscriber
(
subscriberInfo
);
subscriber
=
await
commonEvent
.
createSubscriber
(
subscriberInfo
);
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -224,7 +224,7 @@ export default function abilityTest(abilityContext) {
...
@@ -224,7 +224,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -280,7 +280,7 @@ export default function abilityTest(abilityContext) {
...
@@ -280,7 +280,7 @@ export default function abilityTest(abilityContext) {
subscriber
=
await
commonEvent
.
createSubscriber
(
subscriberInfo
);
subscriber
=
await
commonEvent
.
createSubscriber
(
subscriberInfo
);
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
systemAppCalleeABundleName
,
bundleName
:
systemAppCalleeABundleName
,
abilityName
:
systemAppCalleeAMainAbilityName
,
abilityName
:
systemAppCalleeAMainAbilityName
,
});
});
...
@@ -310,7 +310,7 @@ export default function abilityTest(abilityContext) {
...
@@ -310,7 +310,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
systemAppCalleeABundleName
,
bundleName
:
systemAppCalleeABundleName
,
abilityName
:
systemAppCalleeAMainAbilityName
,
abilityName
:
systemAppCalleeAMainAbilityName
,
});
});
...
@@ -369,12 +369,12 @@ export default function abilityTest(abilityContext) {
...
@@ -369,12 +369,12 @@ export default function abilityTest(abilityContext) {
subscriber
=
await
commonEvent
.
createSubscriber
(
subscriberInfo
);
subscriber
=
await
commonEvent
.
createSubscriber
(
subscriberInfo
);
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
caller1
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
caller1
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
systemAppCalleeABundleName
,
bundleName
:
systemAppCalleeABundleName
,
abilityName
:
systemAppCalleeAMainAbilityName
,
abilityName
:
systemAppCalleeAMainAbilityName
,
});
});
caller2
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
caller2
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
systemAppCalleeABundleName
,
bundleName
:
systemAppCalleeABundleName
,
abilityName
:
systemAppCalleeASecondAbilityName
,
abilityName
:
systemAppCalleeASecondAbilityName
,
});
});
...
@@ -405,11 +405,11 @@ export default function abilityTest(abilityContext) {
...
@@ -405,11 +405,11 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller1
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller1
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
systemAppCalleeABundleName
,
bundleName
:
systemAppCalleeABundleName
,
abilityName
:
systemAppCalleeAMainAbilityName
,
abilityName
:
systemAppCalleeAMainAbilityName
,
});
});
let
caller2
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller2
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
systemAppCalleeABundleName
,
bundleName
:
systemAppCalleeABundleName
,
abilityName
:
systemAppCalleeASecondAbilityName
,
abilityName
:
systemAppCalleeASecondAbilityName
,
});
});
...
@@ -457,7 +457,7 @@ export default function abilityTest(abilityContext) {
...
@@ -457,7 +457,7 @@ export default function abilityTest(abilityContext) {
expect
(
data
)
.
assertEqual
(
'release'
);
expect
(
data
)
.
assertEqual
(
'release'
);
console
.
log
(
'ACTS_CommonComponent_Call_0700 releaseCallBack1'
+
data
);
console
.
log
(
'ACTS_CommonComponent_Call_0700 releaseCallBack1'
+
data
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
globalThis
.
abilityContext
.
startAbilityByCall
({
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
systemAppCalleeABundleName
,
bundleName
:
systemAppCalleeABundleName
,
abilityName
:
systemAppCalleeASecondAbilityName
,
abilityName
:
systemAppCalleeASecondAbilityName
,
})
.
then
(
data
=>
{
})
.
then
(
data
=>
{
...
@@ -488,7 +488,7 @@ export default function abilityTest(abilityContext) {
...
@@ -488,7 +488,7 @@ export default function abilityTest(abilityContext) {
subscriber
=
await
commonEvent
.
createSubscriber
(
subscriberInfo
);
subscriber
=
await
commonEvent
.
createSubscriber
(
subscriberInfo
);
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
globalThis
.
abilityContext
.
startAbilityByCall
({
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
systemAppCalleeABundleName
,
bundleName
:
systemAppCalleeABundleName
,
abilityName
:
systemAppCalleeASecondAbilityName
,
abilityName
:
systemAppCalleeASecondAbilityName
,
})
.
then
(
data
=>
{
})
.
then
(
data
=>
{
...
@@ -519,7 +519,7 @@ export default function abilityTest(abilityContext) {
...
@@ -519,7 +519,7 @@ export default function abilityTest(abilityContext) {
expect
(
data
)
.
assertEqual
(
'release'
);
expect
(
data
)
.
assertEqual
(
'release'
);
console
.
log
(
'ACTS_CommonComponent_Call_0800 releaseCallBack'
+
data
);
console
.
log
(
'ACTS_CommonComponent_Call_0800 releaseCallBack'
+
data
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
globalThis
.
abilityContext
.
startAbilityByCall
({
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
systemAppCalleeABundleName
,
bundleName
:
systemAppCalleeABundleName
,
abilityName
:
systemAppCalleeASecondAbilityName
,
abilityName
:
systemAppCalleeASecondAbilityName
,
})
.
then
(
data
=>
{
})
.
then
(
data
=>
{
...
@@ -543,7 +543,7 @@ export default function abilityTest(abilityContext) {
...
@@ -543,7 +543,7 @@ export default function abilityTest(abilityContext) {
},
100
);
},
100
);
}
}
globalThis
.
abilityContext
.
startAbilityByCall
({
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
systemAppCalleeABundleName
,
bundleName
:
systemAppCalleeABundleName
,
abilityName
:
systemAppCalleeASecondAbilityName
,
abilityName
:
systemAppCalleeASecondAbilityName
,
})
.
then
(
data
=>
{
})
.
then
(
data
=>
{
...
@@ -588,7 +588,7 @@ export default function abilityTest(abilityContext) {
...
@@ -588,7 +588,7 @@ export default function abilityTest(abilityContext) {
subscriber
=
await
commonEvent
.
createSubscriber
(
subscriberInfo
);
subscriber
=
await
commonEvent
.
createSubscriber
(
subscriberInfo
);
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
thirdAppABundleName
,
bundleName
:
thirdAppABundleName
,
abilityName
:
thirdAppAMainAbilityName
,
abilityName
:
thirdAppAMainAbilityName
,
});
});
...
@@ -619,7 +619,7 @@ export default function abilityTest(abilityContext) {
...
@@ -619,7 +619,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
thirdAppABundleName
,
bundleName
:
thirdAppABundleName
,
abilityName
:
thirdAppAMainAbilityName
,
abilityName
:
thirdAppAMainAbilityName
,
});
});
...
@@ -652,7 +652,7 @@ export default function abilityTest(abilityContext) {
...
@@ -652,7 +652,7 @@ export default function abilityTest(abilityContext) {
var
exceptionFlag
=
false
;
var
exceptionFlag
=
false
;
try
{
try
{
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
systemAppCalleeABundleName
,
bundleName
:
systemAppCalleeABundleName
,
abilityName
:
systemAppCalleeAThirdAbilityName
,
abilityName
:
systemAppCalleeAThirdAbilityName
,
});
});
...
@@ -712,7 +712,7 @@ export default function abilityTest(abilityContext) {
...
@@ -712,7 +712,7 @@ export default function abilityTest(abilityContext) {
subscriber
=
await
commonEvent
.
createSubscriber
(
subscriberInfo
);
subscriber
=
await
commonEvent
.
createSubscriber
(
subscriberInfo
);
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -768,7 +768,7 @@ export default function abilityTest(abilityContext) {
...
@@ -768,7 +768,7 @@ export default function abilityTest(abilityContext) {
bundleName
:
bundleNameCallee
,
bundleName
:
bundleNameCallee
,
abilityName
:
abilityNameCallee
,
abilityName
:
abilityNameCallee
,
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
(
want
);
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
(
want
);
if
(
typeof
caller
!==
"object"
||
caller
==
null
)
{
if
(
typeof
caller
!==
"object"
||
caller
==
null
)
{
console
.
log
(
'ACTS_CommonComponent_Call_2000 startAbilityByCall fail'
);
console
.
log
(
'ACTS_CommonComponent_Call_2000 startAbilityByCall fail'
);
expect
()
.
assertFail
();
expect
()
.
assertFail
();
...
@@ -803,7 +803,7 @@ export default function abilityTest(abilityContext) {
...
@@ -803,7 +803,7 @@ export default function abilityTest(abilityContext) {
bundleName
:
bundleNameCallee
,
bundleName
:
bundleNameCallee
,
abilityName
:
abilityNameCallee
,
abilityName
:
abilityNameCallee
,
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
(
want
);
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
(
want
);
if
(
typeof
caller
!==
"object"
||
caller
==
null
)
{
if
(
typeof
caller
!==
"object"
||
caller
==
null
)
{
console
.
log
(
'ACTS_CommonComponent_Call_2300 startAbilityByCall fail'
);
console
.
log
(
'ACTS_CommonComponent_Call_2300 startAbilityByCall fail'
);
expect
()
.
assertFail
();
expect
()
.
assertFail
();
...
@@ -849,7 +849,7 @@ export default function abilityTest(abilityContext) {
...
@@ -849,7 +849,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -893,7 +893,7 @@ export default function abilityTest(abilityContext) {
...
@@ -893,7 +893,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -924,7 +924,7 @@ export default function abilityTest(abilityContext) {
...
@@ -924,7 +924,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -955,7 +955,7 @@ export default function abilityTest(abilityContext) {
...
@@ -955,7 +955,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -986,7 +986,7 @@ export default function abilityTest(abilityContext) {
...
@@ -986,7 +986,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -1017,7 +1017,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1017,7 +1017,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -1048,7 +1048,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1048,7 +1048,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -1217,7 +1217,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1217,7 +1217,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -1249,7 +1249,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1249,7 +1249,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -1281,7 +1281,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1281,7 +1281,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
});
});
...
@@ -1313,7 +1313,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1313,7 +1313,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
globalThis
.
abilityContext
.
startAbilityByCall
({
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
})
.
then
((
data
)
=>
{
})
.
then
((
data
)
=>
{
...
@@ -1346,7 +1346,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1346,7 +1346,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
globalThis
.
abilityContext
.
startAbilityByCall
({
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
})
.
then
((
data
)
=>
{
})
.
then
((
data
)
=>
{
...
@@ -1379,7 +1379,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1379,7 +1379,7 @@ export default function abilityTest(abilityContext) {
done
();
done
();
}
}
globalThis
.
abilityContext
.
startAbilityByCall
({
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
})
.
then
((
data
)
=>
{
})
.
then
((
data
)
=>
{
...
@@ -1479,7 +1479,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1479,7 +1479,7 @@ export default function abilityTest(abilityContext) {
bundleName
:
bundleNameCallee
,
bundleName
:
bundleNameCallee
,
abilityName
:
abilityNameCallee
,
abilityName
:
abilityNameCallee
,
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
(
want
);
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
(
want
);
if
(
typeof
caller
!==
"object"
||
caller
==
null
)
{
if
(
typeof
caller
!==
"object"
||
caller
==
null
)
{
console
.
log
(
'ACTS_CommonComponent_Call_4800 startAbilityByCall fail'
);
console
.
log
(
'ACTS_CommonComponent_Call_4800 startAbilityByCall fail'
);
expect
()
.
assertFail
();
expect
()
.
assertFail
();
...
@@ -1534,7 +1534,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1534,7 +1534,7 @@ export default function abilityTest(abilityContext) {
})
})
}
}
globalThis
.
abilityContext
.
startAbilityByCall
({
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
sysABundleName
,
bundleName
:
sysABundleName
,
abilityName
:
sysASecondAbilityName
,
abilityName
:
sysASecondAbilityName
,
})
.
then
((
data
)
=>
{
})
.
then
((
data
)
=>
{
...
@@ -1635,7 +1635,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1635,7 +1635,7 @@ export default function abilityTest(abilityContext) {
let
exceptionFlag
=
false
;
let
exceptionFlag
=
false
;
try
{
try
{
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
(
null
);
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
(
null
);
console
.
log
(
'ACTS_CommonComponent_Call_5200 startAbilityByCall'
+
JSON
.
stringify
(
caller
))
console
.
log
(
'ACTS_CommonComponent_Call_5200 startAbilityByCall'
+
JSON
.
stringify
(
caller
))
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
'ACTS_CommonComponent_Call_5200 exception'
+
err
);
console
.
log
(
'ACTS_CommonComponent_Call_5200 exception'
+
err
);
...
@@ -1658,7 +1658,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1658,7 +1658,7 @@ export default function abilityTest(abilityContext) {
let
exceptionFlag
=
false
;
let
exceptionFlag
=
false
;
try
{
try
{
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
({
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
({
bundleName
:
""
,
bundleName
:
""
,
abilityName
:
""
,
abilityName
:
""
,
});
});
...
@@ -1684,7 +1684,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1684,7 +1684,7 @@ export default function abilityTest(abilityContext) {
let
exceptionFlag
=
false
;
let
exceptionFlag
=
false
;
try
{
try
{
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
(
undefined
);
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
(
undefined
);
console
.
log
(
'ACTS_CommonComponent_Call_5400 startAbilityByCall'
+
JSON
.
stringify
(
caller
))
console
.
log
(
'ACTS_CommonComponent_Call_5400 startAbilityByCall'
+
JSON
.
stringify
(
caller
))
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
'ACTS_CommonComponent_Call_5400 exception'
+
err
);
console
.
log
(
'ACTS_CommonComponent_Call_5400 exception'
+
err
);
...
@@ -1710,7 +1710,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1710,7 +1710,7 @@ export default function abilityTest(abilityContext) {
bundleName
:
bundleNameCallee
,
bundleName
:
bundleNameCallee
,
abilityName
:
abilityNameCallee
,
abilityName
:
abilityNameCallee
,
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
(
want
);
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
(
want
);
if
(
typeof
caller
!==
"object"
||
caller
==
null
)
{
if
(
typeof
caller
!==
"object"
||
caller
==
null
)
{
console
.
log
(
'ACTS_CommonComponent_Call_5700 startAbilityByCall fail'
);
console
.
log
(
'ACTS_CommonComponent_Call_5700 startAbilityByCall fail'
);
expect
()
.
assertFail
();
expect
()
.
assertFail
();
...
@@ -1757,7 +1757,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1757,7 +1757,7 @@ export default function abilityTest(abilityContext) {
bundleName
:
bundleNameCallee
,
bundleName
:
bundleNameCallee
,
abilityName
:
abilityNameCallee
,
abilityName
:
abilityNameCallee
,
}
}
let
caller
=
await
globalThis
.
abilityContext
.
startAbilityByCall
(
want
);
let
caller
=
await
globalThis
.
globalThis
.
abilityContext
.
startAbilityByCall
(
want
);
if
(
typeof
caller
!==
"object"
||
caller
==
null
)
{
if
(
typeof
caller
!==
"object"
||
caller
==
null
)
{
console
.
log
(
'ACTS_CommonComponent_Call_5800 startAbilityByCall fail'
);
console
.
log
(
'ACTS_CommonComponent_Call_5800 startAbilityByCall fail'
);
expect
()
.
assertFail
();
expect
()
.
assertFail
();
...
@@ -1773,7 +1773,7 @@ export default function abilityTest(abilityContext) {
...
@@ -1773,7 +1773,7 @@ export default function abilityTest(abilityContext) {
}
}
await
sleep
(
1000
);
await
sleep
(
1000
);
await
globalThis
.
abilityContext
.
startAbility
(
want
,
startAbilityCallback
);
await
globalThis
.
globalThis
.
abilityContext
.
startAbility
(
want
,
startAbilityCallback
);
async
function
releaseCallback
(
data
)
{
async
function
releaseCallback
(
data
)
{
console
.
log
(
'ACTS_CommonComponent_Call_5800 releaseCallBack:'
+
data
);
console
.
log
(
'ACTS_CommonComponent_Call_5800 releaseCallBack:'
+
data
);
...
...
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/List.test.ets
浏览文件 @
2d89fafd
...
@@ -15,8 +15,8 @@
...
@@ -15,8 +15,8 @@
import abilityTest from './Ability.test.ets'
import abilityTest from './Ability.test.ets'
export default function testsuite(
context
) {
export default function testsuite() {
abilityTest(
context
)
abilityTest()
}
}
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
2d89fafd
{
{
"src"
:
[
"src"
:
[
"pages/index/index"
,
"
MainAbility/
pages/index/index"
,
"pages/second/second"
"
MainAbility/
pages/second/second"
]
]
}
}
\ No newline at end of file
barrierfree/accessibilityelement/Test.json
浏览文件 @
2d89fafd
{
{
"description"
:
"Configuration for hjunit demo Tests"
,
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"
OH
JSUnitTest"
,
"test-timeout"
:
"600000"
,
"test-timeout"
:
"600000"
,
"package"
:
"com.example.myapplication"
,
"bundle-name"
:
"com.example.myapplication"
,
"shell-timeout"
:
"600000"
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
},
"kits"
:
[
"kits"
:
[
{
{
...
...
barrierfree/accessibilityelement/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
2d89fafd
/*
* 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.application.Ability
'
import
Ability
from
'
@ohos.application.Ability
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
export
default
class
MainAbility
extends
Ability
{
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityWant
=
want
;
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
}
onDestroy
()
{
onDestroy
()
{
...
@@ -18,7 +41,7 @@ export default class MainAbility extends Ability {
...
@@ -18,7 +41,7 @@ export default class MainAbility extends Ability {
//globalThis.windowStage = windowStage
//globalThis.windowStage = windowStage
//globalThis.abilityStorage = this.storage
//globalThis.abilityStorage = this.storage
globalThis
.
abilityContext
=
this
.
context
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/
pages/index/index
"
,
null
)
}
}
onWindowStageDestroy
()
{
onWindowStageDestroy
()
{
...
...
barrierfree/accessibilityelement/entry/src/main/ets/pages/index/index.ets
→
barrierfree/accessibilityelement/entry/src/main/ets/
MainAbility/
pages/index/index.ets
浏览文件 @
2d89fafd
...
@@ -12,10 +12,7 @@
...
@@ -12,10 +12,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import router from '@ohos.router';
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
import testsuite from "../../test/List.test"
@Entry
@Entry
@Component
@Component
...
@@ -24,22 +21,6 @@ struct Index {
...
@@ -24,22 +21,6 @@ struct Index {
aboutToAppear(){
aboutToAppear(){
console.info("start run testcase!!!!");
console.info("start run testcase!!!!");
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters));
globalThis.abilityWant.parameters.timeout = 70000;
configService.setConfig(globalThis.abilityWant.parameters);
testsuite(globalThis.abilityContext);
core.execute();
}
}
build() {
build() {
...
...
barrierfree/accessibilityelement/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
2d89fafd
/*
* 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.application.Ability
'
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
TestAbility onCreate
'
)
}
onDestroy
()
{
console
.
log
(
'
TestAbility onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
loadContent
(
"
TestAbility/pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
globalThis
.
abilityContext
=
this
.
context
;
}
onWindowStageDestroy
()
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
log
(
'
TestAbility onForeground
'
)
}
onBackground
()
{
console
.
log
(
'
TestAbility onBackground
'
)
}
};
\ No newline at end of file
barrierfree/accessibilityelement/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
2d89fafd
/*
* 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 '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
barrierfree/accessibilityelement/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
2d89fafd
/*
* 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
barrierfree/accessibilityelement/entry/src/main/ets/test/AccessibilityElement.test.ets
浏览文件 @
2d89fafd
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
'deccjsunit/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
"@ohos/hypium"
import commonEvent from '@ohos.commonEvent'
import commonEvent from '@ohos.commonEvent'
const passStr = 'pass';
const passStr = 'pass';
...
@@ -28,7 +28,7 @@ function publishCaseExecute(caseName: string) {
...
@@ -28,7 +28,7 @@ function publishCaseExecute(caseName: string) {
});
});
}
}
export default function abilityTest(
abilityContext
) {
export default function abilityTest() {
describe('AccessibilityElementTest', function () {
describe('AccessibilityElementTest', function () {
let subScriber = undefined;
let subScriber = undefined;
let isConnect = false;
let isConnect = false;
...
@@ -48,7 +48,7 @@ export default function abilityTest(abilityContext) {
...
@@ -48,7 +48,7 @@ export default function abilityTest(abilityContext) {
}
}
});
});
await abilityContext.startAbility({
await
globalThis.
abilityContext.startAbility({
deviceId: '',
deviceId: '',
bundleName: 'com.example.acetest',
bundleName: 'com.example.acetest',
abilityName: 'MainAbility',
abilityName: 'MainAbility',
...
...
barrierfree/accessibilityelement/entry/src/main/ets/test/List.test.ets
浏览文件 @
2d89fafd
...
@@ -14,6 +14,6 @@
...
@@ -14,6 +14,6 @@
*/
*/
import abilityTest from './AccessibilityElement.test.ets'
import abilityTest from './AccessibilityElement.test.ets'
export default function testsuite(
abilityContext
) {
export default function testsuite() {
abilityTest(
abilityContext
)
abilityTest()
}
}
\ No newline at end of file
barrierfree/accessibilityelement/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
2d89fafd
{
{
"src"
:
[
"src"
:
[
"pages/index/index"
"
MainAbility/
pages/index/index"
]
]
}
}
\ No newline at end of file
barrierfree/accessibilityevent/BUILD.gn
浏览文件 @
2d89fafd
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
import("//test/xts/tools/build/suite.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAccessibilityEventTest") {
ohos_js_hap_suite("ActsAccessibilityEventTest") {
hap_profile = "entry/src/main/module.json"
hap_profile = "
./
entry/src/main/module.json"
js_build_mode = "debug"
js_build_mode = "debug"
deps = [
deps = [
":accessibilityevent_js_assets",
":accessibilityevent_js_assets",
...
@@ -31,11 +31,11 @@ ohos_app_scope("accessibilityevent_app_profile") {
...
@@ -31,11 +31,11 @@ ohos_app_scope("accessibilityevent_app_profile") {
}
}
ohos_js_assets("accessibilityevent_js_assets") {
ohos_js_assets("accessibilityevent_js_assets") {
source_dir = "entry/src/main/ets"
source_dir = "
./
entry/src/main/ets"
}
}
ohos_resources("accessibilityevent_resources") {
ohos_resources("accessibilityevent_resources") {
sources = [ "entry/src/main/resources" ]
sources = [ "
./
entry/src/main/resources" ]
deps = [ ":accessibilityevent_app_profile" ]
deps = [ ":accessibilityevent_app_profile" ]
hap_profile = "entry/src/main/module.json"
hap_profile = "
./
entry/src/main/module.json"
}
}
barrierfree/accessibilityevent/Test.json
浏览文件 @
2d89fafd
{
{
"description"
:
"Configuration for hjunit demo Tests"
,
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"
OH
JSUnitTest"
,
"test-timeout"
:
"180000"
,
"test-timeout"
:
"180000"
,
"package"
:
"com.example.myapplication"
,
"bundle-name"
:
"com.example.myapplication"
,
"shell-timeout"
:
"600000"
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
},
"kits"
:
[
"kits"
:
[
{
{
...
...
barrierfree/accessibilityevent/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
2d89fafd
/*
* 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.application.Ability
'
import
Ability
from
'
@ohos.application.Ability
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
export
default
class
MainAbility
extends
Ability
{
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityWant
=
want
;
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
}
onDestroy
()
{
onDestroy
()
{
...
@@ -18,7 +41,7 @@ export default class MainAbility extends Ability {
...
@@ -18,7 +41,7 @@ export default class MainAbility extends Ability {
//globalThis.windowStage = windowStage
//globalThis.windowStage = windowStage
//globalThis.abilityStorage = this.storage
//globalThis.abilityStorage = this.storage
globalThis
.
abilityContext
=
this
.
context
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/
pages/index/index
"
,
null
)
}
}
onWindowStageDestroy
()
{
onWindowStageDestroy
()
{
...
...
barrierfree/accessibilityevent/entry/src/main/ets/pages/index/index.ets
→
barrierfree/accessibilityevent/entry/src/main/ets/
MainAbility/
pages/index/index.ets
浏览文件 @
2d89fafd
...
@@ -12,10 +12,7 @@
...
@@ -12,10 +12,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import router from '@ohos.router';
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
import testsuite from "../../test/List.test"
@Entry
@Entry
@Component
@Component
...
@@ -24,22 +21,6 @@ struct Index {
...
@@ -24,22 +21,6 @@ struct Index {
aboutToAppear(){
aboutToAppear(){
console.info("start run testcase!!!!");
console.info("start run testcase!!!!");
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters));
globalThis.abilityWant.parameters.timeout = 70000;
configService.setConfig(globalThis.abilityWant.parameters);
testsuite(globalThis.abilityContext);
core.execute();
}
}
build() {
build() {
...
...
barrierfree/accessibilityevent/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
2d89fafd
/*
* 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.application.Ability
'
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
TestAbility onCreate
'
)
}
onDestroy
()
{
console
.
log
(
'
TestAbility onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
loadContent
(
"
TestAbility/pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
globalThis
.
abilityContext
=
this
.
context
;
}
onWindowStageDestroy
()
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
log
(
'
TestAbility onForeground
'
)
}
onBackground
()
{
console
.
log
(
'
TestAbility onBackground
'
)
}
};
\ No newline at end of file
barrierfree/accessibilityevent/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
2d89fafd
/*
* 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 '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
barrierfree/accessibilityevent/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
2d89fafd
/*
* 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
barrierfree/accessibilityevent/entry/src/main/ets/test/AccessibilityEventTest.test.ets
浏览文件 @
2d89fafd
...
@@ -12,11 +12,11 @@
...
@@ -12,11 +12,11 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
'deccjsunit/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
"@ohos/hypium"
import accessibility from '@ohos.accessibility'
import accessibility from '@ohos.accessibility'
import commonEvent from '@ohos.commonEvent'
import commonEvent from '@ohos.commonEvent'
export default function abilityTest(
abilityContext
) {
export default function abilityTest() {
let targetBundleName = 'com.example.myapplication';
let targetBundleName = 'com.example.myapplication';
let subScriber = undefined;
let subScriber = undefined;
let isConnected: boolean = false;
let isConnected: boolean = false;
...
@@ -38,7 +38,7 @@ export default function abilityTest(abilityContext) {
...
@@ -38,7 +38,7 @@ export default function abilityTest(abilityContext) {
});
});
setTimeout(async () => {
setTimeout(async () => {
await abilityContext.startAbility({
await
globalThis.
abilityContext.startAbility({
deviceId: "",
deviceId: "",
bundleName: "com.example.acetest",
bundleName: "com.example.acetest",
abilityName: "MainAbility",
abilityName: "MainAbility",
...
...
barrierfree/accessibilityevent/entry/src/main/ets/test/List.test.ets
浏览文件 @
2d89fafd
...
@@ -14,6 +14,6 @@
...
@@ -14,6 +14,6 @@
*/
*/
import abilityTest from './AccessibilityEventTest.test.ets'
import abilityTest from './AccessibilityEventTest.test.ets'
export default function testsuite(
abilityContext
) {
export default function testsuite() {
abilityTest(
abilityContext
)
abilityTest()
}
}
\ No newline at end of file
barrierfree/accessibilityevent/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
2d89fafd
{
{
"src"
:
[
"src"
:
[
"pages/index/index"
"
MainAbility/
pages/index/index"
]
]
}
}
\ No newline at end of file
barrierfree/accessibilityextension/BUILD.gn
浏览文件 @
2d89fafd
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
import("//test/xts/tools/build/suite.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAccessibilityExtensionTest") {
ohos_js_hap_suite("ActsAccessibilityExtensionTest") {
hap_profile = "entry/src/main/module.json"
hap_profile = "
./
entry/src/main/module.json"
js_build_mode = "debug"
js_build_mode = "debug"
deps = [
deps = [
":accessibilityextension_js_assets",
":accessibilityextension_js_assets",
...
@@ -31,11 +31,11 @@ ohos_app_scope("accessibilityextension_app_profile") {
...
@@ -31,11 +31,11 @@ ohos_app_scope("accessibilityextension_app_profile") {
}
}
ohos_js_assets("accessibilityextension_js_assets") {
ohos_js_assets("accessibilityextension_js_assets") {
source_dir = "entry/src/main/ets"
source_dir = "
./
entry/src/main/ets"
}
}
ohos_resources("accessibilityextension_resources") {
ohos_resources("accessibilityextension_resources") {
sources = [ "entry/src/main/resources" ]
sources = [ "
./
entry/src/main/resources" ]
deps = [ ":accessibilityextension_app_profile" ]
deps = [ ":accessibilityextension_app_profile" ]
hap_profile = "entry/src/main/module.json"
hap_profile = "
./
entry/src/main/module.json"
}
}
barrierfree/accessibilityextension/Test.json
浏览文件 @
2d89fafd
{
{
"description"
:
"Configuration for hjunit demo Tests"
,
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"60000"
,
"test-timeout"
:
"180000"
,
"package"
:
"com.example.myapplication"
,
"bundle-name"
:
"com.example.myapplication"
,
"shell-timeout"
:
"60000"
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
},
"kits"
:
[
"kits"
:
[
{
{
...
...
barrierfree/accessibilityextension/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
2d89fafd
import
Ability
from
'
@ohos.application.Ability
'
import
Ability
from
'
@ohos.application.Ability
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
export
default
class
MainAbility
extends
Ability
{
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityWant
=
want
;
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
}
onDestroy
()
{
onDestroy
()
{
...
@@ -18,7 +27,7 @@ export default class MainAbility extends Ability {
...
@@ -18,7 +27,7 @@ export default class MainAbility extends Ability {
//globalThis.windowStage = windowStage
//globalThis.windowStage = windowStage
//globalThis.abilityStorage = this.storage
//globalThis.abilityStorage = this.storage
globalThis
.
abilityContext
=
this
.
context
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/
pages/index/index
"
,
null
)
}
}
onWindowStageDestroy
()
{
onWindowStageDestroy
()
{
...
...
barrierfree/accessibilityextension/entry/src/main/ets/pages/index/index.ets
→
barrierfree/accessibilityextension/entry/src/main/ets/
MainAbility/
pages/index/index.ets
浏览文件 @
2d89fafd
...
@@ -12,10 +12,7 @@
...
@@ -12,10 +12,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import router from '@ohos.router';
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
import testsuite from "../../test/List.test"
@Entry
@Entry
@Component
@Component
...
@@ -24,22 +21,6 @@ struct Index {
...
@@ -24,22 +21,6 @@ struct Index {
aboutToAppear(){
aboutToAppear(){
console.info("start run testcase!!!!");
console.info("start run testcase!!!!");
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters));
globalThis.abilityWant.parameters.timeout = 70000;
configService.setConfig(globalThis.abilityWant.parameters);
testsuite(globalThis.abilityContext);
core.execute();
}
}
build() {
build() {
...
...
barrierfree/accessibilityextension/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
2d89fafd
/*
* 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.application.Ability
'
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
TestAbility onCreate
'
)
}
onDestroy
()
{
console
.
log
(
'
TestAbility onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
loadContent
(
"
TestAbility/pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
globalThis
.
abilityContext
=
this
.
context
;
}
onWindowStageDestroy
()
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
log
(
'
TestAbility onForeground
'
)
}
onBackground
()
{
console
.
log
(
'
TestAbility onBackground
'
)
}
};
\ No newline at end of file
barrierfree/accessibilityextension/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
2d89fafd
/*
* 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 '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
barrierfree/accessibilityextension/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
2d89fafd
/*
* 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
barrierfree/accessibilityextension/entry/src/main/ets/test/AccessibilityExtension.test.ets
浏览文件 @
2d89fafd
...
@@ -12,10 +12,10 @@
...
@@ -12,10 +12,10 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
'deccjsunit/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
"@ohos/hypium"
import commonEvent from '@ohos.commonEvent'
import commonEvent from '@ohos.commonEvent'
export default function abilityTest(
abilityContext
) {
export default function abilityTest() {
let isCalled: boolean = false;
let isCalled: boolean = false;
let subScriber = undefined;
let subScriber = undefined;
...
@@ -57,7 +57,7 @@ export default function abilityTest(abilityContext) {
...
@@ -57,7 +57,7 @@ export default function abilityTest(abilityContext) {
*/
*/
it('AccessibilityExtensionTest_Connect_0100', 0, async function (done) {
it('AccessibilityExtensionTest_Connect_0100', 0, async function (done) {
console.info('AccessibilityExtensionTest_Connect_0100: start');
console.info('AccessibilityExtensionTest_Connect_0100: start');
await abilityContext.startAbility({
await
globalThis.
abilityContext.startAbility({
deviceId: "",
deviceId: "",
bundleName: "com.example.acetest",
bundleName: "com.example.acetest",
abilityName: "MainAbility",
abilityName: "MainAbility",
...
...
barrierfree/accessibilityextension/entry/src/main/ets/test/List.test.ets
浏览文件 @
2d89fafd
...
@@ -14,6 +14,6 @@
...
@@ -14,6 +14,6 @@
*/
*/
import abilityTest from './AccessibilityExtension.test.ets'
import abilityTest from './AccessibilityExtension.test.ets'
export default function testsuite(
abilityContext
) {
export default function testsuite() {
abilityTest(
abilityContext
)
abilityTest()
}
}
\ No newline at end of file
barrierfree/accessibilityextension/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
2d89fafd
{
{
"src"
:
[
"src"
:
[
"pages/index/index"
"
MainAbility/
pages/index/index"
]
]
}
}
\ No newline at end of file
barrierfree/accessibilityextensioncontext/BUILD.gn
浏览文件 @
2d89fafd
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
import("//test/xts/tools/build/suite.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAccessibilityExtensionContextTest") {
ohos_js_hap_suite("ActsAccessibilityExtensionContextTest") {
hap_profile = "entry/src/main/module.json"
hap_profile = "
./
entry/src/main/module.json"
js_build_mode = "debug"
js_build_mode = "debug"
deps = [
deps = [
":accessibilityextensioncontext_js_assets",
":accessibilityextensioncontext_js_assets",
...
@@ -31,11 +31,11 @@ ohos_app_scope("accessibilityextensioncontext_app_profile") {
...
@@ -31,11 +31,11 @@ ohos_app_scope("accessibilityextensioncontext_app_profile") {
}
}
ohos_js_assets("accessibilityextensioncontext_js_assets") {
ohos_js_assets("accessibilityextensioncontext_js_assets") {
source_dir = "entry/src/main/ets"
source_dir = "
./
entry/src/main/ets"
}
}
ohos_resources("accessibilityextensioncontext_resources") {
ohos_resources("accessibilityextensioncontext_resources") {
sources = [ "entry/src/main/resources" ]
sources = [ "
./
entry/src/main/resources" ]
deps = [ ":accessibilityextensioncontext_app_profile" ]
deps = [ ":accessibilityextensioncontext_app_profile" ]
hap_profile = "entry/src/main/module.json"
hap_profile = "
./
entry/src/main/module.json"
}
}
barrierfree/accessibilityextensioncontext/Test.json
浏览文件 @
2d89fafd
{
{
"description"
:
"Configuration for hjunit demo Tests"
,
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"
OH
JSUnitTest"
,
"test-timeout"
:
"360000"
,
"test-timeout"
:
"360000"
,
"package"
:
"com.example.myapplication"
,
"bundle-name"
:
"com.example.myapplication"
,
"shell-timeout"
:
"360000"
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
},
"kits"
:
[
"kits"
:
[
{
{
...
...
barrierfree/accessibilityextensioncontext/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
2d89fafd
import
Ability
from
'
@ohos.application.Ability
'
import
Ability
from
'
@ohos.application.Ability
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
export
default
class
MainAbility
extends
Ability
{
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityWant
=
want
;
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
}
onDestroy
()
{
onDestroy
()
{
...
@@ -18,7 +27,7 @@ export default class MainAbility extends Ability {
...
@@ -18,7 +27,7 @@ export default class MainAbility extends Ability {
//globalThis.windowStage = windowStage
//globalThis.windowStage = windowStage
//globalThis.abilityStorage = this.storage
//globalThis.abilityStorage = this.storage
globalThis
.
abilityContext
=
this
.
context
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/
pages/index/index
"
,
null
)
}
}
onWindowStageDestroy
()
{
onWindowStageDestroy
()
{
...
...
barrierfree/accessibilityextensioncontext/entry/src/main/ets/pages/index/index.ets
→
barrierfree/accessibilityextensioncontext/entry/src/main/ets/
MainAbility/
pages/index/index.ets
浏览文件 @
2d89fafd
...
@@ -14,8 +14,6 @@
...
@@ -14,8 +14,6 @@
*/
*/
import file from '@system.file';
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
import testsuite from "../../test/List.test"
@Entry
@Entry
@Component
@Component
...
@@ -24,22 +22,6 @@ struct Index {
...
@@ -24,22 +22,6 @@ struct Index {
aboutToAppear(){
aboutToAppear(){
console.info("start run testcase!!!!");
console.info("start run testcase!!!!");
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters));
globalThis.abilityWant.parameters.timeout = 70000;
configService.setConfig(globalThis.abilityWant.parameters);
testsuite(globalThis.abilityContext);
core.execute();
}
}
build() {
build() {
...
...
barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
2d89fafd
/*
* 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.application.Ability
'
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
TestAbility onCreate
'
)
}
onDestroy
()
{
console
.
log
(
'
TestAbility onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
loadContent
(
"
TestAbility/pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
globalThis
.
abilityContext
=
this
.
context
;
}
onWindowStageDestroy
()
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
log
(
'
TestAbility onForeground
'
)
}
onBackground
()
{
console
.
log
(
'
TestAbility onBackground
'
)
}
};
\ No newline at end of file
barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
2d89fafd
/*
* 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 '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
2d89fafd
/*
* 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
barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/AccessibilityExtensionContext.test.ets
浏览文件 @
2d89fafd
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
'deccjsunit/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
"@ohos/hypium"
import commonEvent from '@ohos.commonEvent'
import commonEvent from '@ohos.commonEvent'
const passStr = 'pass';
const passStr = 'pass';
...
@@ -28,7 +28,7 @@ function publishCaseExecute(caseName: string) {
...
@@ -28,7 +28,7 @@ function publishCaseExecute(caseName: string) {
});
});
}
}
export default function abilityTest(
abilityContext
) {
export default function abilityTest() {
describe('AccessibilityExtensionContextTest', function () {
describe('AccessibilityExtensionContextTest', function () {
let subScriber = undefined;
let subScriber = undefined;
let isConnect = false;
let isConnect = false;
...
@@ -48,7 +48,7 @@ export default function abilityTest(abilityContext) {
...
@@ -48,7 +48,7 @@ export default function abilityTest(abilityContext) {
}
}
});
});
await abilityContext.startAbility({
await
globalThis.
abilityContext.startAbility({
deviceId: '',
deviceId: '',
bundleName: 'com.example.acetest',
bundleName: 'com.example.acetest',
abilityName: 'MainAbility',
abilityName: 'MainAbility',
...
...
barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/List.test.ets
浏览文件 @
2d89fafd
...
@@ -14,6 +14,6 @@
...
@@ -14,6 +14,6 @@
*/
*/
import abilityTest from './AccessibilityExtensionContext.test.ets'
import abilityTest from './AccessibilityExtensionContext.test.ets'
export default function testsuite(
abilityContext
) {
export default function testsuite() {
abilityTest(
abilityContext
)
abilityTest()
}
}
\ No newline at end of file
barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
2d89fafd
{
{
"src"
:
[
"src"
:
[
"pages/index/index"
"
MainAbility/
pages/index/index"
]
]
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录