未验证 提交 64b2e7d7 编写于 作者: O openharmony_ci 提交者: Gitee

!7395 【媒体子系统】引入方法修改

Merge pull request !7395 from 秦莉文/master
...@@ -155,6 +155,16 @@ export function checkDescription(actualDescription, descriptionKey, descriptionV ...@@ -155,6 +155,16 @@ export function checkDescription(actualDescription, descriptionKey, descriptionV
} }
} }
export function checkOldDescription(actualDescription, descriptionKey, descriptionValue) {
for (let i = 0; i < descriptionKey.length; i++) {
let property = actualDescription[descriptionKey[i]];
console.info('case key is '+ descriptionKey[i]);
console.info('case actual value is '+ property);
console.info('case hope value is '+ descriptionValue[i]);
expect(property).assertEqual(descriptionValue[i]);
}
}
export function printDescription(obj) { export function printDescription(obj) {
let description = ""; let description = "";
for(let i in obj) { for(let i in obj) {
......
...@@ -157,7 +157,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -157,7 +157,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
console.info('case getTrackDescription called!!'); console.info('case getTrackDescription called!!');
if (typeof (arrayList) != 'undefined') { if (typeof (arrayList) != 'undefined') {
for (let i = 0; i < arrayList.length; i++) { for (let i = 0; i < arrayList.length; i++) {
mediaTestBase.checkDescription(arrayList[i], descriptionKey[i], descriptionValue[i]); mediaTestBase.checkOldDescription(arrayList[i], descriptionKey[i], descriptionValue[i]);
} }
} else { } else {
console.info('case getTrackDescription is failed'); console.info('case getTrackDescription is failed');
...@@ -171,7 +171,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -171,7 +171,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
audioPlayer.getTrackDescription((err, arrayList) => { audioPlayer.getTrackDescription((err, arrayList) => {
if (typeof (err) == 'undefined') { if (typeof (err) == 'undefined') {
for (let i = 0; i < arrayList.length; i++) { for (let i = 0; i < arrayList.length; i++) {
mediaTestBase.checkDescription(arrayList[i], descriptionKey[i], descriptionValue[i]); mediaTestBase.checkOldDescription(arrayList[i], descriptionKey[i], descriptionValue[i]);
} }
nextStep(mySteps, done); nextStep(mySteps, done);
} else { } else {
......
...@@ -244,7 +244,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -244,7 +244,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
videoPlayer.getTrackDescription((err, arrlist) => { videoPlayer.getTrackDescription((err, arrlist) => {
if (err == null) { if (err == null) {
for (let i = 0; i < arrlist.length; i++) { for (let i = 0; i < arrlist.length; i++) {
mediaTestBase.checkDescription(arrlist[i], descriptionKey[i], descriptionValue[i]); mediaTestBase.checkOldDescription(arrlist[i], descriptionKey[i], descriptionValue[i]);
} }
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((err != null) && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
......
...@@ -517,7 +517,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -517,7 +517,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
for (let i = 0; i < arrayDescription.length; i++) { for (let i = 0; i < arrayDescription.length; i++) {
mediaTestBase.checkDescription(arrayDescription[i], descriptionKey[i], descriptionValue[i]); mediaTestBase.checkOldDescription(arrayDescription[i], descriptionKey[i], descriptionValue[i]);
} }
await videoPlayer.release().then(() => { await videoPlayer.release().then(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册