Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
12a42860
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,发现更多精彩内容 >>
提交
12a42860
编写于
7月 04, 2022
作者:
I
inter515
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改编译问题
Signed-off-by:
N
inter515
<
ry.renyi@huawei.com
>
上级
22214bca
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
58 addition
and
84 deletion
+58
-84
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/pages/index.ets
...geretstest/entry/src/main/ets/MainAbility/pages/index.ets
+1
-1
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/GetAbilityLabelJsUnit.test.ets
.../main/ets/MainAbility/test/GetAbilityLabelJsUnit.test.ets
+1
-1
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/GetabilityInfo.test.ets
...try/src/main/ets/MainAbility/test/GetabilityInfo.test.ets
+1
-1
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/IsAbilityEnabledETSUnit.ets
...src/main/ets/MainAbility/test/IsAbilityEnabledETSUnit.ets
+51
-13
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/IsApplicationEnabledETSUnit.ets
...main/ets/MainAbility/test/IsApplicationEnabledETSUnit.ets
+1
-1
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/getAllApplicationInfoJsunit.test.ets
...ets/MainAbility/test/getAllApplicationInfoJsunit.test.ets
+1
-45
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/getApplicationInfoJsunit.test.ets
...in/ets/MainAbility/test/getApplicationInfoJsunit.test.ets
+1
-21
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssceneeight/src/main/js/default/pages/index/index.js
...ct/bmssceneeight/src/main/js/default/pages/index/index.js
+1
-1
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/pages/index.ets
浏览文件 @
12a42860
...
...
@@ -15,7 +15,7 @@
import
router
from
'@system.router'
;
import
file
from
'@system.file'
;
import
{
Core
,
ExpectExtend
,
InstrumentLog
,
ReportExtend
}
from
"deccjsunit/index
.ets
"
;
import
{
Core
,
ExpectExtend
,
InstrumentLog
,
ReportExtend
}
from
"deccjsunit/index"
;
import
testsuite
from
"../test/List.test.ets"
;
import
featureAbility
from
"@ohos.ability.featureAbility"
;
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/GetAbilityLabelJsUnit.test.ets
浏览文件 @
12a42860
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, it, expect } from 'deccjsunit/index
.ets
';
import { describe, it, expect } from 'deccjsunit/index';
import Utils from './Utils';
import Bundle from '@ohos.bundle';
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/GetabilityInfo.test.ets
浏览文件 @
12a42860
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
{
describe
,
it
,
expect
}
from
'deccjsunit/index
.ets
'
;
import
{
describe
,
it
,
expect
}
from
'deccjsunit/index'
;
import
Utils
from
'./Utils'
;
import
bundleManager
from
'@ohos.bundle'
;
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/IsAbilityEnabledETSUnit.ets
浏览文件 @
12a42860
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, it, expect } from 'deccjsunit/index
.ets
';
import { describe, it, expect } from 'deccjsunit/index';
import Utils from './Utils';
import Bundle from '@ohos.bundle';
...
...
@@ -20,14 +20,6 @@ const BUNDLE_NAME = 'com.open.harmony.packagemag';
const BUNDLE_NAME_ERROR = 'com.ohos.acepackage.error';
const ABILITY_NAME = 'com.open.harmony.packagemag.MainAbility';
const ABILITY_NAME_ERROR = 'com.ohos.acepackage.error.MainAbility';
const ABILITY = {
bundleName: BUNDLE_NAME,
name: ABILITY_NAME
}
const ABILITY_ERROR = {
bundleName: BUNDLE_NAME_ERROR,
name: ABILITY_NAME_ERROR
}
export default function isAbilityEnabledETSUnit() {
...
...
@@ -40,9 +32,10 @@ export default function isAbilityEnabledETSUnit() {
* @tc.level 0
*/
it('isAbilityEnabled_test_0100', 0, async function (done) {
let abilityInfo = generateAbilityInfoForTest(BUNDLE_NAME,ABILITY_NAME);
let timeOldStamp = await Utils.getNowTime();
let mData;
await Bundle.isAbilityEnabled(
ABILITY
).then((data) => {
await Bundle.isAbilityEnabled(
abilityInfo
).then((data) => {
let timeNewStamp = Utils.getNowTime();
Utils.getDurationTime('[isAbilityEnabled_test_0100]', timeOldStamp, timeNewStamp);
mData = data;
...
...
@@ -62,9 +55,10 @@ export default function isAbilityEnabledETSUnit() {
* @tc.level 0
*/
it('isAbilityEnabled_test_0200', 0, async function (done) {
let abilityInfo = generateAbilityInfoForTest(BUNDLE_NAME,ABILITY_NAME);
let timeOldStamp = await Utils.getNowTime();
let mData;
Bundle.isAbilityEnabled(
ABILITY
, (error, data) => {
Bundle.isAbilityEnabled(
abilityInfo
, (error, data) => {
if (error) {
console.error('[isAbilityEnabled_test_0200]Operation failed. Cause: ' + JSON.stringify(error));
expect(error).assertFail();
...
...
@@ -86,9 +80,10 @@ export default function isAbilityEnabledETSUnit() {
* @tc.level 0
*/
it('isAbilityEnabled_test_0300', 0, async function (done) {
let abilityInfo = generateAbilityInfoForTest(BUNDLE_NAME_ERROR,ABILITY_NAME_ERROR);
let timeOldStamp = await Utils.getNowTime();
let mData;
await Bundle.isAbilityEnabled(
ABILITY_ERROR
).then((data) => {
await Bundle.isAbilityEnabled(
abilityInfo
).then((data) => {
let timeNewStamp = Utils.getNowTime();
Utils.getDurationTime('[isAbilityEnabled_test_0300]', timeOldStamp, timeNewStamp);
mData = data;
...
...
@@ -110,9 +105,10 @@ export default function isAbilityEnabledETSUnit() {
* @tc.level 0
*/
it('isAbilityEnabled_test_0400', 0, async function (done) {
let abilityInfo = generateAbilityInfoForTest(BUNDLE_NAME_ERROR,ABILITY_NAME_ERROR);
let timeOldStamp = await Utils.getNowTime();
let mData;
Bundle.isAbilityEnabled(
ABILITY_ERROR
, (error, data) => {
Bundle.isAbilityEnabled(
abilityInfo
, (error, data) => {
if (error) {
console.error('[isAbilityEnabled_test_0400]Operation failed. Cause: ' + JSON.stringify(error));
expect(error).assertFail();
...
...
@@ -144,6 +140,48 @@ export default function isAbilityEnabledETSUnit() {
expect(data).assertEqual(false);
}
function generateAbilityInfoForTest(bundleName, name) {
let map1 = new Map([
["", [{
"name": "", "value": "", "extra": ""
}]]
]);
let abilityInfo = {
bundleName: bundleName,
name: name,
label: "",
description: "",
icon: "",
labelId: 0,
descriptionId: 0,
iconId: 0,
moduleName: "",
process: "",
targetAbility: "",
backgroundModes: 0,
isVisible: true,
formEnabled: true,
type: 0,
subType: 0,
orientation: 0,
launchMode: 0,
permissions: [],
deviceTypes: [],
deviceCapabilities: [],
readPermission: "",
writePermission: "",
applicationInfo: {
name: "", description: "", descriptionId: 0, systemApp: true, enabled: true, label: "",
labelId: "", icon: "", iconId: "", process: "", supportedModes: 0, moduleSourceDirs: [],
permissions: [], moduleInfos: [], entryDir: "", codePath: "", metaData: map1,
removable: true, accessTokenId: 0, uid: 0, entityType: ""
},
uri: "", metaData: [], enabled: true
};
return abilityInfo;
}
})
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/IsApplicationEnabledETSUnit.ets
浏览文件 @
12a42860
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, it, expect } from 'deccjsunit/index
.ets
';
import { describe, it, expect } from 'deccjsunit/index';
import Utils from './Utils';
import Bundle from '@ohos.bundle';
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/getAllApplicationInfoJsunit.test.ets
浏览文件 @
12a42860
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll ,it, expect } from 'deccjsunit/index
.ets
';
import { describe, beforeAll ,it, expect } from 'deccjsunit/index';
import Utils from './Utils';
import Bundle from '@ohos.bundle';
import account from '@ohos.account.osAccount';
...
...
@@ -226,50 +226,6 @@ export default function applicationBundleJsunit() {
done();
});
/**
* @tc.number: bundle_getApplicationInfo_test_0500_009
* @tc.name: getApplicationInfo : Obtains based on a given bundle name.
* @tc.desc: Check the return value of the interface (by promise)
* @tc.level 0
*/
it(TAG_TEST_0500_001, 0, async function (done) {
let errors;
let startTime = await Utils.getNowTime();
await Bundle.getAllApplicationInfo('Bundle.BundleFlag.GET_BUNDLE_DEFAULT').then((data) => {
console.info(TAG_TEST_0500_001 + 'noUserId promise data is: ' + data);
expect(data).assertFail();
}).catch((error) => {
console.info(TAG_TEST_0500_001 + 'noUserId promise error is: ' + error);
errors = error;
expect(errors).assertEqual(1);
});
let endTime = Utils.getNowTime();
Utils.getDurationTime(TAG_TEST_0500_001, startTime, endTime);
done();
});
/**
* @tc.number: bundle_getApplicationInfo_test_0500_0010
* @tc.name: getApplicationInfo : Obtains based on a given bundle name.
* @tc.desc: Check the return value of the interface (by promise)
* @tc.level 0
*/
it(TAG_TEST_0500_002, 0, async function (done) {
let errors;
let startTime = await Utils.getNowTime();
await Bundle.getAllApplicationInfo('Bundle.BundleFlag.GET_BUNDLE_DEFAULT', userId).then((data) => {
console.info(TAG_TEST_0500_002 + 'noUserId promise data is: ' + data);
expect(data).assertFail();
}).catch((error) => {
console.info(TAG_TEST_0500_002 + 'UserId promise error is: ' + error);
errors = error;
expect(errors).assertEqual(1);
});
let endTime = Utils.getNowTime();
Utils.getDurationTime(TAG_TEST_0500_002, startTime, endTime);
done();
});
function expectData(msg, data) {
console.info(msg + 'commonTest data length [' + data.length + ']');
for (let i = 0; i < data.length; i++) {
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/getApplicationInfoJsunit.test.ets
浏览文件 @
12a42860
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, it, beforeAll, expect } from 'deccjsunit/index
.ets
';
import { describe, it, beforeAll, expect } from 'deccjsunit/index';
import Utils from './Utils';
import Bundle from '@ohos.bundle';
import account from '@ohos.account.osAccount';
...
...
@@ -254,26 +254,6 @@ export default function applicationBundleJsunit() {
done();
});
/**
* @tc.number: bundle_getApplicationInfo_test_0500_002
* @tc.name: getApplicationInfo : Obtains based on a given bundle name.
* @tc.desc: Check the return value of the interface (by promise)
* @tc.level 0
*/
it(TAG_TEST_0500_002, 0, async function (done) {
let startTime = await Utils.getNowTime();
await Bundle.getApplicationInfo('', 'Bundle.BundleFlag.GET_BUNDLE_DEFAULT', userId).then((data) => {
console.info(TAG_TEST_0500_002 + 'UserId promise data is: ' + data);
expect(data).assertFail();
}).catch((error) => {
console.info(TAG_TEST_0500_002 + 'UserId promise error is: ' + error);
expect(error).assertEqual(1);
});
let endTime = Utils.getNowTime();
Utils.getDurationTime(TAG_TEST_0500_002, startTime, endTime);
done();
});
/**
* @tc.number: bundle_getApplicationInfo_test_0600_001
* @tc.name: getApplicationInfo : Obtains based on a given bundle name.
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssceneeight/src/main/js/default/pages/index/index.js
浏览文件 @
12a42860
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
commonEvent
from
'
@ohos.common
e
vent
'
import
commonEvent
from
'
@ohos.common
E
vent
'
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录