Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
fb0f9f26
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看板
未验证
提交
fb0f9f26
编写于
7月 20, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 20, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9386 Fix:abilityInfo等校验与.d.ts保持一致
Merge pull request !9386 from 张亚菲/zyf
上级
7829ca9e
75f5174b
变更
2
展开全部
显示空白变更内容
内联
并排
Showing
2 changed file
with
273 addition
and
179 deletion
+273
-179
ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/Ability.test.ets
...stagecontexttest/entry/src/main/ets/test/Ability.test.ets
+100
-63
ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/Ability.test.ets
...omationquerytest/entry/src/main/ets/test/Ability.test.ets
+173
-116
未找到文件。
ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
fb0f9f26
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
import bundleManager from '@ohos.bundle.bundleManager'
export default function abilityTest() {
describe('ActsglobalThis.abilityStageContextTest', function () {
...
...
@@ -42,126 +42,163 @@ export default function abilityTest() {
})
function checkApplicationInfo(data) {
console.log("checkApplicationInfo start " +
data
);
console.log("checkApplicationInfo start " +
JSON.stringify(data)
);
console.log("checkApplicationInfo name : " + data.name);
console.log("checkApplicationInfo description : " + data.description);
console.log("checkApplicationInfo descriptionId : " + data.descriptionId);
console.log("checkApplicationInfo systemApp : " + data.systemApp);
console.log("checkApplicationInfo enabled : " + data.enabled);
console.log("checkApplicationInfo label : " + data.label)
console.log("checkApplicationInfo labelId : " + data.labelId);
console.log("checkApplicationInfo icon : " + data.icon);
console.log("checkApplicationInfo iconId : " + data.iconId);
console.log("checkApplicationInfo process : " + data.process);
console.log("checkApplicationInfo supportedModes : " + data.supportedModes);
console.log("checkApplicationInfo moduleSourceDirs length : " + data.moduleSourceDirs.length);
for (var j = 0; j < data.moduleSourceDirs.length; j++) {
console.log("checkApplicationInfo data.moduleSourceDirs[" + j + "] : " + data.moduleSourceDirs[j]);
}
console.log("checkApplicationInfo permissions length : " + data.permissions.length);
for (var j = 0; j < data.permissions.length; j++) {
console.log("checkApplicationInfo data.permissions[" + j + "] : " + data.permissions[j]);
}
console.log("checkApplicationInfo moduleInfos length : " + data.moduleInfos.length);
for (var j = 0; j < data.moduleInfos.length; j++) {
console.log("checkApplicationInfo data.moduleInfos[" + j + "].moduleName : " +
data.moduleInfos[j].moduleName);
console.log("checkApplicationInfo data.moduleInfos[" + j + "].moduleSourceDir : " +
data.moduleInfos[j].moduleSourceDir);
}
console.log("checkApplicationInfo entryDir : " + data.entryDir);
console.log("checkApplicationInfo codePath : " + data.codePath);
console.log("checkApplicationInfo metadata size : " + data.metadata.size);
for (var j = 0; j < data.metadata.size; j++) {
console.log("checkApplicationInfo data.metadata[" + j + "] : " + data.metadata[j]);
}
console.log("checkApplicationInfo removable: " + data.removable);
console.log("checkApplicationInfo accessTokenId: " + data.accessTokenId);
console.log("checkApplicationInfo uid: " + data.uid);
console.log("checkApplicationInfo iconResource: " + JSON.stringify(data.iconResource));
console.log("checkApplicationInfo labelResource: " + JSON.stringify(data.labelResource));
console.log("checkApplicationInfo descriptionResource: " + JSON.stringify(data.descriptionResource));
console.log("checkApplicationInfo appDistributionType: " + data.appDistributionType);
console.log("checkApplicationInfo appProvisionType: " + data.appProvisionType);
console.log("checkApplicationInfo systemApp : " + data.systemApp);
console.log("checkApplicationInfo bundleType : " + data.bundleType);
console.log("checkApplicationInfo debug : " + data.debug);
expect(typeof (data)).assertEqual("object");
expect(typeof (data.name)).assertEqual("string");
expect(typeof (data.description)).assertEqual("string");
expect(typeof (data.descriptionId)).assertEqual("number");
expect(typeof (data.systemApp)).assertEqual("boolean");
expect(typeof (data.enabled)).assertEqual("boolean");
expect(typeof (data.label)).assertEqual("string");
expect(typeof (data.labelId)).assertEqual("
string
");
expect(typeof (data.labelId)).assertEqual("
number
");
expect(typeof (data.icon)).assertEqual("string");
expect(typeof (data.iconId)).assertEqual("
string
");
expect(typeof (data.iconId)).assertEqual("
number
");
expect(typeof (data.process)).assertEqual("string");
expect(typeof (data.supportedModes)).assertEqual("number");
expect(Array.isArray(data.permissions)).assertEqual(true);
expect(Array.isArray(data.moduleInfos)).assertEqual(true);
expect(typeof (data.codePath)).assertEqual("string");
expect(typeof (data.removable)).assertEqual("boolean");
expect(typeof (data.accessTokenId)).assertEqual("number");
expect(typeof (data.uid)).assertEqual("number");
expect(typeof (data.iconResource)).assertEqual("object");
expect(typeof (data.labelResource)).assertEqual("object");
expect(typeof (data.descriptionResource)).assertEqual("object");
expect(typeof (data.appDistributionType)).assertEqual("string");
expect(typeof (data.appProvisionType)).assertEqual("string");
expect(typeof (data.systemApp)).assertEqual("boolean");
expect(typeof (data.bundleType)).assertEqual("number");
expect(typeof (data.debug)).assertEqual("boolean");
console.log("checkApplicationInfo_expect_typeof_end")
expect(data.name).assertEqual("com.acts.stabilitystagecontext");
expect(data.description).assertEqual("$string:description_application");
expect(data.descriptionId).assertLarger(0);
expect(data.systemApp).assertEqual(true);
expect(data.enabled).assertEqual(true);
expect(data.label).assertEqual("$string:app_name");
expect(data.labelId
.length
).assertLarger(0);
expect(data.labelId).assertLarger(0);
expect(data.icon).assertEqual("$media:icon");
expect(data.iconId
.length
).assertLarger(0);
expect(data.iconId).assertLarger(0);
expect(data.process).assertEqual("com.acts.stabilitystagecontext");
expect(data.supportedModes).assertEqual(0);
expect(data.moduleInfos.length).assertEqual(1);
expect(data.moduleInfos[0].moduleName).assertEqual("com.acts.stabilitystagecontext");
expect(data.codePath).assertEqual("/data/app/el1/bundle/public/" +
"com.acts.stabilitystagecontext");
expect(data.permissions.length).assertEqual(0);
expect(data.codePath).assertEqual("/data/app/el1/bundle/public/com.acts.stabilitystagecontext");
expect(data.removable).assertEqual(true);
expect(data.accessTokenId).assertLarger(0);
expect(data.uid).assertLarger(0);
expect(data.iconResource.bundleName).assertEqual("com.acts.stabilitystagecontext");
expect(data.iconResource.moduleName).assertEqual("com.acts.stabilitystagecontext");
expect(data.iconResource.id).assertLarger(0);
expect(data.labelResource.bundleName).assertEqual("com.acts.stabilitystagecontext");
expect(data.labelResource.moduleName).assertEqual("com.acts.stabilitystagecontext");
expect(data.labelResource.id).assertLarger(0);
expect(data.descriptionResource.bundleName).assertEqual("com.acts.stabilitystagecontext");
expect(data.descriptionResource.moduleName).assertEqual("com.acts.stabilitystagecontext");
expect(data.descriptionResource.id).assertLarger(0);
expect(data.appDistributionType).assertEqual("os_integration");
expect(data.appProvisionType).assertEqual("release");
expect(data.systemApp).assertEqual(true);
expect(data.bundleType).assertEqual(0);
expect(data.debug).assertEqual(false);
console.log("checkApplicationInfo end " + data);
}
function checkHapModuleInfo(data) {
console.log("checkHapModuleInfo start " + JSON.stringify(data));
console.log("checkHapModuleInfo name : " + data.name);
console.log("checkHapModuleInfo description : " + data.description);
console.log("checkHapModuleInfo descriptionId : " + data.descriptionId);
console.log("checkHapModuleInfo icon : " + data.icon);
console.log("checkHapModuleInfo iconId : " + data.iconId);
console.log("checkHapModuleInfo label : " + data.label);
console.log("checkHapModuleInfo labelId : " + data.labelId);
console.log("checkHapModuleInfo iconId : " + data.iconId);
console.log("checkHapModuleInfo backgroundImg : " + data.backgroundImg);
console.log("checkHapModuleInfo supportedModes : " + data.supportedModes);
console.log("checkHapModuleInfo reqCapabilities length : " + data.reqCapabilities.length);
for (var j = 0; j < data.reqCapabilities.length; j++) {
console.log("checkHapModuleInfo data.reqCapabilities[" + j + "] : " + data.reqCapabilities[j]);
}
console.log("checkHapModuleInfo description : " + data.description);
console.log("checkHapModuleInfo descriptionId : " + data.descriptionId);
console.log("checkHapModuleInfo mainElementName : " + data.mainElementName);
console.log("checkHapModuleInfo abilitiesInfo : " + JSON.stringify(data.abilitiesInfo));
console.log("checkHapModuleInfo extensionAbilitiesInfo : " + JSON.stringify(data.extensionAbilitiesInfo));
console.log("checkHapModuleInfo metadata : " + JSON.stringify(data.metadata));
console.log("checkHapModuleInfo deviceTypes length : " + data.deviceTypes.length);
for (var j = 0; j < data.deviceTypes.length; j++) {
console.log("checkHapModuleInfo data.deviceTypes[" + j + "] : " + data.deviceTypes[j]);
}
console.log("checkHapModuleInfo moduleName : " + data.moduleName);
console.log("checkHapModuleInfo mainAbilityName : " + data.mainAbilityName);
console.log("checkHapModuleInfo installationFree : " + data.installationFree);
console.log("checkHapModuleInfo hashValue : " + data.hashValue);
console.log("checkHapModuleInfo type : " + data.type);
console.log("checkHapModuleInfo dependencies length : " + data.dependencies.length);
for (var j = 0; j < data.dependencies.length; j++) {
console.log("checkHapModuleInfo data.dependencies[" + j + "] : " + data.dependencies[j]);
}
console.log("checkHapModuleInfo preloads length : " + data.preloads.length);
for (var j = 0; j < data.preloads.length; j++) {
console.log("checkHapModuleInfo data.preloads[" + j + "] : " + data.preloads[j]);
}
expect(typeof (data)).assertEqual("object");
expect(typeof (data.name)).assertEqual("string");
expect(typeof (data.description)).assertEqual("string");
expect(typeof (data.icon)).assertEqual("string");
expect(typeof (data.iconId)).assertEqual("number");
expect(typeof (data.label)).assertEqual("string");
expect(typeof (data.backgroundImg)).assertEqual("string");
expect(typeof (data.supportedModes)).assertEqual("number");
expect(Array.isArray(data.reqCapabilities)).assertEqual(true);
expect(typeof (data.labelId)).assertEqual("number");
expect(typeof (data.description)).assertEqual("string");
expect(typeof (data.descriptionId)).assertEqual("number");
expect(typeof (data.mainElementName)).assertEqual("string");
expect(Array.isArray(data.abilitiesInfo)).assertEqual(true);
expect(Array.isArray(data.extensionAbilitiesInfo)).assertEqual(true);
expect(Array.isArray(data.metadata)).assertEqual(true);
expect(Array.isArray(data.deviceTypes)).assertEqual(true);
expect(Array.isArray(data.abilityInfo)).assertEqual(true);
expect(typeof (data.moduleName)).assertEqual("string");
expect(typeof (data.mainAbilityName)).assertEqual("string");
expect(typeof (data.installationFree)).assertEqual("boolean");
expect(typeof (data.hashValue)).assertEqual("string");
expect(typeof (data.type)).assertEqual("number");
expect(Array.isArray(data.dependencies)).assertEqual(true);
expect(Array.isArray(data.preloads)).assertEqual(true);
console.log("checkHapModuleInfo_expect_typeof_end")
expect(data.name).assertEqual("com.acts.stabilitystagecontext");
expect(data.description).assertEqual("$string:phone_entry_dsc");
expect(data.descriptionId).assertEqual(16777221);
expect(data.icon).assertEqual("$media:icon");
expect(data.label).assertEqual("$string:entry_label");
expect(data.labelId).assertEqual(16777219);
expect(data.name).assertEqual('com.acts.stabilitystagecontext');
expect(data.icon).assertEqual('$media:icon');
expect(data.iconId).assertEqual(16777224);
expect(data.backgroundImg).assertEqual("");
expect(data.supportedModes).assertEqual(0);
expect(data.reqCapabilities.length).assertEqual(0);
expect(data.deviceTypes.length).assertEqual(2);
expect(data.deviceTypes[0]).assertEqual("default");
expect(data.moduleName).assertEqual("com.acts.stabilitystagecontext")
expect(data.mainAbilityName).assertEqual("com.acts.stabilitystagecontext.MainAbility");
expect(data.installationFree).assertEqual(false);
expect(data.label).assertEqual('$string:entry_label');
expect(data.labelId).assertEqual(16777219);
expect(data.description).assertEqual('$string:phone_entry_dsc');
expect(data.descriptionId).assertEqual(16777221);
expect(data.mainElementName).assertEqual('com.acts.stabilitystagecontext.MainAbility');
expect(data.abilitiesInfo.length).assertEqual(1);
expect(data.abilitiesInfo[0].bundleName).assertEqual('com.acts.stabilitystagecontext');
expect(data.abilitiesInfo[0].moduleName).assertEqual('com.acts.stabilitystagecontext');
expect(data.extensionAbilitiesInfo.length).assertEqual(0);
expect(data.metadata.length).assertEqual(0);
expect(data.deviceTypes[0]).assertEqual('default');
expect(data.deviceTypes[1]).assertEqual('tablet');
expect(data.deviceTypes[2]).assertEqual('2in1');
expect(data.installationFree).assertEqual(false);
expect(data.hashValue).assertEqual('');
expect(data.type).assertEqual(bundleManager.ModuleType.ENTRY);
expect(data.dependencies.length).assertEqual(0);
expect(data.preloads.length).assertEqual(0);
console.log("checkHapModuleInfo end " + data);
}
})
...
...
ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
fb0f9f26
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录