未验证 提交 7e0f90d9 编写于 作者: O openharmony_ci 提交者: Gitee

!1949 add testcases for VideoPlayer API Enumeration

Merge pull request !1949 from bearplusplus/test
......@@ -15,3 +15,4 @@
require('./VideoPlayerFuncPromiseTest.test.js')
require('./VideoPlayerAPICallbackTest.test.js')
require('./VideoPlayerFuncCallbackTest.test.js')
require('./VideoPlayerEnumTest.test.js')
/*
* 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('VideoPlayerEnumTest', 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_PLAYER_ENUM_SEEK_MODE_00_0100
* @tc.name : SeekMode
* @tc.desc : SeekMode Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_PLAYER_ENUM_SEEK_MODE_00_0100', 0, async function (done) {
expect(media.SeekMode.SEEK_NEXT_SYNC).assertEqual(0);
expect(media.SeekMode.SEEK_PREV_SYNC).assertEqual(1);
expect(media.SeekMode.SEEK_CLOSEST_SYNC).assertEqual(2);
expect(media.SeekMode.SEEK_CLOSEST).assertEqual(3);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_ENUM_MEDIA_ERROR_CODE_00_0100
* @tc.name : MediaErrorCode
* @tc.desc : MediaErrorCode Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_PLAYER_ENUM_MEDIA_ERROR_CODE_00_0100', 0, async function (done) {
expect(media.MediaErrorCode.MSERR_OK).assertEqual(0);
expect(media.MediaErrorCode.MSERR_NO_MEMORY).assertEqual(1);
expect(media.MediaErrorCode.MSERR_OPERATION_NOT_PERMIT).assertEqual(2);
expect(media.MediaErrorCode.MSERR_INVALID_VAL).assertEqual(3);
expect(media.MediaErrorCode.MSERR_IO).assertEqual(4);
expect(media.MediaErrorCode.MSERR_TIMEOUT).assertEqual(5);
expect(media.MediaErrorCode.MSERR_UNKNOWN).assertEqual(6);
expect(media.MediaErrorCode.MSERR_SERVICE_DIED).assertEqual(7);
expect(media.MediaErrorCode.MSERR_INVALID_STATE).assertEqual(8);
expect(media.MediaErrorCode.MSERR_UNSUPPORTED).assertEqual(9);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_ENUM_AV_DATA_SOURCE_ERROR_00_0100
* @tc.name : AVDataSourceError
* @tc.desc : AVDataSourceError Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_PLAYER_ENUM_AV_DATA_SOURCE_ERROR_00_0100', 0, async function (done) {
expect(media.AVDataSourceError.SOURCE_ERROR_IO).assertEqual(-2);
expect(media.AVDataSourceError.SOURCE_ERROR_EOF).assertEqual(-1);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_ENUM_BUFFERING_INFO_TYPE_00_0100
* @tc.name : BufferingInfoType
* @tc.desc : BufferingInfoType Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_PLAYER_ENUM_BUFFERING_INFO_TYPE_00_0100', 0, async function (done) {
expect(media.BufferingInfoType.BUFFERING_START).assertEqual(1);
expect(media.BufferingInfoType.BUFFERING_END).assertEqual(2);
expect(media.BufferingInfoType.BUFFERING_PERCENT).assertEqual(3);
expect(media.BufferingInfoType.CACHED_DURATION).assertEqual(4);
done();
})
})
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册