提交 f3beeb2d 编写于 作者: S SoftSquirrel

#I5IO6U: cherry pick to 3.1 release, modify HapModuleInfo's name, label, icon, description

Description: cherry pick to 3.1 release, modify HapModuleInfo's name, label, icon, description
Sig: SIG_ApplicaitonFramework
Feature or Bugfix: Bugfix
Binary Source: No
Signed-off-by: NSoftSquirrel <xuhao47@huawei.com>
上级 422b7f8e
......@@ -20,9 +20,17 @@ const BUNDLE_NAME1 = 'com.example.bmsmainabilityfirstscene';
const BUNDLE_NAME2 = 'com.example.third2';
const BUNDLE_NAME3 = 'com.example.third5';
const BUNDLE_NAME5 = 'com.example.system1';
const BUNDLE_NAME6 = "com.example.bmsmainabilitysecondscene";
const FIRSTMAINABILITY = 'com.example.bmsmainabilityfirstscene.MainAbility';
const SECONDMAINABILITY = 'com.example.bmsmainabilitysecondscene.MainAbility';
const ICON = '$media:icon';
const ICON_ID = 16777218;
const LABEL = '$string:app_name';
const LABEL_ID = 16777216;
const FIRST_SCENE_HAP_NAME = 'com.example.bmsmainabilityfirstscene.MyApplication';
const SECOND_SCENE_HAP_NAME = 'com.example.bmsmainabilitysecondscene.MyApplication';
const THIRD_TWO_HAP_NAME = 'com.example.third2.MyApplication';
const THIRD_FIVE_HAP_NAME = 'com.example.third5.BmsThirdBundle5';
const SYSTEM_ONE_HAP_NAME = 'com.example.system1.BmsSystemBundle1';
describe('ActsBmsHapModuleTest', function () {
......@@ -39,14 +47,14 @@ describe('ActsBmsHapModuleTest', function () {
expect(result.hapModuleInfos.length).assertEqual(2);
if (result.hapModuleInfos.length > 0) {
let hapModuleInfo = result.hapModuleInfos[0];
expect(hapModuleInfo.name).assertEqual(BUNDLE_NAME1);
expect(hapModuleInfo.name).assertEqual(FIRST_SCENE_HAP_NAME);
expect(hapModuleInfo.moduleName).assertEqual('entry');
expect(hapModuleInfo.description).assertEqual('');
expect(hapModuleInfo.descriptionId).assertEqual(0);
expect(hapModuleInfo.icon).assertEqual('');
expect(hapModuleInfo.icon).assertEqual(ICON);
expect(hapModuleInfo.label).assertEqual('$string:app_name');
expect(hapModuleInfo.labelId).assertEqual(0);
expect(hapModuleInfo.iconId).assertEqual(0);
expect(hapModuleInfo.labelId).assertEqual(LABEL_ID);
expect(hapModuleInfo.iconId).assertEqual(ICON_ID);
expect(hapModuleInfo.backgroundImg).assertEqual("");
expect(hapModuleInfo.supportedModes).assertEqual(0);
expect(hapModuleInfo.reqCapabilities.length).assertEqual(0);
......@@ -77,9 +85,8 @@ describe('ActsBmsHapModuleTest', function () {
let hapModuleInfo1 = result.hapModuleInfos[1];
checkHapMoudleInfos(hapModuleInfo);
checkHapMoudleInfos(hapModuleInfo1);
expect(hapModuleInfo.label).assertEqual('$string:app_name');
expect(hapModuleInfo.name).assertEqual(BUNDLE_NAME1);
expect(hapModuleInfo1.name).assertEqual(BUNDLE_NAME6);
expect(hapModuleInfo.name).assertEqual(FIRST_SCENE_HAP_NAME);
expect(hapModuleInfo1.name).assertEqual(SECOND_SCENE_HAP_NAME);
expect(hapModuleInfo.moduleName).assertEqual('entry');
expect(hapModuleInfo.mainAbilityName).assertEqual(FIRSTMAINABILITY);
expect(hapModuleInfo.mainElementName).assertEqual(FIRSTMAINABILITY);
......@@ -103,12 +110,12 @@ describe('ActsBmsHapModuleTest', function () {
expect(result.hapModuleInfos.length).assertEqual(1);
if (result.hapModuleInfos.length > 0) {
let hapModuleInfo = result.hapModuleInfos[0];
expect(hapModuleInfo.name).assertEqual(BUNDLE_NAME2);
expect(hapModuleInfo.name).assertEqual(THIRD_TWO_HAP_NAME);
expect(hapModuleInfo.moduleName).assertEqual('entry');
expect(hapModuleInfo.description).assertEqual('');
expect(hapModuleInfo.descriptionId).assertEqual(0);
expect(hapModuleInfo.icon).assertEqual('');
expect(hapModuleInfo.label).assertEqual('$string:app_name');
expect(hapModuleInfo.label).assertEqual('');
expect(hapModuleInfo.labelId).assertEqual(0);
expect(hapModuleInfo.iconId).assertEqual(0);
expect(hapModuleInfo.backgroundImg).assertEqual("");
......@@ -138,14 +145,14 @@ describe('ActsBmsHapModuleTest', function () {
expect(result.hapModuleInfos.length).assertEqual(1);
if (result.hapModuleInfos.length == 1) {
let hapModuleInfo = result.hapModuleInfos[0];
expect(hapModuleInfo.name).assertEqual(BUNDLE_NAME3);
expect(hapModuleInfo.name).assertEqual(THIRD_FIVE_HAP_NAME);
expect(hapModuleInfo.moduleName).assertEqual('entry');
expect(hapModuleInfo.description).assertEqual('');
expect(hapModuleInfo.descriptionId).assertEqual(0);
expect(hapModuleInfo.icon).assertEqual('');
expect(hapModuleInfo.icon).assertEqual(ICON);
expect(hapModuleInfo.label).assertEqual('$string:app_name');
expect(hapModuleInfo.labelId).assertEqual(0);
expect(hapModuleInfo.iconId).assertEqual(0);
expect(hapModuleInfo.labelId).assertEqual(LABEL_ID);
expect(hapModuleInfo.iconId).assertEqual(16777219);
expect(hapModuleInfo.backgroundImg).assertEqual("");
expect(hapModuleInfo.supportedModes).assertEqual(0);
expect(hapModuleInfo.reqCapabilities.length).assertEqual(0);
......@@ -174,14 +181,14 @@ describe('ActsBmsHapModuleTest', function () {
expect(data.hapModuleInfos.length).assertEqual(1);
if (data.hapModuleInfos.length == 1) {
let hapModuleInfo = data.hapModuleInfos[0];
expect(hapModuleInfo.name).assertEqual(BUNDLE_NAME5);
expect(hapModuleInfo.name).assertEqual(SYSTEM_ONE_HAP_NAME);
expect(hapModuleInfo.moduleName).assertEqual('entry');
expect(hapModuleInfo.description).assertEqual('');
expect(hapModuleInfo.descriptionId).assertEqual(0);
expect(hapModuleInfo.icon).assertEqual('');
expect(hapModuleInfo.icon).assertEqual(ICON);
expect(hapModuleInfo.label).assertEqual('$string:app_name');
expect(hapModuleInfo.labelId).assertEqual(0);
expect(hapModuleInfo.iconId).assertEqual(0);
expect(hapModuleInfo.labelId).assertEqual(LABEL_ID);
expect(hapModuleInfo.iconId).assertEqual(16777219);
expect(hapModuleInfo.backgroundImg).assertEqual("");
expect(hapModuleInfo.supportedModes).assertEqual(0);
expect(hapModuleInfo.reqCapabilities.length).assertEqual(0);
......@@ -200,9 +207,10 @@ describe('ActsBmsHapModuleTest', function () {
function checkHapMoudleInfos(info) {
expect(info.description).assertEqual('');
expect(info.descriptionId).assertEqual(0);
expect(info.icon).assertEqual('');
expect(info.labelId).assertEqual(0);
expect(info.iconId).assertEqual(0);
expect(info.icon).assertEqual(ICON);
expect(info.labelId).assertEqual(LABEL_ID);
expect(info.iconId).assertEqual(ICON_ID);
expect(info.label).assertEqual(LABEL);
expect(info.backgroundImg).assertEqual("");
expect(info.supportedModes).assertEqual(0);
expect(info.reqCapabilities.length).assertEqual(0);
......
......@@ -86,7 +86,7 @@ describe('ActsBundleManagerTest', function () {
expect(datainfo.targetVersion).assertEqual(5);
expect(datainfo.isCompressNativeLibs).assertEqual(true);
for (let s = 0; s < datainfo.hapModuleInfos.length; s++) {
expect(datainfo.hapModuleInfos[s].name).assertEqual("com.example.myapplication1");
expect(datainfo.hapModuleInfos[s].name).assertEqual("com.example.myapplication1.MyApplication1");
expect(datainfo.hapModuleInfos[s].moduleName).assertEqual("entry");
}
expect(datainfo.entryModuleName).assertEqual("entry");
......@@ -1235,7 +1235,7 @@ describe('ActsBundleManagerTest', function () {
expect(dataInfo.targetVersion).assertEqual(5);
expect(dataInfo.isCompressNativeLibs).assertEqual(true);
for (let s = 0; s < dataInfo.hapModuleInfos.length; s++) {
expect(dataInfo.hapModuleInfos[s].name).assertEqual("com.example.myapplication1");
expect(dataInfo.hapModuleInfos[s].name).assertEqual("com.example.myapplication1.MyApplication1");
expect(dataInfo.hapModuleInfos[s].moduleName).assertEqual("entry");
}
expect(dataInfo.entryModuleName).assertEqual("entry");
......@@ -1282,7 +1282,7 @@ describe('ActsBundleManagerTest', function () {
expect(dataInfo.targetVersion).assertEqual(5);
expect(dataInfo.isCompressNativeLibs).assertEqual(true);
for (let s = 0; s < dataInfo.hapModuleInfos.length; s++) {
expect(dataInfo.hapModuleInfos[s].name).assertEqual("com.example.myapplication1");
expect(dataInfo.hapModuleInfos[s].name).assertEqual("com.example.myapplication1.MyApplication1");
expect(dataInfo.hapModuleInfos[s].moduleName).assertEqual("entry");
}
expect(dataInfo.entryModuleName).assertEqual("entry");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册