Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6140afd8
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看板
提交
6140afd8
编写于
8月 24, 2022
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
元能力用例修改
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
3340388b
变更
25
隐藏空白更改
内联
并排
Showing
25 changed file
with
435 addition
and
65 deletion
+435
-65
ability/ability_runtime/actssupportfunction/BUILD.gn
ability/ability_runtime/actssupportfunction/BUILD.gn
+1
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/app.json
...ssupportfunction/actsonandoffscreentest/AppScope/app.json
+21
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/resources/base/element/string.json
...offscreentest/AppScope/resources/base/element/string.json
+8
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/resources/base/media/app_icon.png
...doffscreentest/AppScope/resources/base/media/app_icon.png
+0
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/BUILD.gn
...ntime/actssupportfunction/actsonandoffscreentest/BUILD.gn
+42
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/Test.json
...time/actssupportfunction/actsonandoffscreentest/Test.json
+23
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/Application/MyAbilityStage.ts
...reentest/entry/src/main/ets/Application/MyAbilityStage.ts
+22
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/MainAbility/MainAbility.ts
...fscreentest/entry/src/main/ets/MainAbility/MainAbility.ts
+63
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+73
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/pages/index.ets
...actsonandoffscreentest/entry/src/main/ets/pages/index.ets
+35
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/List.test.ets
...sonandoffscreentest/entry/src/main/ets/test/List.test.ets
+19
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
...ntest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
+4
-4
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json
...unction/actsonandoffscreentest/entry/src/main/module.json
+38
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/element/color.json
...reentest/entry/src/main/resources/base/element/color.json
+8
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/element/string.json
...eentest/entry/src/main/resources/base/element/string.json
+16
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/media/icon.png
...ffscreentest/entry/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+5
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/signature/openharmony_sx.p7b
...ction/actsonandoffscreentest/signature/openharmony_sx.p7b
+0
-0
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/Test.json
...ime/actssupportfunction/actssupportfunctiontest/Test.json
+1
-3
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaSetDisplayOrientation.test.ets
.../entry/src/main/ets/test/FaSetDisplayOrientation.test.ets
+46
-46
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets
...unctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets
+1
-1
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/List.test.ets
...supportfunctiontest/entry/src/main/ets/test/List.test.ets
+0
-2
ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts
...esulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts
+7
-7
ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
...ttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
+1
-1
ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/Ability.test.ets
...ityforresulttest/entry/src/main/ets/test/Ability.test.ets
+1
-1
未找到文件。
ability/ability_runtime/actssupportfunction/BUILD.gn
浏览文件 @
6140afd8
...
...
@@ -17,6 +17,7 @@ group("actssupportfunction") {
testonly = true
if (is_standard_system) {
deps = [
"actsonandoffscreentest:ActsOnAndOffScreenTest",
"actssupportfunctiontest:ActsSupportFunctionTest",
"faonandoffscreen:FaOnAndOffScreen",
"fasupportfunction:fasupportfunction",
...
...
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/app.json
0 → 100644
浏览文件 @
6140afd8
{
"app"
:
{
"bundleName"
:
"com.example.actsonandoffscreentest"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:app_name"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"car"
:
{
"apiCompatibleVersion"
:
9
,
"singleUser"
:
false
}
}
}
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
6140afd8
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"ActsOnAndOffScreenTest"
}
]
}
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
6140afd8
6.6 KB
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/BUILD.gn
0 → 100644
浏览文件 @
6140afd8
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsOnAndOffScreenTest") {
hap_profile = "entry/src/main/module.json"
deps = [
":actsonandoffscreentest_js_assets",
":actsonandoffscreentest_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsOnAndOffScreenTest"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("actsonandoffscreentest_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("actsonandoffscreentest_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("actsonandoffscreentest_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":actsonandoffscreentest_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/Test.json
0 → 100644
浏览文件 @
6140afd8
{
"description"
:
"Configuration for aceceshi Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"bundle-name"
:
"com.example.actsonandoffscreentest"
,
"module-name"
:
"entry"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
"30000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsOnAndOffScreenTest.hap"
,
"FaOnAndOffScreen.hap"
,
"StageOnAndOffScreen.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/Application/MyAbilityStage.ts
0 → 100644
浏览文件 @
6140afd8
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityStage
from
"
@ohos.application.AbilityStage
"
;
var
TAG0
=
'
ActsOnAndOffScreenTest:MyAbilityStage:
'
;
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
TAG0
+
"
onCreate
"
)
}
}
\ No newline at end of file
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
6140afd8
/*
* 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
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
;
import
{
Hypium
}
from
'
@ohos/hypium
'
;
import
testsuite
from
'
../test/List.test
'
;
var
TAG1
=
'
ActsOnAndOffScreenTest:MainAbility:
'
;
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
TAG1
+
'
onCreate
'
);
globalThis
.
abilityTestContext
=
this
.
context
;
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityWant
.
parameters
.
timeout
=
15000
;
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
log
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
onDestroy
()
{
console
.
log
(
TAG1
+
'
onDestroy
'
);
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
TAG1
+
'
onWindowStageCreate
'
);
windowStage
.
loadContent
(
"
pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
log
(
TAG1
+
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
log
(
TAG1
+
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
));
});
}
onWindowStageDestroy
()
{
console
.
log
(
TAG1
+
'
onWindowStageDestroy
'
);
}
onForeground
()
{
console
.
log
(
TAG1
+
'
onForeground
'
);
}
onBackground
()
{
console
.
log
(
TAG1
+
'
onBackground
'
);
}
};
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
6140afd8
/*
* 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
var
TAG
=
"
ActsOnAndOffScreenTest ==
"
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
(
TAG
+
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
log
(
TAG
+
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
log
(
TAG
+
"
OpenHarmonyTestRunner OnPrepare
"
)
}
async
onRun
()
{
console
.
log
(
TAG
+
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
globalThis
.
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
MainAbilityName
=
'
MainAbility
'
let
lMonitor
=
{
abilityName
:
MainAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
console
.
log
(
TAG
+
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
log
(
TAG
+
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
log
(
TAG
+
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
log
(
TAG
+
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
log
(
TAG
+
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/pages/index.ets
0 → 100644
浏览文件 @
6140afd8
/*
* 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.
*/
@Entry
@Component
struct Index {
aboutToAppear() {
console.log('ActsOnAndOffScreenTest MainAbility index aboutToAppear')
}
@State message: string = 'Hello World ActsOnAndOffScreenTest 1'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
6140afd8
/*
* 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 onAndOffScreenTest from './OnAndOffScreenTest.test';
export default function testsuite() {
onAndOffScreenTest();
}
\ No newline at end of file
ability/ability_runtime/actssupportfunction/acts
supportfunctio
ntest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
→
ability/ability_runtime/actssupportfunction/acts
onandoffscree
ntest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
浏览文件 @
6140afd8
...
...
@@ -30,8 +30,8 @@ export default function OnAndOffScreenTest() {
async
function
slideScreen
(
TAG
)
{
console
.
log
(
TAG
+
"slideScreen start"
);
var
driver
=
UiDriver
.
create
();
await
driver
.
swipe
(
100
,
100
,
500
,
5
00
);
driver
.
delayMs
(
500
);
await
driver
.
swipe
(
100
0
,
3000
,
1000
,
500
,
12
00
);
await
driver
.
delayMs
(
500
);
console
.
log
(
TAG
+
"slideScreen end"
);
}
...
...
@@ -70,9 +70,9 @@ export default function OnAndOffScreenTest() {
afterEach
(
async
(
done
)
=>
{
console
.
log
(
TAG1
+
"afterEach called"
);
let
cmd1
=
"aa force-stop ohos.acts.aafwk.test.faonandoffscreen"
;
await
executeShellCommand
(
cmd1
,
TAG
);
await
executeShellCommand
(
cmd1
,
TAG
1
);
let
cmd2
=
"aa force-stop ohos.acts.aafwk.test.stageonandoffscreen"
;
await
executeShellCommand
(
cmd2
,
TAG
);
await
executeShellCommand
(
cmd2
,
TAG
1
);
setTimeout
(()
=>
{
console
.
log
(
TAG1
+
"afterEach end"
);
...
...
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json
0 → 100644
浏览文件 @
6140afd8
{
"module"
:
{
"name"
:
"entry"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/MyAbilityStage.ts"
,
"description"
:
"$string:entry_desc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:main_pages"
,
"uiSyntax"
:
"ets"
,
"abilities"
:
[
{
"name"
:
"MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:MainAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:MainAbility_label"
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:white"
,
"visible"
:
true
,
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
6140afd8
{
"color"
:
[
{
"name"
:
"white"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
6140afd8
{
"string"
:
[
{
"name"
:
"entry_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"ActsOnAndOffScreenTest"
}
]
}
\ No newline at end of file
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
6140afd8
6.6 KB
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
6140afd8
{
"src"
:
[
"pages/index"
]
}
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
6140afd8
文件已添加
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/Test.json
浏览文件 @
6140afd8
...
...
@@ -15,9 +15,7 @@
"FaSupportFunction.hap"
,
"FaSupportFunctionTwo.hap"
,
"FaSupportFunctionThree.hap"
,
"StageSupportFunction.hap"
,
"FaOnAndOffScreen.hap"
,
"StageOnAndOffScreen.hap"
"StageSupportFunction.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
...
...
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaSetDisplayOrientation.test.ets
浏览文件 @
6140afd8
...
...
@@ -22,7 +22,7 @@ export default function FaSetDisplayOrientationTest() {
describe('FaSetDisplayOrientationTest', function () {
let TAG = "";
let TAG1 = "SUB_AA_OpenHarmony == ";
let TAG1 = "SUB_AA_OpenHarmony ==
FaSetDisplayOrientationTest :
";
let sleepTimeOne = 1000;
let sleepTimeTwo = 2000;
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...
...
@@ -67,12 +67,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0
2
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0
5
00
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Set the horizontal and vertical screen status of ability to UNSPECIFIED.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_0
2
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0
2
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_0
5
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0
5
00 == ';
console.log(TAG + "begin");
let displayOrientationBefore = undefined;
...
...
@@ -131,12 +131,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0
3
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0
6
00
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Set the horizontal and vertical screen status of ability to LANDSCAPE.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_0
3
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0
3
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_0
6
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0
6
00 == ';
console.log(TAG + "begin");
let displayOrientationBefore = undefined;
...
...
@@ -198,12 +198,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0
4
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0
7
00
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Set the horizontal and vertical screen status of ability to PORTRAIT.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_0
4
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0
4
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_0
7
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0
7
00 == ';
console.log(TAG + "begin");
let displayOrientationBefore = undefined;
...
...
@@ -265,13 +265,13 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0
5
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0
8
00
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : The same applies to setting ability1 to LANDSCAPE, and ability1 starts ability2 and sets the status
of ability2 to FOLLOW_RECENT.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_0
5
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0
5
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_0
8
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0
8
00 == ';
console.log(TAG + "begin");
let displayOrientationBefore1 = undefined;
...
...
@@ -349,13 +349,13 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0
6
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0
9
00
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : The same applies to setting ability1 to PORTRAIT, and ability1 starts ability2 and sets the status
of ability2 to FOLLOW_RECENT.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_0
6
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0
6
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_0
9
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0
9
00 == ';
console.log(TAG + "begin");
let displayOrientationBefore1 = undefined;
...
...
@@ -433,13 +433,13 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_
07
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_
10
00
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Different haps set ability1 to LANDSCAPE, and ability1 starts ability2 and sets the status of
ability2 to FOLLOW_RECENT.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_
07
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_
07
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_
10
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_
10
00 == ';
console.log(TAG + "begin");
let displayOrientationBefore1 = undefined;
...
...
@@ -517,13 +517,13 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_
08
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_
11
00
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Different haps set ability1 to PORTRAIT, and ability1 starts ability2 and sets the status of
ability2 to FOLLOW_RECENT.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_
08
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_
08
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_
11
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_
11
00 == ';
console.log(TAG + "begin");
let displayOrientationBefore1 = undefined;
...
...
@@ -601,13 +601,13 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_
09
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_
12
00
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Different applications set ability1 to LANDSCAPE, and ability1 starts ability2 and sets the status
of ability2 to FOLLOW_RECENT.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_
09
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_
09
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_
12
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_
12
00 == ';
console.log(TAG + "begin");
let displayOrientationBefore1 = undefined;
...
...
@@ -685,13 +685,13 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
0
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
3
00
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Different applications set ability1 to PORTRAIT, and ability1 starts ability2 and sets the status
of ability2 to FOLLOW_RECENT.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_1
0
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
0
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_1
3
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
3
00 == ';
console.log(TAG + "begin");
let displayOrientationBefore1 = undefined;
...
...
@@ -773,12 +773,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
1
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
4
00
* @tc.name : Verify setDisplayOrientation interfaces
* @tc.desc : SetDisplayOrientation input parameter is undefined.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_1
1
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
1
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_1
4
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
4
00 == ';
console.log(TAG + "begin");
let status1 = undefined;
...
...
@@ -837,12 +837,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
2
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
5
00
* @tc.name : Verify setDisplayOrientation interfaces
* @tc.desc : SetDisplayOrientation input parameter is -1.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_1
2
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
2
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_1
5
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
5
00 == ';
console.log(TAG + "begin");
let status1 = undefined;
...
...
@@ -901,12 +901,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
3
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
6
00
* @tc.name : Verify setDisplayOrientation interfaces
* @tc.desc : SetDisplayOrientation input parameter is a nonexistent enumeration value.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_1
3
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
3
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_1
6
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
6
00 == ';
console.log(TAG + "begin");
let status1 = undefined;
...
...
@@ -965,12 +965,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
4
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
7
00
* @tc.name : Verify setDisplayOrientation interfaces
* @tc.desc : SetDisplayOrientation input parameter is a value of string type.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_1
4
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
4
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_1
7
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
7
00 == ';
console.log(TAG + "begin");
let status1 = undefined;
...
...
@@ -1029,12 +1029,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
5
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
8
00
* @tc.name : Verify setDisplayOrientation interfaces
* @tc.desc : SetDisplayOrientation input parameter is of type array.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_1
5
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
5
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_1
8
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
8
00 == ';
console.log(TAG + "begin");
let status1 = undefined;
...
...
@@ -1093,12 +1093,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
6
00
* @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1
9
00
* @tc.name : Verify setDisplayOrientation interfaces
* @tc.desc : SetDisplayOrientation input parameter is of type json.
*/
it('SUB_AA_OpenHarmony_DisplayOrientation_1
6
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
6
00 == ';
it('SUB_AA_OpenHarmony_DisplayOrientation_1
9
00', 0, async function (done) {
TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1
9
00 == ';
console.log(TAG + "begin");
let status1 = undefined;
...
...
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets
浏览文件 @
6140afd8
...
...
@@ -22,7 +22,7 @@ export default function FaShowOnLockTest() {
describe('FaShowOnLockTest', function () {
let TAG = "";
let TAG1 = "SUB_AA_OpenHarmony == ";
let TAG1 = "SUB_AA_OpenHarmony ==
FaShowOnLockTest :
";
let sleepTimeOne = 1000;
let sleepTimeTwo = 2000;
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...
...
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/List.test.ets
浏览文件 @
6140afd8
...
...
@@ -15,11 +15,9 @@
import abilityIsTerminatingTest from './AbilityIsTerminating.test';
import faSetDisplayOrientation from './FaSetDisplayOrientation.test';
import faShowOnLock from './FaShowOnLock.test';
import onAndOffScreenTest from './OnAndOffScreenTest.test';
export default function testsuite() {
abilityIsTerminatingTest();
faSetDisplayOrientation();
faShowOnLock();
onAndOffScreenTest();
}
\ No newline at end of file
ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts
浏览文件 @
6140afd8
...
...
@@ -16,12 +16,12 @@ import Ability from '@ohos.application.Ability'
import
commonEvent
from
'
@ohos.commonEvent
'
async
function
onShowProcess
()
{
var
abilityWant
=
globalThis
.
abilityWant
;
var
abilityWant
=
globalThis
.
abilityWant
2
;
var
commonEventPublishData
=
{
parameters
:
{
displayId
:
globalThis
.
abilityWant
.
parameters
[
'
ohos.aafwk.param.displayId
'
],
windowMode
:
globalThis
.
abilityWant
.
parameters
[
'
ohos.aafwk.param.windowMode
'
],
displayId
:
abilityWant
.
parameters
[
'
ohos.aafwk.param.displayId
'
],
windowMode
:
abilityWant
.
parameters
[
'
ohos.aafwk.param.windowMode
'
],
}
};
...
...
@@ -29,7 +29,7 @@ async function onShowProcess() {
commonEvent
.
publish
(
"
ACTS_TerminateSelf_CommonEvent
"
,
commonEventPublishData
,
()
=>
{
console
.
log
(
'
============>querytestsecond success==========>>
'
)
globalThis
.
abilityContext
.
terminateSelf
();
globalThis
.
abilityContext
2
.
terminateSelf
();
});
}
...
...
@@ -38,8 +38,8 @@ export default class MainAbility extends Ability {
onCreate
(
want
,
launchParam
)
{
// Ability is creating, initialize resources for this ability
console
.
log
(
"
MainAbility2 onCreate
"
)
globalThis
.
abilityWant
=
want
;
console
.
log
(
"
AbilityMultiInstanceAppA abilityWant =
"
+
JSON
.
stringify
(
globalThis
.
abilityWant
));
globalThis
.
abilityWant
2
=
want
;
console
.
log
(
"
AbilityMultiInstanceAppA abilityWant =
"
+
JSON
.
stringify
(
globalThis
.
abilityWant
2
));
}
onDestroy
()
{
...
...
@@ -50,7 +50,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
MainAbility2 onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
globalThis
.
abilityContext
2
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/second/second
"
,
null
)
}
...
...
ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
浏览文件 @
6140afd8
...
...
@@ -38,7 +38,7 @@ export default class ServiceAbility extends ServiceExtension {
abilityName
:
'
com.example.startabilityforresult.MainAbility2
'
},
{
windowMode
:
2
,
windowMode
:
0
,
displayId
:
10
,
}).
then
(()
=>
{
console
.
log
(
"
====>end startAbility====>success!
"
)
...
...
ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
6140afd8
...
...
@@ -225,7 +225,7 @@ export default function abilityTest() {
if
(
data
.
event
==
"ACTS_TerminateSelf_CommonEvent"
)
{
clearTimeout
(
id
);
expect
(
data
.
parameters
[
'displayId'
])
.
assertEqual
(
10
);
expect
(
data
.
parameters
[
'windowMode'
])
.
assertEqual
(
2
);
expect
(
data
.
parameters
[
'windowMode'
])
.
assertEqual
(
0
);
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
)
expect
(
data
.
event
)
.
assertEqual
(
"ACTS_TerminateSelf_CommonEvent"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录