Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
bd9b930a
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,发现更多精彩内容 >>
未验证
提交
bd9b930a
编写于
6月 20, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 20, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3584 新增未覆盖的api用例
Merge pull request !3584 from ry/OpenHarmony-3.1-Release
上级
055be1e8
94453df9
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
265 addition
and
67 deletion
+265
-67
appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js
...est/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js
+14
-14
appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
...etest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
+3
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsHasInstalldTest.test.js
...est/entry/src/main/js/test/ActsBmsHasInstalldTest.test.js
+165
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/List.test.js
...manager/actsbmsjstest/entry/src/main/js/test/List.test.js
+3
-1
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/GetAbilityLabelJsUnit.test.ets
.../main/ets/MainAbility/test/GetAbilityLabelJsUnit.test.ets
+6
-6
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+71
-46
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/config.json
...r/sceneProject/bmsgetinfosfifthscene/src/main/config.json
+1
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/config.json
.../sceneProject/bmsgetinfossecondscene/src/main/config.json
+1
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/config.json
...ceneProject/bmsmainabilityfirstscene/src/main/config.json
+1
-0
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js
浏览文件 @
bd9b930a
...
@@ -67,9 +67,9 @@ describe('ActsBmsAccessTokenTest', function () {
...
@@ -67,9 +67,9 @@ describe('ActsBmsAccessTokenTest', function () {
expect
(
bundleInfo
.
reqPermissions
[
1
]).
assertEqual
(
"
ohos.permission.BETA
"
);
expect
(
bundleInfo
.
reqPermissions
[
1
]).
assertEqual
(
"
ohos.permission.BETA
"
);
expect
(
bundleInfo
.
reqPermissions
[
2
]).
assertEqual
(
"
ohos.permission.KEEP_BACKGROUND_RUNNING
"
);
expect
(
bundleInfo
.
reqPermissions
[
2
]).
assertEqual
(
"
ohos.permission.KEEP_BACKGROUND_RUNNING
"
);
expect
(
bundleInfo
.
reqPermissionStates
.
length
).
assertEqual
(
3
);
expect
(
bundleInfo
.
reqPermissionStates
.
length
).
assertEqual
(
3
);
expect
(
bundleInfo
.
reqPermissionStates
[
0
]).
assertEqual
(
-
1
);
expect
(
bundleInfo
.
reqPermissionStates
[
0
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_DENIED
);
expect
(
bundleInfo
.
reqPermissionStates
[
1
]).
assertEqual
(
-
1
);
expect
(
bundleInfo
.
reqPermissionStates
[
1
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_DENIED
);
expect
(
bundleInfo
.
reqPermissionStates
[
2
]).
assertEqual
(
0
);
expect
(
bundleInfo
.
reqPermissionStates
[
2
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_GRANTED
);
done
();
done
();
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
expect
(
err
).
assertFail
();
expect
(
err
).
assertFail
();
...
@@ -93,11 +93,11 @@ describe('ActsBmsAccessTokenTest', function () {
...
@@ -93,11 +93,11 @@ describe('ActsBmsAccessTokenTest', function () {
expect
(
bundleInfo
.
reqPermissions
[
3
]).
assertEqual
(
"
ohos.permission.SYSTEM_FLOAT_WINDOW
"
);
expect
(
bundleInfo
.
reqPermissions
[
3
]).
assertEqual
(
"
ohos.permission.SYSTEM_FLOAT_WINDOW
"
);
expect
(
bundleInfo
.
reqPermissions
[
4
]).
assertEqual
(
"
ohos.permission.USE_BLUETOOTH
"
);
expect
(
bundleInfo
.
reqPermissions
[
4
]).
assertEqual
(
"
ohos.permission.USE_BLUETOOTH
"
);
expect
(
bundleInfo
.
reqPermissionStates
.
length
).
assertEqual
(
5
);
expect
(
bundleInfo
.
reqPermissionStates
.
length
).
assertEqual
(
5
);
expect
(
bundleInfo
.
reqPermissionStates
[
0
]).
assertEqual
(
-
1
);
expect
(
bundleInfo
.
reqPermissionStates
[
0
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_DENIED
);
expect
(
bundleInfo
.
reqPermissionStates
[
1
]).
assertEqual
(
0
);
expect
(
bundleInfo
.
reqPermissionStates
[
1
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_GRANTED
);
expect
(
bundleInfo
.
reqPermissionStates
[
2
]).
assertEqual
(
-
1
);
expect
(
bundleInfo
.
reqPermissionStates
[
2
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_DENIED
);
expect
(
bundleInfo
.
reqPermissionStates
[
3
]).
assertEqual
(
0
);
expect
(
bundleInfo
.
reqPermissionStates
[
3
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_GRANTED
);
expect
(
bundleInfo
.
reqPermissionStates
[
4
]).
assertEqual
(
0
);
expect
(
bundleInfo
.
reqPermissionStates
[
4
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_GRANTED
);
done
();
done
();
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
expect
(
err
).
assertFail
();
expect
(
err
).
assertFail
();
...
@@ -122,12 +122,12 @@ describe('ActsBmsAccessTokenTest', function () {
...
@@ -122,12 +122,12 @@ describe('ActsBmsAccessTokenTest', function () {
expect
(
bundleInfo
.
reqPermissions
[
4
]).
assertEqual
(
"
ohos.permission.SYSTEM_FLOAT_WINDOW
"
);
expect
(
bundleInfo
.
reqPermissions
[
4
]).
assertEqual
(
"
ohos.permission.SYSTEM_FLOAT_WINDOW
"
);
expect
(
bundleInfo
.
reqPermissions
[
5
]).
assertEqual
(
"
ohos.permission.USE_BLUETOOTH
"
);
expect
(
bundleInfo
.
reqPermissions
[
5
]).
assertEqual
(
"
ohos.permission.USE_BLUETOOTH
"
);
expect
(
bundleInfo
.
reqPermissionStates
.
length
).
assertEqual
(
6
);
expect
(
bundleInfo
.
reqPermissionStates
.
length
).
assertEqual
(
6
);
expect
(
bundleInfo
.
reqPermissionStates
[
0
]).
assertEqual
(
-
1
);
expect
(
bundleInfo
.
reqPermissionStates
[
0
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_DENIED
);
expect
(
bundleInfo
.
reqPermissionStates
[
1
]).
assertEqual
(
-
1
);
expect
(
bundleInfo
.
reqPermissionStates
[
1
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_DENIED
);
expect
(
bundleInfo
.
reqPermissionStates
[
2
]).
assertEqual
(
0
);
expect
(
bundleInfo
.
reqPermissionStates
[
2
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_GRANTED
);
expect
(
bundleInfo
.
reqPermissionStates
[
3
]).
assertEqual
(
-
1
);
expect
(
bundleInfo
.
reqPermissionStates
[
3
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_DENIED
);
expect
(
bundleInfo
.
reqPermissionStates
[
4
]).
assertEqual
(
0
);
expect
(
bundleInfo
.
reqPermissionStates
[
4
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_GRANTED
);
expect
(
bundleInfo
.
reqPermissionStates
[
5
]).
assertEqual
(
0
);
expect
(
bundleInfo
.
reqPermissionStates
[
5
]).
assertEqual
(
bundle
.
GrantStatus
.
PERMISSION_GRANTED
);
done
();
done
();
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
expect
(
err
).
assertFail
();
expect
(
err
).
assertFail
();
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
浏览文件 @
bd9b930a
...
@@ -57,6 +57,7 @@ describe('ActsBmsHapModuleTest', function () {
...
@@ -57,6 +57,7 @@ describe('ActsBmsHapModuleTest', function () {
expect
(
hapModuleInfo
.
extensionAbilityInfo
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
extensionAbilityInfo
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
metadata
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
metadata
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
installationFree
).
assertEqual
(
false
);
expect
(
hapModuleInfo
.
installationFree
).
assertEqual
(
false
);
expect
(
hapModuleInfo
.
colorMode
).
assertEqual
(
bundle
.
ColorMode
.
AUTO_MODE
);
done
();
done
();
}
}
}
}
...
@@ -121,6 +122,7 @@ describe('ActsBmsHapModuleTest', function () {
...
@@ -121,6 +122,7 @@ describe('ActsBmsHapModuleTest', function () {
expect
(
hapModuleInfo
.
extensionAbilityInfo
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
extensionAbilityInfo
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
metadata
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
metadata
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
installationFree
).
assertEqual
(
false
);
expect
(
hapModuleInfo
.
installationFree
).
assertEqual
(
false
);
expect
(
hapModuleInfo
.
colorMode
).
assertEqual
(
bundle
.
ColorMode
.
DARK_MODE
);
done
();
done
();
}
}
});
});
...
@@ -156,6 +158,7 @@ describe('ActsBmsHapModuleTest', function () {
...
@@ -156,6 +158,7 @@ describe('ActsBmsHapModuleTest', function () {
expect
(
hapModuleInfo
.
extensionAbilityInfo
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
extensionAbilityInfo
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
metadata
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
metadata
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
installationFree
).
assertEqual
(
false
);
expect
(
hapModuleInfo
.
installationFree
).
assertEqual
(
false
);
expect
(
hapModuleInfo
.
colorMode
).
assertEqual
(
bundle
.
ColorMode
.
LIGHT_MODE
);
done
();
done
();
}
}
});
});
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsHasInstalldTest.test.js
0 → 100644
浏览文件 @
bd9b930a
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
pkg
from
'
@system.package
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
NUM_TWO
=
2
;
const
ERR_CODE
=
202
;
const
ERR_MERSSAGE
=
'
value is not an available number
'
;
describe
(
'
ActsBmsHasInstalldTest
'
,
function
()
{
/**
* @tc.number hasInstalled_0100
* @tc.name Package::hasInstalled
* @tc.desc Test hasInstalled interface.
*/
it
(
'
hasInstalled_0100
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
'
com.ohos.launcher
'
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success function in
'
);
expect
(
data
.
result
).
assertTrue
();
done
();
},
fail
:
function
fail
(
data
,
code
)
{
console
.
info
(
'
hasInstalled fail function in
'
);
expect
().
assertFail
();
done
();
},
complete
:
function
complete
()
{
console
.
info
(
'
hasInstalled complete function in
'
);
expect
().
assertFail
();
done
();
}
});
});
/**
* @tc.number hasInstalled_0200
* @tc.name Package::hasInstalled
* @tc.desc Test hasInstalled interface.
*/
it
(
'
hasInstalled_0200
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
'
wrongName
'
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success function in
'
);
expect
(
data
.
result
).
assertFalse
();
done
();
},
fail
:
function
fail
(
data
,
code
)
{
console
.
info
(
'
hasInstalled fail function in
'
);
expect
().
assertFail
();
done
();
},
complete
:
function
complete
()
{
console
.
info
(
'
hasInstalled complete function in
'
);
expect
().
assertFail
();
done
();
}
});
});
/**
* @tc.number hasInstalled_0300
* @tc.name Package::hasInstalled
* @tc.desc Test hasInstalled interface.
*/
it
(
'
hasInstalled_0300
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
'
wrongName
'
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success function in
'
);
expect
(
data
.
result
).
assertFalse
();
done
();
}
});
});
/**
* @tc.number hasInstalled_0400
* @tc.name Package::hasInstalled
* @tc.desc Test hasInstalled interface.
*/
it
(
'
hasInstalled_0400
'
,
0
,
async
function
(
done
)
{
let
flag
=
0
;
pkg
.
hasInstalled
({
bundleName
:
NUM_TWO
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success function in
'
);
expect
().
assertFail
();
done
();
},
fail
:
function
fail
(
data
,
code
)
{
flag
+=
2
;
console
.
info
(
'
hasInstalled fail function in
'
);
expect
(
data
).
assertEqual
(
ERR_MERSSAGE
);
expect
(
code
).
assertEqual
(
ERR_CODE
);
},
complete
:
function
complete
()
{
flag
+=
3
;
console
.
info
(
'
hasInstalled complete function in
'
);
expect
(
flag
).
assertEqual
(
5
)
done
();
}
});
});
/*
* @tc.number: hasInstalled_0500
* @tc.name: test hasInstalled bundleName is number
* @tc.desc: test hasInstalled bundleName is number without function fail
* @tc.level 3
*/
it
(
'
hasInstalled_0500
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
NUM_TWO
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success
'
+
JSON
.
stringify
(
data
));
expect
(
error
).
assertFail
();
done
();
},
complete
:
function
complete
()
{
console
.
info
(
'
hasInstalled complete
'
);
done
();
}
})
});
/*
* @tc.number: hasInstalled_0600
* @tc.name: test hasInstalled bundleName is number
* @tc.desc: test hasInstalled bundleName is number without function complete
* @tc.level 3
*/
it
(
'
hasInstalled_0600
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
NUM_TWO
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success
'
+
JSON
.
stringify
(
data
));
expect
(
error
).
assertFail
();
done
();
},
fail
:
function
fail
(
data
,
code
)
{
console
.
info
(
'
hasInstalled fail
'
);
expect
(
data
).
assertEqual
(
"
value is not an available number
"
);
expect
(
code
).
assertEqual
(
202
);
done
();
}
})
});
})
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/List.test.js
浏览文件 @
bd9b930a
...
@@ -12,4 +12,6 @@
...
@@ -12,4 +12,6 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
require
(
'
./ActsBmsJsTest.test.js
'
)
\ No newline at end of file
require
(
'
./ActsBmsJsTest.test.js
'
)
require
(
'
./ActsBmsHasInstalldTest.test.js
'
)
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/GetAbilityLabelJsUnit.test.ets
浏览文件 @
bd9b930a
...
@@ -78,7 +78,7 @@ export default function getAbilityLabelJsUnit() {
...
@@ -78,7 +78,7 @@ export default function getAbilityLabelJsUnit() {
*/
*/
it('getAbilityLabel_test_0300', 0, async function (done) {
it('getAbilityLabel_test_0300', 0, async function (done) {
await Bundle.getAbilityLabel(BUNDLE_NAME, SERVICE_ABILITY_NAME).then((data) => {
await Bundle.getAbilityLabel(BUNDLE_NAME, SERVICE_ABILITY_NAME).then((data) => {
expect(
error
).assertFail();
expect(
data
).assertFail();
}).catch((error) => {
}).catch((error) => {
expect(error).assertEqual(1);
expect(error).assertEqual(1);
});
});
...
@@ -97,14 +97,14 @@ export default function getAbilityLabelJsUnit() {
...
@@ -97,14 +97,14 @@ export default function getAbilityLabelJsUnit() {
it('getAbilityLabel_test_0400', 0, async function (done) {
it('getAbilityLabel_test_0400', 0, async function (done) {
let timeOldStamp = await Utils.getNowTime();
let timeOldStamp = await Utils.getNowTime();
await Bundle.getAbilityLabel(BUNDLE_NAME_ERROR, ABILITY_NAME_ERROR).then((data) => {
await Bundle.getAbilityLabel(BUNDLE_NAME_ERROR, ABILITY_NAME_ERROR).then((data) => {
expect(
error
).assertFail();
expect(
data
).assertFail();
}).catch((error) => {
}).catch((error) => {
let timeNewStamp = Utils.getNowTime();
let timeNewStamp = Utils.getNowTime();
Utils.getDurationTime('[getAbilityLabel_test_0400]', timeOldStamp, timeNewStamp);
Utils.getDurationTime('[getAbilityLabel_test_0400]', timeOldStamp, timeNewStamp);
expect(error).assertEqual(1);
expect(error).assertEqual(1);
});
});
await Bundle.getAbilityLabel("", "").then((data) => {
await Bundle.getAbilityLabel("", "").then((data) => {
expect(
error
).assertFail();
expect(
data
).assertFail();
}).catch((error) => {
}).catch((error) => {
expect(error).assertEqual(1);
expect(error).assertEqual(1);
});
});
...
@@ -129,17 +129,17 @@ export default function getAbilityLabelJsUnit() {
...
@@ -129,17 +129,17 @@ export default function getAbilityLabelJsUnit() {
*/
*/
it('getAbilityLabel_test_0500', 0, async function (done) {
it('getAbilityLabel_test_0500', 0, async function (done) {
await Bundle.getAbilityLabel(undefined, OTHER_ABILITY_NAME).then((data) => {
await Bundle.getAbilityLabel(undefined, OTHER_ABILITY_NAME).then((data) => {
expect(
error
).assertFail();
expect(
data
).assertFail();
}).catch((error) => {
}).catch((error) => {
expect(error).assertEqual(2);
expect(error).assertEqual(2);
});
});
await Bundle.getAbilityLabel(OTHER_BUNDLE_NAME, undefined).then((data) => {
await Bundle.getAbilityLabel(OTHER_BUNDLE_NAME, undefined).then((data) => {
expect(
error
).assertFail();
expect(
data
).assertFail();
}).catch((error) => {
}).catch((error) => {
expect(error).assertEqual(2);
expect(error).assertEqual(2);
});
});
await Bundle.getAbilityLabel(undefined, undefined).then((data) => {
await Bundle.getAbilityLabel(undefined, undefined).then((data) => {
expect(
error
).assertFail();
expect(
data
).assertFail();
}).catch((error) => {
}).catch((error) => {
expect(error).assertEqual(2);
expect(error).assertEqual(2);
});
});
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
bd9b930a
...
@@ -107,7 +107,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -107,7 +107,8 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfo interfaces with one hap.
* @tc.desc Test getBundleInfo interfaces with one hap.
*/
*/
it
(
'
getBundleInfo_0600
'
,
0
,
async
function
(
done
)
{
it
(
'
getBundleInfo_0600
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
OnReceiveEvent
);
await
demo
.
getBundleInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
|
demo
.
BundleFlag
.
GET_ABILITY_INFO_WITH_DISABLE
,
OnReceiveEvent
);
function
OnReceiveEvent
(
err
,
datainfo
)
{
function
OnReceiveEvent
(
err
,
datainfo
)
{
console
.
info
(
"
getBundleInfo_0600 dataInfo ====
"
+
datainfo
);
console
.
info
(
"
getBundleInfo_0600 dataInfo ====
"
+
datainfo
);
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
);
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
);
...
@@ -234,7 +235,6 @@ describe('ActsBundleManagerTest', function () {
...
@@ -234,7 +235,6 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
[
i
].
moduleInfos
[
j
].
moduleSourceDir
.
length
).
assertLarger
(
0
);
expect
(
datainfo
[
i
].
moduleInfos
[
j
].
moduleSourceDir
.
length
).
assertLarger
(
0
);
}
}
}
}
}
}
/**
/**
...
@@ -1074,7 +1074,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1074,7 +1074,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
icon
).
assertEqual
(
"
$media:icon
"
);
expect
(
datainfo
.
icon
).
assertEqual
(
"
$media:icon
"
);
expect
(
datainfo
.
moduleName
).
assertEqual
(
"
entry
"
);
expect
(
datainfo
.
moduleName
).
assertEqual
(
"
entry
"
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME2
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME2
);
expect
(
datainfo
.
orientation
).
assertEqual
(
1
);
expect
(
datainfo
.
orientation
).
assertEqual
(
demo
.
DisplayOrientation
.
LANDSCAPE
);
expect
(
datainfo
.
launchMode
).
assertEqual
(
demo
.
LaunchMode
.
SINGLETON
);
expect
(
datainfo
.
launchMode
).
assertEqual
(
demo
.
LaunchMode
.
SINGLETON
);
expect
(
datainfo
.
applicationInfo
.
name
).
assertEqual
(
NAME2
);
expect
(
datainfo
.
applicationInfo
.
name
).
assertEqual
(
NAME2
);
expect
(
datainfo
.
applicationInfo
.
description
).
assertEqual
(
APPLICATION_DESCRIPTION
);
expect
(
datainfo
.
applicationInfo
.
description
).
assertEqual
(
APPLICATION_DESCRIPTION
);
...
@@ -1103,52 +1103,58 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1103,52 +1103,58 @@ describe('ActsBundleManagerTest', function () {
await
demo
.
queryAbilityByWant
({
await
demo
.
queryAbilityByWant
({
entities
:
[
'
entity.system.home
'
,
'
entitiesentities
'
]
entities
:
[
'
entity.system.home
'
,
'
entitiesentities
'
]
},
4
,
userId
).
then
(
data
=>
{
},
4
,
userId
).
then
(
data
=>
{
let
queryResultCount
=
0
;
checkAbilityInfos
(
data
);
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
let
datainfo
=
data
[
i
];
if
(
datainfo
.
bundleName
==
NAME3
)
{
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
);
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
);
expect
(
datainfo
.
description
).
assertEqual
(
DESCRIPTION
);
expect
(
datainfo
.
icon
).
assertEqual
(
"
$media:icon
"
);
expect
(
datainfo
.
moduleName
).
assertEqual
(
"
entry
"
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME3
);
expect
(
datainfo
.
applicationInfo
.
name
).
assertEqual
(
NAME3
);
expect
(
datainfo
.
applicationInfo
.
description
).
assertEqual
(
APPLICATION_DESCRIPTION
);
expect
(
datainfo
.
applicationInfo
.
descriptionId
>=
0
).
assertTrue
();
expect
(
datainfo
.
applicationInfo
.
icon
).
assertEqual
(
"
$media:icon
"
);
expect
(
datainfo
.
applicationInfo
.
iconId
>=
0
).
assertTrue
();
expect
(
datainfo
.
applicationInfo
.
label
).
assertEqual
(
"
$string:app_name
"
);
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
();
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
true
);
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
datainfo
.
orientation
).
assertEqual
(
2
);
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
);
for
(
let
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
.
length
;
j
++
)
{
expect
(
datainfo
.
applicationInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
);
}
queryResultCount
++
;
}
if
(
datainfo
.
bundleName
==
NAME4
)
{
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME4
);
expect
(
datainfo
.
orientation
).
assertEqual
(
3
);
queryResultCount
++
;
}
if
(
datainfo
.
bundleName
==
NAME5
)
{
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME5
);
expect
(
datainfo
.
orientation
).
assertEqual
(
0
);
queryResultCount
++
;
}
}
expect
(
queryResultCount
).
assertEqual
(
3
);
done
();
done
();
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
expect
(
err
).
assertFail
();
expect
(
err
).
assertFail
();
done
();
done
();
})
})
})
})
function
checkAbilityInfos
(
data
)
{
let
queryResultCount
=
0
;
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
let
datainfo
=
data
[
i
];
if
(
datainfo
.
bundleName
==
NAME3
)
{
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
);
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
);
expect
(
datainfo
.
description
).
assertEqual
(
DESCRIPTION
);
expect
(
datainfo
.
icon
).
assertEqual
(
"
$media:icon
"
);
expect
(
datainfo
.
moduleName
).
assertEqual
(
"
entry
"
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME3
);
expect
(
datainfo
.
type
).
assertEqual
(
demo
.
AbilityType
.
PAGE
);
expect
(
datainfo
.
applicationInfo
.
name
).
assertEqual
(
NAME3
);
expect
(
datainfo
.
applicationInfo
.
description
).
assertEqual
(
DESCRIPTION
);
expect
(
datainfo
.
applicationInfo
.
descriptionId
>=
0
).
assertTrue
();
expect
(
datainfo
.
applicationInfo
.
icon
).
assertEqual
(
"
$media:icon
"
);
expect
(
datainfo
.
applicationInfo
.
iconId
>=
0
).
assertTrue
();
expect
(
datainfo
.
applicationInfo
.
label
).
assertEqual
(
"
$string:app_name
"
);
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
();
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
true
);
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
datainfo
.
orientation
).
assertEqual
(
demo
.
DisplayOrientation
.
PORTRAIT
);
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
);
for
(
let
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
.
length
;
j
++
)
{
expect
(
datainfo
.
applicationInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
);
}
queryResultCount
++
;
}
if
(
datainfo
.
bundleName
==
NAME4
)
{
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
);
expect
(
datainfo
.
type
).
assertEqual
(
demo
.
AbilityType
.
DATA
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME4
);
expect
(
datainfo
.
orientation
).
assertEqual
(
demo
.
DisplayOrientation
.
FOLLOW_RECENT
);
queryResultCount
++
;
}
if
(
datainfo
.
bundleName
==
NAME5
)
{
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
);
expect
(
datainfo
.
type
).
assertEqual
(
demo
.
AbilityType
.
PAGE
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME5
);
expect
(
datainfo
.
orientation
).
assertEqual
(
demo
.
DisplayOrientation
.
UNSPECIFIED
);
queryResultCount
++
;
}
}
expect
(
queryResultCount
).
assertEqual
(
3
);
}
/**
/**
* @tc.number queryAbilityByWant_0400
* @tc.number queryAbilityByWant_0400
...
@@ -1347,8 +1353,26 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1347,8 +1353,26 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test install errcode STATUS_FAILED_NO_SPACE_LEFT.
* @tc.desc Test install errcode STATUS_FAILED_NO_SPACE_LEFT.
*/
*/
it
(
'
installErrCodeTest_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
installErrCodeTest_0100
'
,
0
,
async
function
(
done
)
{
expect
(
demo
.
InstallErrorCode
.
SUCCESS
).
assertEqual
(
0
);
expect
(
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE
).
assertEqual
(
1
);
expect
(
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_ABORTED
).
assertEqual
(
2
);
expect
(
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_INVALID
).
assertEqual
(
3
);
expect
(
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_CONFLICT
).
assertEqual
(
4
);
expect
(
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_STORAGE
).
assertEqual
(
5
);
expect
(
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_INCOMPATIBLE
).
assertEqual
(
6
);
expect
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE
).
assertEqual
(
7
);
expect
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE_BLOCKED
).
assertEqual
(
8
);
expect
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE_ABORTED
).
assertEqual
(
9
);
expect
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE_CONFLICT
).
assertEqual
(
10
);
expect
(
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT
).
assertEqual
(
11
);
expect
(
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED
).
assertEqual
(
12
);
expect
(
demo
.
InstallErrorCode
.
STATUS_RECOVER_FAILURE_INVALID
).
assertEqual
(
13
);
expect
(
demo
.
InstallErrorCode
.
STATUS_ABILITY_NOT_FOUND
).
assertEqual
(
64
);
expect
(
demo
.
InstallErrorCode
.
STATUS_BMS_SERVICE_ERROR
).
assertEqual
(
65
);
expect
(
demo
.
InstallErrorCode
.
STATUS_FAILED_NO_SPACE_LEFT
).
assertEqual
(
66
);
expect
(
demo
.
InstallErrorCode
.
STATUS_FAILED_NO_SPACE_LEFT
).
assertEqual
(
66
);
expect
(
demo
.
AbilitySubType
.
CA
).
assertEqual
(
1
);
expect
(
demo
.
InstallErrorCode
.
STATUS_GRANT_REQUEST_PERMISSIONS_FAILED
).
assertEqual
(
67
);
expect
(
demo
.
InstallErrorCode
.
STATUS_INSTALL_PERMISSION_DENIED
).
assertEqual
(
68
);
expect
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_PERMISSION_DENIED
).
assertEqual
(
69
);
done
();
done
();
})
})
...
@@ -1357,8 +1381,9 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1357,8 +1381,9 @@ describe('ActsBundleManagerTest', function () {
* @tc.name InstallErrorCode::STATUS_FAILED_NO_SPACE_LEFT
* @tc.name InstallErrorCode::STATUS_FAILED_NO_SPACE_LEFT
* @tc.desc Test install errcode STATUS_FAILED_NO_SPACE_LEFT.
* @tc.desc Test install errcode STATUS_FAILED_NO_SPACE_LEFT.
*/
*/
it
(
'
installErrCodeTest_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
AbilityTypeTest_0100
'
,
0
,
async
function
(
done
)
{
expect
(
demo
.
InstallErrorCode
.
STATUS_GRANT_REQUEST_PERMISSIONS_FAILED
).
assertEqual
(
67
);
expect
(
demo
.
AbilitySubType
.
CA
).
assertEqual
(
1
);
expect
(
demo
.
AbilityType
.
UNKNOWN
).
assertEqual
(
0
);
done
();
done
();
})
})
})
})
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/config.json
浏览文件 @
bd9b930a
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
},
},
"deviceConfig"
:
{},
"deviceConfig"
:
{},
"module"
:
{
"module"
:
{
"colorMode"
:
"light"
,
"package"
:
"com.example.third5"
,
"package"
:
"com.example.third5"
,
"name"
:
".BmsThirdBundle5"
,
"name"
:
".BmsThirdBundle5"
,
"mainAbility"
:
"com.example.third5.AMainAbility"
,
"mainAbility"
:
"com.example.third5.AMainAbility"
,
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/config.json
浏览文件 @
bd9b930a
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
},
},
"deviceConfig"
:
{},
"deviceConfig"
:
{},
"module"
:
{
"module"
:
{
"colorMode"
:
"dark"
,
"package"
:
"com.example.third2"
,
"package"
:
"com.example.third2"
,
"name"
:
".MyApplication"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"deviceType"
:
[
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/config.json
浏览文件 @
bd9b930a
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
},
},
"deviceConfig"
:
{},
"deviceConfig"
:
{},
"module"
:
{
"module"
:
{
"colorMode"
:
"auto"
,
"package"
:
"com.example.bmsmainabilityfirstscene"
,
"package"
:
"com.example.bmsmainabilityfirstscene"
,
"mainAbility"
:
"com.example.bmsmainabilityfirstscene.MainAbility"
,
"mainAbility"
:
"com.example.bmsmainabilityfirstscene.MainAbility"
,
"name"
:
".MyApplication"
,
"name"
:
".MyApplication"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录