提交 3e3c5ee9 编写于 作者: S SoftSquirrel

Issue: #I5NDLC

Description: change GetMediaById to GetMediaDataById
Sig: SIG_ApplicaitonFramework
Feature or Bugfix: Feature
Binary Source: No
Signed-off-by: NSoftSquirrel <xuhao47@huawei.com>
上级 81693e90
...@@ -379,17 +379,18 @@ export default function getProfileByAbility() { ...@@ -379,17 +379,18 @@ export default function getProfileByAbility() {
/* /*
* @tc.number: getProfileByAbility_2200 * @tc.number: getProfileByAbility_2200
* @tc.name: getProfileByAbility : The profile is obtained by specified ability * @tc.name: getProfileByAbility : The profile is obtained by specified ability
* @tc.desc: profile is not json-format (by promise) * @tc.desc: profile is .txt (by promise)
* @tc.level 0 * @tc.level 0
*/ */
it('getProfileByAbility_2200', 0, async function (done) { it('getProfileByAbility_2200', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => { await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => {
console.info('[getProfileByAbility_2200] getApplicationInfo callback data is: ' + JSON.stringify(data)); console.info('[getProfileByAbility_2200] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(data).assertFail() expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
done(); done();
}).catch(err => { }).catch(err => {
console.error('[getProfileByAbility_2200]Operation failed. Cause: ' + JSON.stringify(err)); console.error('[getProfileByAbility_2200]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1); expect().assertFail();
done(); done();
}) })
}) })
...@@ -397,18 +398,18 @@ export default function getProfileByAbility() { ...@@ -397,18 +398,18 @@ export default function getProfileByAbility() {
/* /*
* @tc.number: getProfileByAbility_2300 * @tc.number: getProfileByAbility_2300
* @tc.name: getProfileByAbility : The profile is obtained by specified ability * @tc.name: getProfileByAbility : The profile is obtained by specified ability
* @tc.desc: profile is not json-format (by callback) * @tc.desc: profile is .txt (by callback)
* @tc.level 0 * @tc.level 0
*/ */
it('getProfileByAbility_2300', 0, async function (done) { it('getProfileByAbility_2300', 0, async function (done) {
bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => { bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => {
if (err) { if (err) {
console.error('[getProfileByAbility_2300]Operation failed. Cause: ' + JSON.stringify(err)); console.error('[getProfileByAbility_2300]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1); expect().assertFail();
} }
console.info('[getProfileByAbility_2300] getApplicationInfo callback data is: ' + JSON.stringify(data)); console.info('[getProfileByAbility_2300] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string"); expect(Array.isArray(data)).assertTrue();
expect(data).assertEqual("GetProfile failed"); expect(typeof data[0]).assertEqual("string");
done(); done();
}); });
}) })
......
...@@ -379,17 +379,18 @@ export default function getProfileByExtensionAbility() { ...@@ -379,17 +379,18 @@ export default function getProfileByExtensionAbility() {
/* /*
* @tc.number: getProfileByExtensionAbility_2200 * @tc.number: getProfileByExtensionAbility_2200
* @tc.name: getProfileByExtensionAbility : The profile is obtained by specified ability * @tc.name: getProfileByExtensionAbility : The profile is obtained by specified ability
* @tc.desc: profile is not json-format (by promise) * @tc.desc: profile is .txt (by promise)
* @tc.level 0 * @tc.level 0
*/ */
it('getProfileByExtensionAbility_2200', 0, async function (done) { it('getProfileByExtensionAbility_2200', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => { await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => {
console.info('[getProfileByExtensionAbility_2200] getApplicationInfo callback data is: ' + JSON.stringify(data)); console.info('[getProfileByExtensionAbility_2200] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(data).assertFail() expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
done(); done();
}).catch(err => { }).catch(err => {
console.error('[getProfileByExtensionAbility_2200]Operation failed. Cause: ' + JSON.stringify(err)); console.error('[getProfileByExtensionAbility_2200]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1); expect().assertFail();
done(); done();
}) })
}) })
...@@ -397,18 +398,18 @@ export default function getProfileByExtensionAbility() { ...@@ -397,18 +398,18 @@ export default function getProfileByExtensionAbility() {
/* /*
* @tc.number: getProfileByExtensionAbility_2300 * @tc.number: getProfileByExtensionAbility_2300
* @tc.name: getProfileByExtensionAbility : The profile is obtained by specified ability * @tc.name: getProfileByExtensionAbility : The profile is obtained by specified ability
* @tc.desc: profile is not json-format (by callback) * @tc.desc: profile is .txt (by callback)
* @tc.level 0 * @tc.level 0
*/ */
it('getProfileByExtensionAbility_2300', 0, async function (done) { it('getProfileByExtensionAbility_2300', 0, async function (done) {
bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => { bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => {
if (err) { if (err) {
console.error('[getProfileByExtensionAbility_2300]Operation failed. Cause: ' + JSON.stringify(err)); console.error('[getProfileByExtensionAbility_2300]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1); expect().assertFail();
} }
console.info('[getProfileByExtensionAbility_2300] getApplicationInfo callback data is: ' + JSON.stringify(data)); console.info('[getProfileByExtensionAbility_2300] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string"); expect(Array.isArray(data)).assertTrue();
expect(data).assertEqual("GetProfile failed"); expect(typeof data[0]).assertEqual("string");
done(); done();
}); });
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册