Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
bd6c33f8
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,发现更多精彩内容 >>
未验证
提交
bd6c33f8
编写于
3月 16, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2501 XTS支持stage模型的测试套下库
Merge pull request !2501 from chengxingzhen/master
上级
729e24e0
7776c3c3
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
0 addition
and
1011 deletion
+0
-1011
aafwk/aafwk_standard/BUILD.gn
aafwk/aafwk_standard/BUILD.gn
+0
-1
aafwk/aafwk_standard/stage/BUILD.gn
aafwk/aafwk_standard/stage/BUILD.gn
+0
-24
aafwk/aafwk_standard/stage/actsamscontexttest/AppScope/app.json
...aafwk_standard/stage/actsamscontexttest/AppScope/app.json
+0
-21
aafwk/aafwk_standard/stage/actsamscontexttest/AppScope/resources/base/element/string.json
...mscontexttest/AppScope/resources/base/element/string.json
+0
-8
aafwk/aafwk_standard/stage/actsamscontexttest/AppScope/resources/base/media/app_icon.png
...amscontexttest/AppScope/resources/base/media/app_icon.png
+0
-0
aafwk/aafwk_standard/stage/actsamscontexttest/BUILD.gn
aafwk/aafwk_standard/stage/actsamscontexttest/BUILD.gn
+0
-40
aafwk/aafwk_standard/stage/actsamscontexttest/Test.json
aafwk/aafwk_standard/stage/actsamscontexttest/Test.json
+0
-18
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/ets/Application/AbilityStage.ts
...ontexttest/entry/src/main/ets/Application/AbilityStage.ts
+0
-9
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/ets/MainAbility/MainAbility.ts
...contexttest/entry/src/main/ets/MainAbility/MainAbility.ts
+0
-36
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/ets/pages/index/index.ets
...tsamscontexttest/entry/src/main/ets/pages/index/index.ets
+0
-66
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/ets/pages/second/second.ets
...amscontexttest/entry/src/main/ets/pages/second/second.ets
+0
-43
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/ets/test/Ability.test.ets
...tsamscontexttest/entry/src/main/ets/test/Ability.test.ets
+0
-111
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/ets/test/List.test.ets
.../actsamscontexttest/entry/src/main/ets/test/List.test.ets
+0
-22
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/module.json
...ndard/stage/actsamscontexttest/entry/src/main/module.json
+0
-38
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/resources/base/element/string.json
...exttest/entry/src/main/resources/base/element/string.json
+0
-32
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/resources/base/media/icon.png
...scontexttest/entry/src/main/resources/base/media/icon.png
+0
-0
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+0
-6
aafwk/aafwk_standard/stage/actsamscontexttest/signature/openharmony_sx.p7b
...ard/stage/actsamscontexttest/signature/openharmony_sx.p7b
+0
-0
aafwk/aafwk_standard/stage/stageenvchangetest/BUILD.gn
aafwk/aafwk_standard/stage/stageenvchangetest/BUILD.gn
+0
-32
aafwk/aafwk_standard/stage/stageenvchangetest/Test.json
aafwk/aafwk_standard/stage/stageenvchangetest/Test.json
+0
-18
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/config.json
...ndard/stage/stageenvchangetest/entry/src/main/config.json
+0
-97
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/AbilityStage.ts
...age/stageenvchangetest/entry/src/main/ets/AbilityStage.ts
+0
-23
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/MainAbility.ts
...vchangetest/entry/src/main/ets/MainAbility/MainAbility.ts
+0
-49
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/app.ets
...stageenvchangetest/entry/src/main/ets/MainAbility/app.ets
+0
-22
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/pages/index.ets
...changetest/entry/src/main/ets/MainAbility/pages/index.ets
+0
-63
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/pages/second.ets
...hangetest/entry/src/main/ets/MainAbility/pages/second.ets
+0
-43
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/test/List.test.ets
.../stageenvchangetest/entry/src/main/ets/test/List.test.ets
+0
-22
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/test/MissionManager_test.ets
...hangetest/entry/src/main/ets/test/MissionManager_test.ets
+0
-155
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/resources/base/element/string.json
...ngetest/entry/src/main/resources/base/element/string.json
+0
-12
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/resources/base/media/icon.png
...nvchangetest/entry/src/main/resources/base/media/icon.png
+0
-0
aafwk/aafwk_standard/stage/stageenvchangetest/signature/openharmony_sx.p7b
...ard/stage/stageenvchangetest/signature/openharmony_sx.p7b
+0
-0
未找到文件。
aafwk/aafwk_standard/BUILD.gn
浏览文件 @
bd6c33f8
...
...
@@ -59,7 +59,6 @@ group("aafwk_standard") {
"serviceability/stserviceabilityserver:amsStServiceAilityServer",
"serviceability/stserviceabilityserversecond:ActsAmsStServiceAilityServerSecondTest",
"setshowonlockscreen:setshowonlockscreen",
"stage:stage",
"want:want",
]
}
...
...
aafwk/aafwk_standard/stage/BUILD.gn
已删除
100644 → 0
浏览文件 @
729e24e0
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
group("stage") {
testonly = true
if (is_standard_system) {
deps = [
"actsamscontexttest:ActsAmsContextTest",
"stageenvchangetest:StageEnvchangeTest",
]
}
}
aafwk/aafwk_standard/stage/actsamscontexttest/AppScope/app.json
已删除
100644 → 0
浏览文件 @
729e24e0
{
"app"
:{
"bundleName"
:
"ohos.acts.aafwk.pldtest.myapplication"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
8
,
"targetAPIVersion"
:
8
,
"car"
:{
"apiCompatibleVersion"
:
8
,
"singleUser"
:
false
}
}
}
aafwk/aafwk_standard/stage/actsamscontexttest/AppScope/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
729e24e0
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
aafwk/aafwk_standard/stage/actsamscontexttest/AppScope/resources/base/media/app_icon.png
已删除
100644 → 0
浏览文件 @
729e24e0
15.1 KB
aafwk/aafwk_standard/stage/actsamscontexttest/BUILD.gn
已删除
100644 → 0
浏览文件 @
729e24e0
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAmsContextTest") {
hap_profile = "entry/src/main/module.json"
deps = [
":actsamscontexttest_js_assets",
":actsamscontexttest_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAmsContextTest"
}
ohos_app_scope("actsamscontexttest_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("actsamscontexttest_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("actsamscontexttest_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":actsamscontexttest_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
aafwk/aafwk_standard/stage/actsamscontexttest/Test.json
已删除
100644 → 0
浏览文件 @
729e24e0
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"180000"
,
"package"
:
"ohos.acts.aafwk.pldtest.myapplication"
,
"shell-timeout"
:
"600000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAmsContextTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/ets/Application/AbilityStage.ts
已删除
100644 → 0
浏览文件 @
729e24e0
import
AbilityStage
from
"
@ohos.application.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/ets/MainAbility/MainAbility.ts
已删除
100644 → 0
浏览文件 @
729e24e0
import
Ability
from
'
@ohos.application.Ability
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
}
onWindowStageDestroy
()
{
//Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
\ No newline at end of file
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/ets/pages/index/index.ets
已删除
100644 → 0
浏览文件 @
729e24e0
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"
import testsuite from "../../test/List.test.ets"
@Entry
@Component
struct Index {
aboutToAppear(){
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() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/ets/pages/second/second.ets
已删除
100644 → 0
浏览文件 @
729e24e0
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/ets/test/Ability.test.ets
已删除
100644 → 0
浏览文件 @
729e24e0
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"
export default function abilityTest(abilityContext) {
describe('ActsAbilityTest', function() {
/**
* @tc.number: SUB_AA_OpenHarmony_Context_0900
* @tc.name: Verify that the AbilityContext gets the resourceManger object available
* @tc.desc: Obtain the resourceManger object through ability, call the getString method, pass in the
* labelId of the corresponding hap package, and check whether it is the same as the configuration
* in the config.json file
*/
it('SUB_AA_OpenHarmony_Context_0900', 0, async function (done) {
console.log("SUB_AA_OpenHarmony_Context_0900 --- start");
var result = await abilityContext.resourceManager.getString(16777218);
console.log("SUB_AA_OpenHarmony_Context_0900 : result = " + JSON.stringify(result));
setTimeout(function() {
expect(JSON.stringify(result)).assertEqual("entry_MainAbility");
}, 5000);
done();
});
/**
* @tc.number: SUB_AA_OpenHarmony_Context_1000
* @tc.name: Verify that the AbilityStageContext gets the resourceManger object available
* @tc.desc: First obtain the resourceManger object through AbilityStage, then call the getString method,
* pass in the labelId of the corresponding hap package, and check whether it is the same as the
* configuration in the config.json file
*/
it('SUB_AA_OpenHarmony_Context_1000', 0, async function (done) {
console.log("SUB_AA_OpenHarmony_Context_1000 --- start");
var result = await globalThis.stageContext.resourceManager.getString(16777218);
console.log("SUB_AA_OpenHarmony_Context_1000 : result = " + JSON.stringify(result));
setTimeout(function() {
expect(JSON.stringify(result)).assertEqual("entry_MainAbility");
}, 5000);
done();
});
/**
* @tc.number: SUB_AA_OpenHarmony_Context_1100
* @tc.name: Verify that the resourceManger object obtained by AbilityStageContext to obtain
* applicationContext is available
* @tc.desc: First call the getApplication() method through AbilityStage to obtain the ApplicationContext,
* then obtain the resourceManger object through the ApplicationContext, then call the getString
* method, pass in the labelId of the corresponding hap package, and check whether it is the same
* as the configuration in the config.json file
*/
it('SUB_AA_OpenHarmony_Context_1100', 0, async function (done) {
console.log("SUB_AA_OpenHarmony_Context_1100 --- start");
var result = await globalThis.stageContext.getApplicationContext().resourceManager.getString(16777218);
console.log("SUB_AA_OpenHarmony_Context_1100 : result = " + JSON.stringify(result));
setTimeout(function() {
expect(JSON.stringify(result)).assertEqual("entry_MainAbility");
}, 5000);
done();
});
/**
* @tc.number: SUB_AA_OpenHarmony_Context_1300
* @tc.name: Verify that AbilityContext calls createBundleContext to create the specified context,
* passing in the wrong package name
* @tc.desc: When the createBundleContext method is called through the context of ability, an incorrect
* package name is passed in, and the returned information is checked.
*/
it('SUB_AA_OpenHarmony_Context_1300', 0, async function (done) {
console.log("SUB_AA_OpenHarmony_Context_1300 --- start");
var result = abilityContext.createBundleContext("com.app.os");
console.log("SUB_AA_OpenHarmony_Context_1300 : type = " + typeof(result));
setTimeout(function() {
expect(typeof(result) == "undefined").assertTrue();
}, 5000);
done();
});
/**
* @tc.number: SUB_AA_OpenHarmony_Context_1400
* @tc.name: Verify that AbilityContext calls createBundleContext to create the specified
* context and passes in your own package name
* @tc.desc: Call the createBundleContext method through the context of ability, pass in the package name
* of the hap package, then obtain the resourceManager object and call the getString method, pass
* in the corresponding labelId, and check whether the obtained resource is the same as the label
* resource in config.json
*/
it('SUB_AA_OpenHarmony_Context_1400', 0, async function (done) {
console.log("SUB_AA_OpenHarmony_Context_1400 --- start");
var bundleContext = abilityContext.createBundleContext("ohos.acts.aafwk.pldtest.myapplication");
var result = await bundleContext.resourceManager.getString(16777218);
console.log("SUB_AA_OpenHarmony_Context_1400 : result = " + JSON.stringify(result));
setTimeout(function() {
expect(JSON.stringify(result)).assertEqual("entry_MainAbility");
}, 5000);
done();
});
})
}
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/ets/test/List.test.ets
已删除
100644 → 0
浏览文件 @
729e24e0
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import abilityTest from './Ability.test.ets'
export default function testsuite(context) {
abilityTest(context)
}
\ No newline at end of file
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/module.json
已删除
100644 → 0
浏览文件 @
729e24e0
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[
{
"name"
:
"ohos.acts.aafwk.pldtest.myapplication.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:[
"entity.system.home"
]
}
]
}
]
}
}
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
729e24e0
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/resources/base/media/icon.png
已删除
100644 → 0
浏览文件 @
729e24e0
15.1 KB
aafwk/aafwk_standard/stage/actsamscontexttest/entry/src/main/resources/base/profile/main_pages.json
已删除
100644 → 0
浏览文件 @
729e24e0
{
"src"
:
[
"pages/index/index"
,
"pages/second/second"
]
}
\ No newline at end of file
aafwk/aafwk_standard/stage/actsamscontexttest/signature/openharmony_sx.p7b
已删除
100644 → 0
浏览文件 @
729e24e0
文件已删除
aafwk/aafwk_standard/stage/stageenvchangetest/BUILD.gn
已删除
100644 → 0
浏览文件 @
729e24e0
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("StageEnvchangeTest") {
hap_profile = "entry/src/main/config.json"
deps = [
":stageenvchangetest_js_assets",
":stageenvchangetest_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "StageEnvchangeTest"
}
ohos_js_assets("stageenvchangetest_js_assets") {
source_dir = "entry/src/main/ets/MainAbility"
}
ohos_resources("stageenvchangetest_resources") {
sources = [ "entry/src/main/resources" ]
hap_profile = "entry/src/main/config.json"
}
aafwk/aafwk_standard/stage/stageenvchangetest/Test.json
已删除
100644 → 0
浏览文件 @
729e24e0
{
"description"
:
"Configuration for Ability Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"600000"
,
"package"
:
"com.example.etsmyapplication"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"StageAbilityTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/config.json
已删除
100644 → 0
浏览文件 @
729e24e0
{
"app"
:
{
"bundleName"
:
"com.example.missionmanager"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.missionmanager"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"MainAbility"
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:description_mainability"
,
"formsEnabled"
:
false
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
,
"pages/second"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO"
,
"reason"
:
"need use ohos.permission.INSTALL_BUNDLE"
},
{
"name"
:
"ohos.permission.MANAGE_MISSIONS"
},
{
"name"
:
"ohos.permission.INSTALL_BUNDLE"
,
"reason"
:
"need use ohos.permission.INSTALL_BUNDLE"
},
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
,
"reason"
:
"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name"
:
"ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
,
"reason"
:
"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name"
:
"ohos.permission.REMOVE_CACHE_FILES"
,
"reason"
:
"need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name"
:
"ohos.permission.LISTEN_BUNDLE_CHANGE"
,
"reason"
:
"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
}
]
}
}
\ No newline at end of file
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/AbilityStage.ts
已删除
100644 → 0
浏览文件 @
729e24e0
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityStage
from
"
@ohos.application.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
\ No newline at end of file
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/MainAbility.ts
已删除
100644 → 0
浏览文件 @
729e24e0
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
Ability
from
'
@ohos.application.Ability
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
// Ability is creating, initialize resources for this ability
console
.
log
(
"
MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityContext
=
this
.
context
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
MainAbility onWindowStageCreate
"
)
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index
"
,
null
)
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
log
(
"
MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
MainAbility onBackground
"
)
}
};
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/app.ets
已删除
100644 → 0
浏览文件 @
729e24e0
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/pages/index.ets
已删除
100644 → 0
浏览文件 @
729e24e0
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"
import testsuite from "../../test/List.test.ets"
@Entry
@Component
struct Index {
aboutToAppear() {
console.log("start run testcase!!!!1");
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.log('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters));
// configService.setConfig(globalThis.abilityWant.parameters);
testsuite(globalThis.abilityContext);
core.execute();
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World 111')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/pages/second.ets
已删除
100644 → 0
浏览文件 @
729e24e0
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/test/List.test.ets
已删除
100644 → 0
浏览文件 @
729e24e0
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permisrsions and
* limitations under the License.
*/
import missionManagerTest from './MissionManager_test.ets'
export default function testsuite(context) {
missionManagerTest(context)
}
\ No newline at end of file
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/test/MissionManager_test.ets
已删除
100644 → 0
浏览文件 @
729e24e0
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"
import missionManager from "@ohos.application.missionManager"
import AbilityConstant from '@ohos.application.AbilityConstant'
export default function missionManagerTest(abilityContext) {
describe('missionManagerTest', function () {
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6200
* @tc.name Verify the enumeration values abilityContext.config.language
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_EnvChange_0100", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_EnvChange_0100-------------------");
console.info("SUB_AA_OpenHarmony_EnvChange_0100 abilityContext.config.language:" + abilityContext.config.language);
expect(abilityContext.config.language=="zh-Hans").assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6200
* @tc.name Call direction to get the direction
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_EnvChange_0200", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_EnvChange_0200-------------------");
console.info("SUB_AA_OpenHarmony_EnvChange_0200 abilityContext.config.direction:" + abilityContext.config.direction);
expect(abilityContext.config.direction==0).assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6200
* @tc.name Call direction to get the screenDensity
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_EnvChange_0300", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_EnvChange_0300-------------------");
console.info("SUB_AA_OpenHarmony_EnvChange_0300 abilityContext.config.screenDensity:" + abilityContext.config.screenDensity);
expect(abilityContext.config.screenDensity==160).assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_EnvChange_0400
* @tc.name Call direction to get the displayId
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_EnvChange_0400", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_EnvChange_0400-------------------");
console.info("SUB_AA_OpenHarmony_EnvChange_0400 abilityContext.config.displayId:" + abilityContext.config.displayId);
expect(abilityContext.config.displayId==0).assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6200
* @tc.name Verify the enumeration values LaunchReason. CONTINUATION
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_AbilityStart_6200", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6300-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6200 LaunchReason.CONTINUATION: " + AbilityConstant.LaunchReason.CONTINUATION);
expect(AbilityConstant.LaunchReason.CONTINUATION==3).assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6300
* @tc.name Verify the enumeration value launchreason.start UNKNOWN
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_AbilityStart_6300", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6300-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6300 LaunchReason.UNKNOWN: " + AbilityConstant.LaunchReason.UNKNOWN);
expect(AbilityConstant.LaunchReason.UNKNOWN==0).assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6400
* @tc.name Verify the enumeration value launchreason.START_ABILITY
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_AbilityStart_6400", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6400-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6400 LaunchReason.START_ABILITY: " + AbilityConstant.LaunchReason.START_ABILITY);
expect(AbilityConstant.LaunchReason.START_ABILITY==1).assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6500
* @tc.name Verify the enumeration values LaunchReason. CALL
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_AbilityStart_6500", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6500-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6500 LaunchReason.CALL: " + AbilityConstant.LaunchReason.CALL);
expect(AbilityConstant.LaunchReason.CALL==2).assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6600
* @tc.name Verify the enumeration values LastExitReason.UNKNOWN
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_AbilityStart_6600", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6600-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6600 LastExitReason.UNKNOWN: " + AbilityConstant.LastExitReason.UNKNOWN);
expect(AbilityConstant.LastExitReason.UNKNOWN==0).assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6700
* @tc.name Verify the enumeration values LastExitReason.ABILITY_NOT_RESPONDING
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_AbilityStart_6700", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6700-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6700 LastExitReason.ABILITY_NOT_RESPONDING: " + AbilityConstant.LastExitReason.ABILITY_NOT_RESPONDING);
expect(AbilityConstant.LastExitReason.ABILITY_NOT_RESPONDING==1).assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6700
* @tc.name Verify the enumeration values LastExitReason.NORMAL
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_AbilityStart_6800", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6800-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6800 LastExitReason.NORMAL: " + AbilityConstant.LastExitReason.NORMAL);
expect(AbilityConstant.LastExitReason.NORMAL==2).assertTrue();
done();
});
})
}
\ No newline at end of file
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
729e24e0
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"entry_MainAbility"
},
{
"name"
:
"description_mainability"
,
"value"
:
"eTS_Empty Ability"
}
]
}
\ No newline at end of file
aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/resources/base/media/icon.png
已删除
100644 → 0
浏览文件 @
729e24e0
6.6 KB
aafwk/aafwk_standard/stage/stageenvchangetest/signature/openharmony_sx.p7b
已删除
100644 → 0
浏览文件 @
729e24e0
文件已删除
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录