Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
1d123860
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看板
提交
1d123860
编写于
9月 08, 2022
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
元能力用例优化
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
5c3e32cc
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
367 addition
and
40 deletion
+367
-40
ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts
...nstancetest/entry/src/main/ets/MainAbility/MainAbility.ts
+12
-1
ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index/index.ets
...ultiinstancetest/entry/src/main/ets/pages/index/index.ets
+0
-9
ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets
...ultiinstancetest/entry/src/main/ets/test/Ability.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
+25
-1
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json
...unction/actsonandoffscreentest/entry/src/main/module.json
+1
-0
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaSetDisplayOrientation.test.ets
.../entry/src/main/ets/test/FaSetDisplayOrientation.test.ets
+10
-0
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets
...unctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets
+25
-0
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/module.json
...nction/actssupportfunctiontest/entry/src/main/module.json
+1
-0
ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets
...sUsersSystemTest/entry/src/main/ets/test/Ability.test.ets
+26
-0
ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
...ytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
+17
-1
ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
...itytest/entry/src/main/js/test/StartAbilityJsunit.test.js
+18
-0
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets
...quiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets
+12
-0
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/test/FmsAcquireForm2.test.ets
...iretest2/entry/src/main/ets/test/FmsAcquireForm2.test.ets
+12
-0
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/test/FmsDeleteForm.test.ets
...deletetest/entry/src/main/ets/test/FmsDeleteForm.test.ets
+26
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/test/FmsDynamicRefreshForm.test.ets
...st/entry/src/main/ets/test/FmsDynamicRefreshForm.test.ets
+12
-0
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/test/FmsReleaseForm.test.ets
...leasetest/entry/src/main/ets/test/FmsReleaseForm.test.ets
+12
-0
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/test/FmsFormStateDisable.test.ets
...able/entry/src/main/ets/test/FmsFormStateDisable.test.ets
+23
-2
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/test/FmsFormStateEnable.test.ets
...nable/entry/src/main/ets/test/FmsFormStateEnable.test.ets
+23
-2
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/test/FmsFormStateNotifyInvisible.test.ets
...ry/src/main/ets/test/FmsFormStateNotifyInvisible.test.ets
+12
-0
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/test/FmsFormStateNotifyInvisible2.test.ets
...y/src/main/ets/test/FmsFormStateNotifyInvisible2.test.ets
+12
-0
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/test/FmsFormStateNotifyVisible.test.ets
...ntry/src/main/ets/test/FmsFormStateNotifyVisible.test.ets
+12
-0
ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/MainAbility.ts
...AccountTest/entry/src/main/ets/MainAbility/MainAbility.ts
+12
-1
ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/pages/index/index.ets
...Test/entry/src/main/ets/MainAbility/pages/index/index.ets
+0
-10
ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/Ability.test.ets
...sWithAccountTest/entry/src/main/ets/test/Ability.test.ets
+16
-0
ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/module.json
...ActsKillProcessWithAccountTest/entry/src/main/module.json
+1
-0
ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts
...nstancetest/entry/src/main/ets/MainAbility/MainAbility.ts
+13
-1
ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/pages/index/index.ets
...test/entry/src/main/ets/MainAbility/pages/index/index.ets
+0
-10
ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/Ability.test.ets
...ultiinstancetest/entry/src/main/ets/test/Ability.test.ets
+14
-1
ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/module.json
...ctsamsprocessmultiinstancetest/entry/src/main/module.json
+1
-0
未找到文件。
ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
1d123860
...
@@ -13,12 +13,23 @@
...
@@ -13,12 +13,23 @@
* limitations under the License.
* 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
(
"
AbilityMultiInstanceTest onCreate
"
)
console
.
log
(
"
AbilityMultiInstanceTest onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityContext
=
this
.
context
let
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
let
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
}
onDestroy
()
{
onDestroy
()
{
...
@@ -29,7 +40,7 @@ export default class MainAbility extends Ability {
...
@@ -29,7 +40,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate
(
windowStage
)
{
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
// Main window is created, set main page for this ability
console
.
log
(
"
AbilityMultiInstanceTest onWindowStageCreate
"
)
console
.
log
(
"
AbilityMultiInstanceTest onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
console
.
log
(
"
AbilityMultiInstanceTest onWindowStageCreate finish
"
)
console
.
log
(
"
AbilityMultiInstanceTest onWindowStageCreate finish
"
)
}
}
...
...
ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index/index.ets
浏览文件 @
1d123860
...
@@ -13,20 +13,11 @@
...
@@ -13,20 +13,11 @@
* limitations under the License.
* limitations under the License.
*/
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../test/List.test'
@Entry
@Entry
@Component
@Component
struct Index {
struct Index {
aboutToAppear(){
aboutToAppear(){
let abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
let abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
}
build() {
build() {
...
...
ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
1d123860
...
@@ -91,6 +91,25 @@ async function startAbilityProcess(abilityContext, parameters) {
...
@@ -91,6 +91,25 @@ async function startAbilityProcess(abilityContext, parameters) {
export
default
function
abilityTest
(
abilityContext
)
{
export
default
function
abilityTest
(
abilityContext
)
{
describe
(
'ActsAbilityTest'
,
function
()
{
describe
(
'ActsAbilityTest'
,
function
()
{
let
TAG1
=
"ACTS_AbilityMultiInstance_Single == "
;
afterEach
(
async
(
done
)
=>
{
console
.
log
(
TAG1
+
"afterEach called"
);
let
wantInfo
=
{
bundleName
:
"com.example.abilitymultiinstance"
,
abilityName
:
"com.example.abilitymultiinstance.MainAbility"
}
await
abilityContext
.
startAbility
(
wantInfo
)
.
then
((
data
)
=>
{
console
.
log
(
TAG1
+
"startAbility data : "
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
console
.
log
(
TAG1
+
"startAbility err : "
+
JSON
.
stringify
(
err
));
})
setTimeout
(
function
()
{
console
.
log
(
TAG1
+
"afterEach end"
);
done
();
},
500
);
})
/*
/*
* @tc.number: ACTS_AbilityMultiInstance_Multi_0100
* @tc.number: ACTS_AbilityMultiInstance_Multi_0100
* @tc.name: Connects a service ability, which is used to start a cloned page ability.
* @tc.name: Connects a service ability, which is used to start a cloned page ability.
...
...
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
浏览文件 @
1d123860
...
@@ -17,15 +17,39 @@ import { BY,UiDriver,UiComponent } from '@ohos.uitest';
...
@@ -17,15 +17,39 @@ import { BY,UiDriver,UiComponent } from '@ohos.uitest';
import
commonEvent
from
'@ohos.commonEvent'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
AbilityDelegatorRegistry
from
'@ohos.application.abilityDelegatorRegistry'
;
import
AbilityDelegatorRegistry
from
'@ohos.application.abilityDelegatorRegistry'
;
import
power
from
'@ohos.power'
;
import
power
from
'@ohos.power'
;
import
backgroundTaskManager
from
'@ohos.backgroundTaskManager'
;
export
default
function
OnAndOffScreenTest
()
{
export
default
function
OnAndOffScreenTest
()
{
describe
(
'OnAndOffScreenTest'
,
function
()
{
describe
(
'OnAndOffScreenTest'
,
function
()
{
let
TAG
=
""
;
let
TAG
=
""
;
let
TAG1
=
"SUB_AA_OpenHarmony == "
;
let
TAG1
=
"SUB_AA_OpenHarmony ==
OnAndOffScreenTest :
"
;
let
sleepTimeOne
=
1000
;
let
sleepTimeOne
=
1000
;
let
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
let
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
let
id
=
undefined
;
beforeAll
(
async
(
done
)
=>
{
console
.
log
(
TAG1
+
"beforeAll called"
);
let
myReason
=
'test FaShowOnLockTest'
;
let
delayInfo
=
backgroundTaskManager
.
requestSuspendDelay
(
myReason
,
()
=>
{
console
.
log
(
TAG1
+
"Request suspension delay will time out."
);
})
id
=
delayInfo
.
requestId
;
console
.
log
(
TAG1
+
"requestId is : "
+
id
);
setTimeout
(
function
()
{
console
.
log
(
TAG1
+
"beforeAll end"
);
done
();
},
sleepTimeOne
);
})
afterAll
(
async
(
done
)
=>
{
console
.
log
(
TAG1
+
"afterAll called"
);
backgroundTaskManager
.
cancelSuspendDelay
(
id
);
setTimeout
(
function
()
{
console
.
log
(
TAG1
+
"afterAll end"
);
done
();
},
sleepTimeOne
);
})
async
function
slideScreen
(
TAG
)
{
async
function
slideScreen
(
TAG
)
{
console
.
log
(
TAG
+
"slideScreen start"
);
console
.
log
(
TAG
+
"slideScreen start"
);
...
...
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json
浏览文件 @
1d123860
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
"startWindowIcon"
:
"$media:icon"
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:white"
,
"startWindowBackground"
:
"$color:white"
,
"visible"
:
true
,
"visible"
:
true
,
"launchType"
:
"singleton"
,
"skills"
:
[
"skills"
:
[
{
{
"entities"
:
[
"entities"
:
[
...
...
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaSetDisplayOrientation.test.ets
浏览文件 @
1d123860
...
@@ -29,6 +29,16 @@ export default function FaSetDisplayOrientationTest() {
...
@@ -29,6 +29,16 @@ export default function FaSetDisplayOrientationTest() {
afterEach(async (done) => {
afterEach(async (done) => {
console.log(TAG1 + "afterEach called");
console.log(TAG1 + "afterEach called");
let wantInfo = {
bundleName: "com.example.supportfunctionhaptest",
abilityName: "MainAbility"
}
await globalThis.abilityTestContext.startAbility(wantInfo).then((data) => {
console.log(TAG1 + "startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log(TAG1 + "startAbility err : " + JSON.stringify(err));
})
let cmd1 = "aa force-stop ohos.acts.aafwk.test.fasupportfunction";
let cmd1 = "aa force-stop ohos.acts.aafwk.test.fasupportfunction";
let cmd2 = "aa force-stop ohos.acts.aafwk.test.fasupportfunctionthree";
let cmd2 = "aa force-stop ohos.acts.aafwk.test.fasupportfunctionthree";
...
...
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets
浏览文件 @
1d123860
...
@@ -16,6 +16,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
...
@@ -16,6 +16,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import commonEvent from '@ohos.commonEvent';
import commonEvent from '@ohos.commonEvent';
import power from '@ohos.power';
import power from '@ohos.power';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default function FaShowOnLockTest() {
export default function FaShowOnLockTest() {
...
@@ -26,6 +27,30 @@ export default function FaShowOnLockTest() {
...
@@ -26,6 +27,30 @@ export default function FaShowOnLockTest() {
let sleepTimeOne = 1000;
let sleepTimeOne = 1000;
let sleepTimeTwo = 2000;
let sleepTimeTwo = 2000;
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
beforeEach(async (done) => {
beforeEach(async (done) => {
console.log(TAG1 + "beforeEach called");
console.log(TAG1 + "beforeEach called");
let status = undefined;
let status = undefined;
...
...
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/module.json
浏览文件 @
1d123860
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
"startWindowIcon"
:
"$media:icon"
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:white"
,
"startWindowBackground"
:
"$color:white"
,
"visible"
:
true
,
"visible"
:
true
,
"launchType"
:
"singleton"
,
"skills"
:
[
"skills"
:
[
{
{
"entities"
:
[
"entities"
:
[
...
...
ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
1d123860
...
@@ -16,6 +16,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
...
@@ -16,6 +16,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
import commonEvent from '@ohos.commonEvent'
import commonEvent from '@ohos.commonEvent'
import appManager from '@ohos.application.appManager'
import appManager from '@ohos.application.appManager'
import osaccount from '@ohos.account.osAccount'
import osaccount from '@ohos.account.osAccount'
import backgroundTaskManager from '@ohos.backgroundTaskManager';
var subscriberInfo_MainAbility = {
var subscriberInfo_MainAbility = {
events: ["ACTS_InterfaceMultiUsers_0100_Start_CommonEvent","ACTS_TerminateSelf_CommonEvent"]
events: ["ACTS_InterfaceMultiUsers_0100_Start_CommonEvent","ACTS_TerminateSelf_CommonEvent"]
...
@@ -39,6 +40,31 @@ export default function abilityTest() {
...
@@ -39,6 +40,31 @@ export default function abilityTest() {
// })
// })
// })
// })
// })
// })
let id = undefined;
beforeAll(async (done) => {
console.log("ACTS_InterfaceMultiUsers beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log("ACTS_InterfaceMultiUsers Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log("ACTS_InterfaceMultiUsers requestId is : " + id);
setTimeout(function () {
console.log("ACTS_InterfaceMultiUsers beforeAll end");
done();
}, 1000);
})
afterAll(async (done) => {
console.log("ACTS_InterfaceMultiUsers afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log("ACTS_InterfaceMultiUsers afterAll end");
done();
}, 1000);
})
console.debug("====>in ACTS_InterfaceMultiUsers====>");
console.debug("====>in ACTS_InterfaceMultiUsers====>");
/*
/*
* @tc.number : ACTS_startAbility_0100
* @tc.number : ACTS_startAbility_0100
...
...
ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
浏览文件 @
1d123860
...
@@ -84,7 +84,7 @@ describe('ActsFeatureAbilityTest', function () {
...
@@ -84,7 +84,7 @@ describe('ActsFeatureAbilityTest', function () {
console
.
info
(
'
beforeEach called
'
)
console
.
info
(
'
beforeEach called
'
)
})
})
afterEach
(
function
(
)
{
afterEach
(
async
function
(
done
)
{
/*
/*
* @tc.teardown: teardown invoked after each testcases
* @tc.teardown: teardown invoked after each testcases
...
@@ -94,6 +94,22 @@ describe('ActsFeatureAbilityTest', function () {
...
@@ -94,6 +94,22 @@ describe('ActsFeatureAbilityTest', function () {
setTimeout
(()
=>
{},
500
);
setTimeout
(()
=>
{},
500
);
backgroundTaskManager
.
stopBackgroundRunning
(
featureAbility
.
getContext
());
backgroundTaskManager
.
stopBackgroundRunning
(
featureAbility
.
getContext
());
setTimeout
(()
=>
{},
500
);
setTimeout
(()
=>
{},
500
);
let
wantInfo
=
{
want
:
{
bundleName
:
"
com.example.actsfeatureabilitytest
"
,
abilityName
:
"
com.example.actsfeatureabilitytest.TestAbility
"
}
}
await
featureAbility
.
startAbility
(
wantInfo
).
then
((
data
)
=>
{
console
.
log
(
"
ACTS_wantConstant startAbility data :
"
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
console
.
log
(
"
ACTS_wantConstant startAbility err :
"
+
JSON
.
stringify
(
err
));
})
setTimeout
(
function
()
{
console
.
log
(
"
ACTS_wantConstant afterEach end
"
);
done
();
},
500
);
})
})
/**
/**
...
...
ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
浏览文件 @
1d123860
...
@@ -23,6 +23,24 @@ const errCode1 = 202;
...
@@ -23,6 +23,24 @@ const errCode1 = 202;
export
default
function
startAbilityTest
()
{
export
default
function
startAbilityTest
()
{
describe
(
'
StartAbilityTest
'
,
function
()
{
describe
(
'
StartAbilityTest
'
,
function
()
{
afterEach
(
async
function
(
done
)
{
let
wantInfo
=
{
want
:
{
bundleName
:
"
com.example.actsfeatureabilitytest
"
,
abilityName
:
"
com.example.actsfeatureabilitytest.TestAbility
"
}
}
await
featureAbility
.
startAbility
(
wantInfo
).
then
((
data
)
=>
{
console
.
log
(
"
SUB_AA_JsApi_StartAbility startAbility data :
"
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
console
.
log
(
"
SUB_AA_JsApi_StartAbility startAbility err :
"
+
JSON
.
stringify
(
err
));
})
setTimeout
(
function
()
{
console
.
log
(
"
SUB_AA_JsApi_StartAbility afterEach end
"
);
done
();
},
500
);
})
/*
/*
* @tc.number: SUB_AA_JsApi_StartAbility_0100
* @tc.number: SUB_AA_JsApi_StartAbility_0100
* @tc.name: testAbility0100.
* @tc.name: testAbility0100.
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets
浏览文件 @
1d123860
...
@@ -57,6 +57,18 @@ export default function test() {
...
@@ -57,6 +57,18 @@ export default function test() {
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberCast
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberCast"
));
commonEvent
.
unsubscribe
(
subscriberCast
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberCast"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
let
wantInfo
=
{
want
:
{
bundleName
:
"com.ohos.st.formacquiretest"
,
abilityName
:
"com.ohos.st.formacquiretest.TestAbility"
}
}
await
featureAbility
.
startAbility
(
wantInfo
)
.
then
((
data
)
=>
{
console
.
log
(
"FMS_acquireForm startAbility data : "
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
console
.
log
(
"FMS_acquireForm startAbility err : "
+
JSON
.
stringify
(
err
));
})
await
sleep
(
1000
);
await
sleep
(
1000
);
})
})
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/test/FmsAcquireForm2.test.ets
浏览文件 @
1d123860
...
@@ -60,6 +60,18 @@ export default function test() {
...
@@ -60,6 +60,18 @@ export default function test() {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberCast, () => unsubscribeCallback("afterEach unsubscribe subscriberCast"));
commonEvent.unsubscribe(subscriberCast, () => unsubscribeCallback("afterEach unsubscribe subscriberCast"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
let wantInfo = {
want: {
bundleName: "com.ohos.st.formacquiretest2",
abilityName: "com.ohos.st.formacquiretest2.TestAbility"
}
}
await featureAbility.startAbility(wantInfo).then((data) => {
console.log("FMS_acquireForm2 startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log("FMS_acquireForm2 startAbility err : " + JSON.stringify(err));
})
await sleep(1000);
await sleep(1000);
})
})
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/test/FmsDeleteForm.test.ets
浏览文件 @
1d123860
...
@@ -16,7 +16,8 @@
...
@@ -16,7 +16,8 @@
import
featureAbility
from
'@ohos.ability.featureAbility'
;
import
featureAbility
from
'@ohos.ability.featureAbility'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
systemTime
from
'@ohos.systemTime'
;
import
systemTime
from
'@ohos.systemTime'
;
import
{
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
'@ohos/hypium'
import
{
beforeAll
,
afterAll
,
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
'@ohos/hypium'
import
backgroundTaskManager
from
'@ohos.backgroundTaskManager'
;
const
onAcquiredForm_Event
=
{
const
onAcquiredForm_Event
=
{
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
...
@@ -45,6 +46,30 @@ let subscriberSupply;
...
@@ -45,6 +46,30 @@ let subscriberSupply;
export
default
function
test
()
{
export
default
function
test
()
{
describe
(
`FmsDeleteFormTest`
,
()
=>
{
describe
(
`FmsDeleteFormTest`
,
()
=>
{
let
id
=
undefined
;
beforeAll
(
async
(
done
)
=>
{
console
.
log
(
"FMS_deleteForm beforeAll called"
);
let
myReason
=
'test FaShowOnLockTest'
;
let
delayInfo
=
backgroundTaskManager
.
requestSuspendDelay
(
myReason
,
()
=>
{
console
.
log
(
"FMS_deleteForm Request suspension delay will time out."
);
})
id
=
delayInfo
.
requestId
;
console
.
log
(
"FMS_deleteForm requestId is : "
+
id
);
setTimeout
(
function
()
{
console
.
log
(
"FMS_deleteForm beforeAll end"
);
done
();
},
1000
);
})
afterAll
(
async
(
done
)
=>
{
console
.
log
(
"FMS_deleteForm afterAll called"
);
backgroundTaskManager
.
cancelSuspendDelay
(
id
);
setTimeout
(
function
()
{
console
.
log
(
"FMS_deleteForm afterAll end"
);
done
();
},
1000
);
})
beforeEach
(
async
()
=>
{
beforeEach
(
async
()
=>
{
subscriberOnAcquired
=
await
commonEvent
.
createSubscriber
(
onAcquiredForm_Event
);
subscriberOnAcquired
=
await
commonEvent
.
createSubscriber
(
onAcquiredForm_Event
);
subscriberOnReleased
=
await
commonEvent
.
createSubscriber
(
onReleasedFormEvent
);
subscriberOnReleased
=
await
commonEvent
.
createSubscriber
(
onReleasedFormEvent
);
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/test/FmsDynamicRefreshForm.test.ets
浏览文件 @
1d123860
...
@@ -60,6 +60,18 @@ export default function test() {
...
@@ -60,6 +60,18 @@ export default function test() {
commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeCallback("afterEach unsubscribe subscriberOnDeleted"));
commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeCallback("afterEach unsubscribe subscriberOnDeleted"));
commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRefresh"));
commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRefresh"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
let wantInfo = {
want: {
bundleName: "com.ohos.st.formdynamicrefreshtest",
abilityName: "com.ohos.st.formdynamicrefreshtest.TestAbility"
}
}
await featureAbility.startAbility(wantInfo).then((data) => {
console.log("FMS_timedRefresh startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log("FMS_timedRefresh startAbility err : " + JSON.stringify(err));
})
await sleep(1000);
await sleep(1000);
})
})
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/test/FmsReleaseForm.test.ets
浏览文件 @
1d123860
...
@@ -56,6 +56,18 @@ export default function test() {
...
@@ -56,6 +56,18 @@ export default function test() {
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberOnDeleted
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnDeleted"
));
commonEvent
.
unsubscribe
(
subscriberOnDeleted
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnDeleted"
));
commonEvent
.
unsubscribe
(
subscriberOnReleased
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnReleased"
));
commonEvent
.
unsubscribe
(
subscriberOnReleased
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnReleased"
));
let
wantInfo
=
{
want
:
{
bundleName
:
"com.ohos.st.formreleasetest"
,
abilityName
:
"com.ohos.st.formreleasetest.TestAbility"
}
}
await
featureAbility
.
startAbility
(
wantInfo
)
.
then
((
data
)
=>
{
console
.
log
(
"FMS_releaseForm startAbility data : "
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
console
.
log
(
"FMS_releaseForm startAbility err : "
+
JSON
.
stringify
(
err
));
})
await
sleep
(
1000
);
await
sleep
(
1000
);
})
})
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/test/FmsFormStateDisable.test.ets
浏览文件 @
1d123860
...
@@ -15,7 +15,8 @@
...
@@ -15,7 +15,8 @@
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
{
beforeAll
,
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
'@ohos/hypium'
import
{
beforeAll
,
afterAll
,
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
'@ohos/hypium'
import
backgroundTaskManager
from
'@ohos.backgroundTaskManager'
;
var
onAcquiredForm_Event
=
{
var
onAcquiredForm_Event
=
{
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
...
@@ -47,8 +48,28 @@ var subscriberSupply;
...
@@ -47,8 +48,28 @@ var subscriberSupply;
export
default
function
test
()
{
export
default
function
test
()
{
describe
(
`FmsStateFormTest`
,
()
=>
{
describe
(
`FmsStateFormTest`
,
()
=>
{
let
id
=
undefined
;
beforeAll
(
async
(
done
)
=>
{
beforeAll
(
async
(
done
)
=>
{
done
();
console
.
log
(
"FMS_disableFormsUpdate beforeAll called"
);
let
myReason
=
'test FaShowOnLockTest'
;
let
delayInfo
=
backgroundTaskManager
.
requestSuspendDelay
(
myReason
,
()
=>
{
console
.
log
(
"FMS_disableFormsUpdate Request suspension delay will time out."
);
})
id
=
delayInfo
.
requestId
;
console
.
log
(
"FMS_disableFormsUpdate requestId is : "
+
id
);
setTimeout
(
function
()
{
console
.
log
(
"FMS_disableFormsUpdate beforeAll end"
);
done
();
},
1000
);
})
afterAll
(
async
(
done
)
=>
{
console
.
log
(
"FMS_disableFormsUpdate afterAll called"
);
backgroundTaskManager
.
cancelSuspendDelay
(
id
);
setTimeout
(
function
()
{
console
.
log
(
"FMS_disableFormsUpdate afterAll end"
);
done
();
},
1000
);
})
})
beforeEach
(
async
()
=>
{
beforeEach
(
async
()
=>
{
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/test/FmsFormStateEnable.test.ets
浏览文件 @
1d123860
...
@@ -15,7 +15,8 @@
...
@@ -15,7 +15,8 @@
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
{
beforeAll
,
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
'@ohos/hypium'
import
{
beforeAll
,
afterAll
,
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
'@ohos/hypium'
import
backgroundTaskManager
from
'@ohos.backgroundTaskManager'
;
var
onAcquiredForm_Event
=
{
var
onAcquiredForm_Event
=
{
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
...
@@ -47,8 +48,28 @@ var subscriberSupply;
...
@@ -47,8 +48,28 @@ var subscriberSupply;
export
default
function
test
()
{
export
default
function
test
()
{
describe
(
`FmsStateFormTest`
,
()
=>
{
describe
(
`FmsStateFormTest`
,
()
=>
{
let
id
=
undefined
;
beforeAll
(
async
(
done
)
=>
{
beforeAll
(
async
(
done
)
=>
{
done
();
console
.
log
(
"FMS_enableFormsUpdate beforeAll called"
);
let
myReason
=
'test FaShowOnLockTest'
;
let
delayInfo
=
backgroundTaskManager
.
requestSuspendDelay
(
myReason
,
()
=>
{
console
.
log
(
"FMS_enableFormsUpdate Request suspension delay will time out."
);
})
id
=
delayInfo
.
requestId
;
console
.
log
(
"FMS_enableFormsUpdate requestId is : "
+
id
);
setTimeout
(
function
()
{
console
.
log
(
"FMS_enableFormsUpdate beforeAll end"
);
done
();
},
1000
);
})
afterAll
(
async
(
done
)
=>
{
console
.
log
(
"FMS_enableFormsUpdate afterAll called"
);
backgroundTaskManager
.
cancelSuspendDelay
(
id
);
setTimeout
(
function
()
{
console
.
log
(
"FMS_enableFormsUpdate afterAll end"
);
done
();
},
1000
);
})
})
beforeEach
(
async
()
=>
{
beforeEach
(
async
()
=>
{
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/test/FmsFormStateNotifyInvisible.test.ets
浏览文件 @
1d123860
...
@@ -60,6 +60,18 @@ export default function test() {
...
@@ -60,6 +60,18 @@ export default function test() {
commonEvent
.
unsubscribe
(
subscriberDel
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberDel"
));
commonEvent
.
unsubscribe
(
subscriberDel
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberDel"
));
commonEvent
.
unsubscribe
(
subscriberOnState
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnState"
));
commonEvent
.
unsubscribe
(
subscriberOnState
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnState"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
let
wantInfo
=
{
want
:
{
bundleName
:
"com.ohos.st.formstatenotifyinvisibletest"
,
abilityName
:
"com.ohos.st.formstatenotifyinvisibletest.TestAbility"
}
}
await
featureAbility
.
startAbility
(
wantInfo
)
.
then
((
data
)
=>
{
console
.
log
(
"FMS_notifyInvisibleForms startAbility data : "
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
console
.
log
(
"FMS_notifyInvisibleForms startAbility err : "
+
JSON
.
stringify
(
err
));
})
await
sleep
(
1000
);
await
sleep
(
1000
);
})
})
/**
/**
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/test/FmsFormStateNotifyInvisible2.test.ets
浏览文件 @
1d123860
...
@@ -54,6 +54,18 @@ export default function test() {
...
@@ -54,6 +54,18 @@ export default function test() {
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberOnState
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnState"
));
commonEvent
.
unsubscribe
(
subscriberOnState
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnState"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
let
wantInfo
=
{
want
:
{
bundleName
:
"com.ohos.st.formstatenotifyinvisibletest2"
,
abilityName
:
"com.ohos.st.formstatenotifyinvisibletest2.TestAbility"
}
}
await
featureAbility
.
startAbility
(
wantInfo
)
.
then
((
data
)
=>
{
console
.
log
(
"FMS_notifyInvisibleForms2 startAbility data : "
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
console
.
log
(
"FMS_notifyInvisibleForms2 startAbility err : "
+
JSON
.
stringify
(
err
));
})
await
sleep
(
1000
);
await
sleep
(
1000
);
})
})
/**
/**
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/test/FmsFormStateNotifyVisible.test.ets
浏览文件 @
1d123860
...
@@ -57,6 +57,18 @@ export default function test() {
...
@@ -57,6 +57,18 @@ export default function test() {
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberOnState
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnState"
));
commonEvent
.
unsubscribe
(
subscriberOnState
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnState"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
let
wantInfo
=
{
want
:
{
bundleName
:
"com.ohos.st.formstatenotifyvisibletest"
,
abilityName
:
"com.ohos.st.formstatenotifyvisibletest.TestAbility"
}
}
await
featureAbility
.
startAbility
(
wantInfo
)
.
then
((
data
)
=>
{
console
.
log
(
"FMS_notifyVisibleForms startAbility data : "
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
console
.
log
(
"FMS_notifyVisibleForms startAbility err : "
+
JSON
.
stringify
(
err
));
})
await
sleep
(
1000
);
await
sleep
(
1000
);
})
})
/**
/**
...
...
ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
1d123860
...
@@ -13,6 +13,9 @@
...
@@ -13,6 +13,9 @@
* limitations under the License.
* 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
{
...
@@ -20,6 +23,14 @@ export default class MainAbility extends Ability {
...
@@ -20,6 +23,14 @@ export default class MainAbility extends Ability {
// Ability is creating, initialize resources for this ability
// Ability is creating, initialize resources for this ability
console
.
log
(
"
MainAbility onCreate
"
)
console
.
log
(
"
MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityContext
=
this
.
context
console
.
info
(
"
start run testcase!!!!
"
)
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
}
onDestroy
()
{
onDestroy
()
{
...
@@ -30,7 +41,7 @@ export default class MainAbility extends Ability {
...
@@ -30,7 +41,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate
(
windowStage
)
{
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
// Main window is created, set main page for this ability
console
.
log
(
"
MainAbility onWindowStageCreate
"
)
console
.
log
(
"
MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index/index
"
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index/index
"
,
null
)
}
}
...
...
ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/pages/index/index.ets
浏览文件 @
1d123860
...
@@ -13,20 +13,10 @@
...
@@ -13,20 +13,10 @@
* limitations under the License.
* limitations under the License.
*/
*/
import router from '@ohos.router';
import router from '@ohos.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/List.test'
@Entry
@Entry
@Component
@Component
struct Index {
struct Index {
aboutToAppear() {
aboutToAppear() {
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
}
build() {
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
...
...
ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
1d123860
...
@@ -42,6 +42,22 @@ export default function killProcessWithAccountTest() {
...
@@ -42,6 +42,22 @@ export default function killProcessWithAccountTest() {
})
})
})
})
afterEach(async (done) => {
console.log("ACTS_KillProcessWithAccount afterEach called");
let wantInfo = {
bundleName: "com.acts.killprocesswithaccount",
abilityName: "com.acts.killprocesswithaccount.MainAbility"
}
await globalThis.abilityContext.startAbility(wantInfo).then((data) => {
console.log("ACTS_KillProcessWithAccount startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log("ACTS_KillProcessWithAccount startAbility err : " + JSON.stringify(err));
})
setTimeout(function () {
console.log("ACTS_KillProcessWithAccount afterEach end");
done();
}, 500);
})
beforeEach(async (done) => {
beforeEach(async (done) => {
console.log('======>beforeEach killProcessWithAccountTest<=======' + flag);
console.log('======>beforeEach killProcessWithAccountTest<=======' + flag);
...
...
ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/module.json
浏览文件 @
1d123860
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
"label"
:
"$string:entry_label"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"orientation"
:
"portrait"
,
"launchType"
:
"singleton"
,
"skills"
:
[
"skills"
:
[
{
{
"actions"
:
[
"actions"
:
[
...
...
ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
1d123860
...
@@ -13,12 +13,24 @@
...
@@ -13,12 +13,24 @@
* limitations under the License.
* 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
(
"
MainAbility onCreate
"
)
console
.
log
(
"
MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityContext
=
this
.
context
console
.
info
(
"
start run testcase!!!!
"
)
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
}
onDestroy
()
{
onDestroy
()
{
...
@@ -29,7 +41,7 @@ export default class MainAbility extends Ability {
...
@@ -29,7 +41,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate
(
windowStage
)
{
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
// Main window is created, set main page for this ability
console
.
log
(
"
MainAbility onWindowStageCreate
"
)
console
.
log
(
"
MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index/index
"
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index/index
"
,
null
)
}
}
...
...
ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/pages/index/index.ets
浏览文件 @
1d123860
...
@@ -13,9 +13,6 @@
...
@@ -13,9 +13,6 @@
* limitations under the License.
* limitations under the License.
*/
*/
import router from '@ohos.router';
import router from '@ohos.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/List.test'
@Entry
@Entry
...
@@ -23,13 +20,6 @@ import testsuite from '../../../test/List.test'
...
@@ -23,13 +20,6 @@ import testsuite from '../../../test/List.test'
struct Index {
struct Index {
aboutToAppear(){
aboutToAppear(){
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
}
build() {
build() {
...
...
ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
1d123860
...
@@ -43,7 +43,20 @@ export default function abilityTest() {
...
@@ -43,7 +43,20 @@ export default function abilityTest() {
await
appManager
.
killProcessesByBundleName
(
"com.example.multiinstancehapa"
);
await
appManager
.
killProcessesByBundleName
(
"com.example.multiinstancehapa"
);
await
appManager
.
killProcessesByBundleName
(
"com.example.multiinstancehapb"
);
await
appManager
.
killProcessesByBundleName
(
"com.example.multiinstancehapb"
);
done
();
let
wantInfo
=
{
bundleName
:
"com.example.processmultiinstance"
,
abilityName
:
"com.example.processmultiinstance.MainAbility"
}
await
globalThis
.
abilityContext
.
startAbility
(
wantInfo
)
.
then
((
data
)
=>
{
console
.
log
(
"ACTS_Process_MultiInstance startAbility data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
console
.
log
(
"ACTS_Process_MultiInstance startAbility err: "
+
JSON
.
stringify
(
err
));
})
setTimeout
(
function
()
{
console
.
log
(
"ACTS_Process_MultiInstance afterEach end"
);
done
();
},
500
);
})
})
/**
/**
...
...
ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/module.json
浏览文件 @
1d123860
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
"label"
:
"$string:entry_label"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"orientation"
:
"portrait"
,
"launchType"
:
"singleton"
,
"skills"
:
[
"skills"
:
[
{
{
"actions"
:
[
"actions"
:
[
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录