From 3f599ad7cbea9ab4986080282c9bc1c49188fcbd Mon Sep 17 00:00:00 2001 From: lwx1121892 Date: Fri, 3 Feb 2023 09:44:12 +0800 Subject: [PATCH] =?UTF-8?q?<=E6=96=B9=E6=B3=95=E9=80=82=E9=85=8D>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lwx1121892 --- multimedia/media/media_js_standard/MediaTestBase.js | 10 ++++++++++ .../src/main/js/test/PlayerLocalTestAudioFUNC.test.js | 4 ++-- .../main/js/test/VideoPlayerFuncCallbackTest.test.js | 2 +- .../main/js/test/VideoPlayerFuncPromiseTest.test.js | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/multimedia/media/media_js_standard/MediaTestBase.js b/multimedia/media/media_js_standard/MediaTestBase.js index dea260ba7..b3e21d998 100644 --- a/multimedia/media/media_js_standard/MediaTestBase.js +++ b/multimedia/media/media_js_standard/MediaTestBase.js @@ -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) { let description = ""; for(let i in obj) { diff --git a/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js b/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js index d4269db05..b9e6de7b0 100644 --- a/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js +++ b/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js @@ -157,7 +157,7 @@ describe('PlayerLocalTestAudioFUNC', function () { console.info('case getTrackDescription called!!'); if (typeof (arrayList) != 'undefined') { 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 { console.info('case getTrackDescription is failed'); @@ -171,7 +171,7 @@ describe('PlayerLocalTestAudioFUNC', function () { audioPlayer.getTrackDescription((err, arrayList) => { if (typeof (err) == 'undefined') { 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); } else { diff --git a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js index 3cb42707e..a06d503fd 100644 --- a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js @@ -243,7 +243,7 @@ describe('VideoPlayerFuncCallbackTest', function () { videoPlayer.getTrackDescription((err, arrlist) => { if (err == null) { 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); } else if ((err != null) && (steps[0] == ERROR_EVENT)) { diff --git a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js index 0f627552d..4f686d101 100644 --- a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js @@ -516,7 +516,7 @@ describe('VideoPlayerFuncPromiseTest', function () { }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); 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(() => { -- GitLab