diff --git a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerEnumTest.test.js b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerEnumTest.test.js index 43aca3c0bf5b430990c2f7c4d8125d84bf70387a..3ae970e2bac4ef58dcee4a944187adc76b4a6b74 100644 --- a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerEnumTest.test.js +++ b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerEnumTest.test.js @@ -100,4 +100,71 @@ describe('VideoPlayerEnumTest', function () { expect(media.BufferingInfoType.CACHED_DURATION).assertEqual(4); done(); }) + + /* * + * @tc.number : SUB_MEDIA_VIDEO_PLAYER_ENUM_PLAYBACK_SPEED_00_0100 + * @tc.name : PlaybackSpeed + * @tc.desc : PlaybackSpeed Enumeration test + * @tc.size : MediumTest + * @tc.type : Function test + * @tc.level : Level0 + */ + it('SUB_MEDIA_VIDEO_PLAYER_ENUM_PLAYBACK_SPEED_00_0100', 0, async function (done) { + expect(media.PlaybackSpeed.SPEED_FORWARD_0_75_X).assertEqual(0); + expect(media.PlaybackSpeed.SPEED_FORWARD_1_00_X).assertEqual(1); + expect(media.PlaybackSpeed.SPEED_FORWARD_1_25_X).assertEqual(2); + expect(media.PlaybackSpeed.SPEED_FORWARD_1_75_X).assertEqual(3); + expect(media.PlaybackSpeed.SPEED_FORWARD_2_00_X).assertEqual(4); + done(); + }) + + /* * + * @tc.number : SUB_MEDIA_VIDEO_PLAYER_ENUM_CONTAINER_FORMAT_TYPE_00_0100 + * @tc.name : ContainerFormatType + * @tc.desc : ContainerFormatType Enumeration test + * @tc.size : MediumTest + * @tc.type : Function test + * @tc.level : Level0 + */ + it('SUB_MEDIA_VIDEO_PLAYER_ENUM_CONTAINER_FORMAT_TYPE_00_0100', 0, async function (done) { + expect(media.ContainerFormatType.CFT_MPEG_4).assertEqual("mp4"); + expect(media.ContainerFormatType.CFT_MPEG_4A).assertEqual("m4a"); + done(); + }) + + /* * + * @tc.number : SUB_MEDIA_VIDEO_PLAYER_ENUM_MEDIA_TYPE_00_0100 + * @tc.name : MediaType + * @tc.desc : MediaType Enumeration test + * @tc.size : MediumTest + * @tc.type : Function test + * @tc.level : Level0 + */ + it('SUB_MEDIA_VIDEO_PLAYER_ENUM_MEDIA_TYPE_00_0100', 0, async function (done) { + expect(media.MediaType.MEDIA_TYPE_AUD).assertEqual(0); + expect(media.MediaType.MEDIA_TYPE_VID).assertEqual(1); + expect(media.MediaType.MEDIA_TYPE_SUBTITLE).assertEqual(2); + done(); + }) + + /* * + * @tc.number : SUB_MEDIA_VIDEO_PLAYER_ENUM_MEDIA_DESCRIPTION_KEY_00_0100 + * @tc.name : MediaDescriptionKey + * @tc.desc : MediaDescriptionKey Enumeration test + * @tc.size : MediumTest + * @tc.type : Function test + * @tc.level : Level0 + */ + it('SUB_MEDIA_VIDEO_PLAYER_ENUM_MEDIA_DESCRIPTION_KEY_00_0100', 0, async function (done) { + expect(media.MediaDescriptionKey.MD_KEY_TRACK_INDEX).assertEqual("track_index"); + expect(media.MediaDescriptionKey.MD_KEY_TRACK_TYPE).assertEqual("track_type"); + expect(media.MediaDescriptionKey.MD_KEY_CODEC_MIME).assertEqual("codec_mime"); + expect(media.MediaDescriptionKey.MD_KEY_DURATION).assertEqual("duration"); + expect(media.MediaDescriptionKey.MD_KEY_BITRATE).assertEqual("bitrate"); + expect(media.MediaDescriptionKey.MD_KEY_WIDTH).assertEqual("width"); + expect(media.MediaDescriptionKey.MD_KEY_HEIGHT).assertEqual("height"); + expect(media.MediaDescriptionKey.MD_KEY_AUD_CHANNEL_COUNT).assertEqual("channel_count"); + expect(media.MediaDescriptionKey.MD_KEY_AUD_SAMPLE_RATE).assertEqual("sample_rate"); + done(); + }) }) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js index 1172e471a5a7426dd02102f95bf5c2e977c9f7d9..7e2c8830cc74c3b54288ce25311fb8bdbbfd265f 100644 --- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js +++ b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -require('./VideoRecorderFuncCallbackTest.test.js') require('./VideoRecorderFuncPromiseTest.test.js') -require('./VideoRecorderAPICallbackTest.test.js') \ No newline at end of file +require('./VideoRecorderAPICallbackTest.test.js') +require('./VideoRecorderFuncCallbackTest.test.js') +require('./VideoRecorderEnumTest.test.js') diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderEnumTest.test.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderEnumTest.test.js new file mode 100644 index 0000000000000000000000000000000000000000..536a1852a0708af5aee83c29f4c4a381f3e43f99 --- /dev/null +++ b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderEnumTest.test.js @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2021 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 media from '@ohos.multimedia.media' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' + +describe('VideoRecorderEnumTest', function () { + beforeAll(function() { + console.info('beforeAll case'); + }) + + beforeEach(function() { + console.info('beforeEach case'); + }) + + afterEach(function() { + console.info('afterEach case'); + }) + + afterAll(function() { + console.info('afterAll case'); + }) + + /* * + * @tc.number : SUB_MEDIA_VIDEO_RECORDER_ENUM_AUDIO_SOURCE_TYPE_00_0100 + * @tc.name : AudioSourceType + * @tc.desc : AudioSourceType Enumeration test + * @tc.size : MediumTest + * @tc.type : Function test + * @tc.level : Level0 + */ + it('SUB_MEDIA_VIDEO_RECORDER_ENUM_AUDIO_SOURCE_TYPE_00_0100', 0, async function (done) { + expect(media.AudioSourceType.AUDIO_SOURCE_TYPE_DEFAULT).assertEqual(0); + expect(media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC).assertEqual(1); + done(); + }) + + /* * + * @tc.number : SUB_MEDIA_VIDEO_RECORDER_ENUM_VIDEO_SOURCE_TYPE_00_0100 + * @tc.name : VideoSourceType + * @tc.desc : VideoSourceType Enumeration test + * @tc.size : MediumTest + * @tc.type : Function test + * @tc.level : Level0 + */ + it('SUB_MEDIA_VIDEO_RECORDER_ENUM_VIDEO_SOURCE_TYPE_00_0100', 0, async function (done) { + expect(media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV).assertEqual(0); + expect(media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES).assertEqual(1); + done(); + }) +}) \ No newline at end of file