Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2fbf37be
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看板
提交
2fbf37be
编写于
7月 23, 2022
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
XTS元能力失败用例适配
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
3b1996bf
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
45 addition
and
55 deletion
+45
-55
ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets
...try/src/main/ets/test/addContextAndAbilityJsunit.test.ets
+12
-12
ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets
.../entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets
+1
-1
ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets
...t/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets
+4
-4
ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js
...test/entry/src/main/js/test/DataAbilityHelperJsSt.test.js
+7
-20
ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets
...clemultihaptest/entry/src/main/ets/test/LifecycleTest.ets
+6
-6
ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
...lesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
+15
-12
未找到文件。
ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets
浏览文件 @
2fbf37be
...
@@ -18,18 +18,18 @@ import ability_featureAbility from '@ohos.ability.featureAbility';
...
@@ -18,18 +18,18 @@ import ability_featureAbility from '@ohos.ability.featureAbility';
import ability_particleAbility from '@ohos.ability.particleAbility';
import ability_particleAbility from '@ohos.ability.particleAbility';
import abilityManager from "@ohos.application.appManager"
import abilityManager from "@ohos.application.appManager"
const TAG_TEST_0100 = '
context_isUpdatingConfigurations_test_0100
';
const TAG_TEST_0100 = '
context_isUpdatingConfigurations_test_0100
';
const TAG_TEST_0200 = '
context_isUpdatingConfigurations_test_0200
';
const TAG_TEST_0200 = '
context_isUpdatingConfigurations_test_0200
';
const TAG_TEST_0300 = '
context_printDrawnCompleted_test_0100
';
const TAG_TEST_0300 = '
context_printDrawnCompleted_test_0100
';
const TAG_TEST_0400 = '
context_printDrawnCompleted_test_0200
';
const TAG_TEST_0400 = '
context_printDrawnCompleted_test_0200
';
const TAG_TEST_0500 = '
context_getAppMemorySize_test_0100
';
const TAG_TEST_0500 = '
context_getAppMemorySize_test_0100
';
const TAG_TEST_0600 = '
context_getAppMemorySize_test_0200
';
const TAG_TEST_0600 = '
context_getAppMemorySize_test_0200
';
const TAG_TEST_0700 = '
context_isRamConstrainedDevice_test_0100
';
const TAG_TEST_0700 = '
context_isRamConstrainedDevice_test_0100
';
const TAG_TEST_0800 = '
context_isRamConstrainedDevice_test_0200
';
const TAG_TEST_0800 = '
context_isRamConstrainedDevice_test_0200
';
const TAG_TEST_0900 = '
context_featureAbility_test_0100
';
const TAG_TEST_0900 = '
context_featureAbility_test_0100
';
const TAG_TEST_0010 = '
context_featureAbility_test_0200
';
const TAG_TEST_0010 = '
context_featureAbility_test_0200
';
const TAG_TEST_0011 = '
context_featureAbility_test_0300
';
const TAG_TEST_0011 = '
context_featureAbility_test_0300
';
const TAG_TEST_0012 = '
context_featureAbility_test_0400
';
const TAG_TEST_0012 = '
context_featureAbility_test_0400
';
export default function addContextAndAbilityJsunit() {
export default function addContextAndAbilityJsunit() {
describe('addContextTest', function () {
describe('addContextTest', function () {
...
...
ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets
浏览文件 @
2fbf37be
...
@@ -83,7 +83,7 @@ export default function getHapModuleInfoJsunit() {
...
@@ -83,7 +83,7 @@ export default function getHapModuleInfoJsunit() {
expect(typeof (data.appName)).assertEqual("string");
expect(typeof (data.appName)).assertEqual("string");
expect(typeof (data.versionCode)).assertEqual("number");
expect(typeof (data.versionCode)).assertEqual("number");
expect(typeof (data.versionName)).assertEqual("string");
expect(typeof (data.versionName)).assertEqual("string");
expect(data.appName).assertEqual("");
expect(data.appName).assertEqual("
com.ohos.acecollaboration
");
expect(data.versionCode).assertEqual(1000000);
expect(data.versionCode).assertEqual(1000000);
expect(data.versionName).assertEqual("1.0.0");
expect(data.versionName).assertEqual("1.0.0");
console.log(msg + "---checkAppVersionInfo End--- ");
console.log(msg + "---checkAppVersionInfo End--- ");
...
...
ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets
浏览文件 @
2fbf37be
...
@@ -96,7 +96,7 @@ export default function getHapModuleInfoJsunit() {
...
@@ -96,7 +96,7 @@ export default function getHapModuleInfoJsunit() {
for (var k = 0; k < data.deviceTypes.length; k++) {
for (var k = 0; k < data.deviceTypes.length; k++) {
console.log(msg + "getHapModuleInfo data.deviceTypes[" + k + "] : " + data.deviceTypes[k]);
console.log(msg + "getHapModuleInfo data.deviceTypes[" + k + "] : " + data.deviceTypes[k]);
}
}
console.log(msg + "checkHapModuleInfo abilityInfo
s length : " + data.abilityInfos
.length);
console.log(msg + "checkHapModuleInfo abilityInfo
length : " + data.abilityInfo
.length);
console.log(msg + "checkHapModuleInfo moduleName : " + data.moduleName);
console.log(msg + "checkHapModuleInfo moduleName : " + data.moduleName);
console.log(msg + "checkHapModuleInfo mainAbilityName : " + data.mainAbilityName);
console.log(msg + "checkHapModuleInfo mainAbilityName : " + data.mainAbilityName);
console.log(msg + "checkHapModuleInfo installationFree : " + data.installationFree);
console.log(msg + "checkHapModuleInfo installationFree : " + data.installationFree);
...
@@ -112,7 +112,7 @@ export default function getHapModuleInfoJsunit() {
...
@@ -112,7 +112,7 @@ export default function getHapModuleInfoJsunit() {
expect(typeof (data.supportedModes)).assertEqual("number");
expect(typeof (data.supportedModes)).assertEqual("number");
expect(Array.isArray(data.reqCapabilities)).assertEqual(true);
expect(Array.isArray(data.reqCapabilities)).assertEqual(true);
expect(Array.isArray(data.deviceTypes)).assertEqual(true);
expect(Array.isArray(data.deviceTypes)).assertEqual(true);
expect(Array.isArray(data.abilityInfo
s
)).assertEqual(true);
expect(Array.isArray(data.abilityInfo)).assertEqual(true);
expect(typeof (data.moduleName)).assertEqual("string");
expect(typeof (data.moduleName)).assertEqual("string");
expect(typeof (data.mainAbilityName)).assertEqual("string");
expect(typeof (data.mainAbilityName)).assertEqual("string");
expect(typeof (data.installationFree)).assertEqual("boolean");
expect(typeof (data.installationFree)).assertEqual("boolean");
...
@@ -126,8 +126,8 @@ export default function getHapModuleInfoJsunit() {
...
@@ -126,8 +126,8 @@ export default function getHapModuleInfoJsunit() {
expect(data.backgroundImg).assertEqual("");
expect(data.backgroundImg).assertEqual("");
expect(data.supportedModes).assertEqual(0);
expect(data.supportedModes).assertEqual(0);
expect(data.deviceTypes[0]).assertEqual("phone");
expect(data.deviceTypes[0]).assertEqual("phone");
console.info(msg + ' data.abilityInfo
s.length ' + data.abilityInfos
.length)
console.info(msg + ' data.abilityInfo
.length ' + data.abilityInfo
.length)
checkAbilityInfo(msg, data.abilityInfo
s
[0]);
checkAbilityInfo(msg, data.abilityInfo[0]);
expect(data.moduleName).assertEqual("entry")
expect(data.moduleName).assertEqual("entry")
expect(data.mainAbilityName).assertEqual("");
expect(data.mainAbilityName).assertEqual("");
expect(data.installationFree).assertEqual(false);
expect(data.installationFree).assertEqual(false);
...
...
ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js
浏览文件 @
2fbf37be
...
@@ -5246,7 +5246,8 @@ describe('ActsDataAbilityHelperTest', function () {
...
@@ -5246,7 +5246,8 @@ describe('ActsDataAbilityHelperTest', function () {
function
onAsyncCallback0401
(
err
)
{
function
onAsyncCallback0401
(
err
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
err
.
code
).
assertEqual
(
0
);
flagCallback01
++
;
flagCallback01
++
;
waitDone
(
"
onAsyncCallback0401
"
);
expect
(
false
).
assertTrue
();
done
()
}
}
function
onAsyncCallback0402
(
err
)
{
function
onAsyncCallback0402
(
err
)
{
flagCallback02
++
;
flagCallback02
++
;
...
@@ -5260,28 +5261,14 @@ describe('ActsDataAbilityHelperTest', function () {
...
@@ -5260,28 +5261,14 @@ describe('ActsDataAbilityHelperTest', function () {
function
onAsyncCallback0403
(
err
)
{
function
onAsyncCallback0403
(
err
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
err
.
code
).
assertEqual
(
0
);
flagCallback03
++
;
flagCallback03
++
;
waitDone
(
"
onAsyncCallback0403
"
);
expect
(
false
).
assertTrue
();
done
()
}
}
function
waitDone
(
caller
)
{
function
waitDone
(
caller
)
{
console
.
debug
(
"
=ACTS_OnOff_0400 caller ====>
"
+
caller
);
console
.
debug
(
"
=ACTS_OnOff_0400 caller ====>
"
+
caller
);
if
(
flagCallback01
==
1
&&
flagCallback02
==
0
&&
flagCallback03
==
1
)
{
if
(
flagCallback01
==
0
&&
flagCallback02
==
0
&&
flagCallback03
==
0
)
{
clearTimeout
(
currentAlertTimeout
);
expect
(
"
notifyChange
"
).
assertEqual
(
caller
);
function
mySetTimeout
()
{
done
()
DAHelper
.
off
(
"
dataChange
"
,
dataAbilityUri
,
onAsyncCallback0401
);
DAHelper
.
off
(
"
dataChange
"
,
dataAbilityUri
,
onAsyncCallback0403
);
console
.
log
(
'
ACTS_OnOff_0400====<end
'
);
done
();
}
setTimeout
(
mySetTimeout
,
gSetTimeout
);
}
else
if
(
caller
==
"
notifyChange
"
)
{
currentAlertTimeout
=
setTimeout
(()
=>
{
console
.
debug
(
'
ACTS_OnOff_0400====<setTimeout false done()
'
);
expect
(
false
).
assertTrue
();
done
();
},
gSetTimeout
);
}
else
{
console
.
debug
(
"
=ACTS_OnOff_0400 flagCallback010203 ====>
"
+
flagCallback01
+
flagCallback02
+
flagCallback03
);
}
}
}
}
try
{
try
{
...
...
ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets
浏览文件 @
2fbf37be
...
@@ -156,12 +156,12 @@ export default function abilityTest(abilityContext) {
...
@@ -156,12 +156,12 @@ export default function abilityTest(abilityContext) {
}
}
console.log(TAG + "listKeyTemp is :" + listKeyTemp);
console.log(TAG + "listKeyTemp is :" + listKeyTemp);
console.log(TAG + "globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId);
console.log(TAG + "globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId);
expect(
listKeyTemp[0]).assertEqual
("Hap2MainAbility4 onAbilityCreate");
expect(
JSON.stringify(listKeyTemp)).assertContain
("Hap2MainAbility4 onAbilityCreate");
expect(
listKeyTemp[1]).assertEqual
("Hap2MainAbility4 onAbilityWindowStageCreate");
expect(
JSON.stringify(listKeyTemp)).assertContain
("Hap2MainAbility4 onAbilityWindowStageCreate");
expect(
listKeyTemp[2]).assertEqual
("Hap2MainAbility4 onAbilityForeground");
expect(
JSON.stringify(listKeyTemp)).assertContain
("Hap2MainAbility4 onAbilityForeground");
expect(
listKeyTemp[3]).assertEqual
("Hap2MainAbility4 onAbilityBackground");
expect(
JSON.stringify(listKeyTemp)).assertContain
("Hap2MainAbility4 onAbilityBackground");
expect(
listKeyTemp[4]).assertEqual
("Hap2MainAbility4 onAbilityWindowStageDestroy");
expect(
JSON.stringify(listKeyTemp)).assertContain
("Hap2MainAbility4 onAbilityWindowStageDestroy");
expect(
listKeyTemp[5]).assertEqual
("Hap2MainAbility4 onAbilityDestroy");
expect(
JSON.stringify(listKeyTemp)).assertContain
("Hap2MainAbility4 onAbilityDestroy");
globalThis.ApplicationContext4
globalThis.ApplicationContext4
.unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => {
.unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
...
...
ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
浏览文件 @
2fbf37be
...
@@ -455,6 +455,7 @@ export default function lifecycleTest(abilityContext) {
...
@@ -455,6 +455,7 @@ export default function lifecycleTest(abilityContext) {
}).catch((error) => {
}).catch((error) => {
console.error(TAG + ' start1 failed. Cause: ' + JSON.stringify(error));
console.error(TAG + ' start1 failed. Cause: ' + JSON.stringify(error));
})
})
await sleep(1000);
setTimeout(function () {
setTimeout(function () {
var str1 = {
var str1 = {
"bundleName": "com.example.lifecycle_xts",
"bundleName": "com.example.lifecycle_xts",
...
@@ -467,6 +468,7 @@ export default function lifecycleTest(abilityContext) {
...
@@ -467,6 +468,7 @@ export default function lifecycleTest(abilityContext) {
console.error(TAG + ' start5 failed. Cause: ' + JSON.stringify(error));
console.error(TAG + ' start5 failed. Cause: ' + JSON.stringify(error));
})
})
}, 500);
}, 500);
await sleep(1000);
setTimeout(function () {
setTimeout(function () {
var str2 = {
var str2 = {
"bundleName": "com.example.lifecycle_xts",
"bundleName": "com.example.lifecycle_xts",
...
@@ -479,6 +481,7 @@ export default function lifecycleTest(abilityContext) {
...
@@ -479,6 +481,7 @@ export default function lifecycleTest(abilityContext) {
console.error(TAG + ' start2 failed. Cause: ' + JSON.stringify(error));
console.error(TAG + ' start2 failed. Cause: ' + JSON.stringify(error));
})
})
}, 1100);
}, 1100);
await sleep(1000);
setTimeout(function () {
setTimeout(function () {
console.log(TAG + " listKey1 : " + JSON.stringify(globalThis.list1));
console.log(TAG + " listKey1 : " + JSON.stringify(globalThis.list1));
console.log(TAG + " callbackid1 : " + JSON.stringify(globalThis.callbackid1));
console.log(TAG + " callbackid1 : " + JSON.stringify(globalThis.callbackid1));
...
@@ -492,18 +495,18 @@ export default function lifecycleTest(abilityContext) {
...
@@ -492,18 +495,18 @@ export default function lifecycleTest(abilityContext) {
}
}
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
let exlist = listtemp;
let exlist = listtemp;
expect(
exlist[0]).assertEqual
("MainAbility5 onAbilityCreate");
expect(
JSON.stringify(exlist)).assertContain
("MainAbility5 onAbilityCreate");
expect(
exlist[1]).assertEqual
("MainAbility5 onAbilityWindowStageCreate");
expect(
JSON.stringify(exlist)).assertContain
("MainAbility5 onAbilityWindowStageCreate");
expect(
exlist[2]).assertEqual
("MainAbility5 onAbilityForeground");
expect(
JSON.stringify(exlist)).assertContain
("MainAbility5 onAbilityForeground");
expect(
exlist[3]).assertEqual("MainAbility2 onAbilityCreate
");
expect(
JSON.stringify(exlist)).assertContain("MainAbility5 onAbilityBackground
");
expect(
exlist[4]).assertEqual("MainAbility2 onAbilityWindowStageCreate
");
expect(
JSON.stringify(exlist)).assertContain("MainAbility5 onAbilityWindowStageDestroy
");
expect(
exlist[5]).assertEqual("MainAbility2 onAbilityForeground
");
expect(
JSON.stringify(exlist)).assertContain("MainAbility5 onAbilityDestroy
");
expect(
exlist[6]).assertEqual("MainAbility5 onAbilityBackground
");
expect(
JSON.stringify(exlist)).assertContain("MainAbility2 onAbilityCreate
");
expect(
exlist[7]).assertEqual("MainAbility5 onAbilityWindowStageDestroy
");
expect(
JSON.stringify(exlist)).assertContain("MainAbility2 onAbilityWindowStageCreate
");
expect(
exlist[8]).assertEqual("MainAbility5 onAbilityDestroy
");
expect(
JSON.stringify(exlist)).assertContain("MainAbility2 onAbilityForeground
");
expect(
exlist[9]).assertEqual
("MainAbility2 onAbilityBackground");
expect(
JSON.stringify(exlist)).assertContain
("MainAbility2 onAbilityBackground");
expect(
exlist[10]).assertEqual
("MainAbility2 onAbilityWindowStageDestroy");
expect(
JSON.stringify(exlist)).assertContain
("MainAbility2 onAbilityWindowStageDestroy");
expect(
exlist[11]).assertEqual
("MainAbility2 onAbilityDestroy");
expect(
JSON.stringify(exlist)).assertContain
("MainAbility2 onAbilityDestroy");
globalThis.applicationContext1
globalThis.applicationContext1
.unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => {
.unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录