未验证 提交 76ffa6a2 编写于 作者: O openharmony_ci 提交者: Gitee

!3027 整合videoPlayer测试用例

Merge pull request !3027 from FULIZHONG/0422videoPlayer
...@@ -46,6 +46,7 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -46,6 +46,7 @@ describe('VideoPlayerAPICallbackTest', function () {
const SPEED_VALUE = 1; const SPEED_VALUE = 1;
const NEXT_FRAME_TIME = 8333; const NEXT_FRAME_TIME = 8333;
const PREV_FRAME_TIME = 4166; const PREV_FRAME_TIME = 4166;
const DELTA_TIME = 100;
let surfaceID = ''; let surfaceID = '';
let fileDescriptor = undefined; let fileDescriptor = undefined;
let page = 0; let page = 0;
...@@ -326,20 +327,20 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -326,20 +327,20 @@ describe('VideoPlayerAPICallbackTest', function () {
switch (seekMode) { switch (seekMode) {
case media.SeekMode.SEEK_NEXT_SYNC: case media.SeekMode.SEEK_NEXT_SYNC:
if (seekTime == 0) { if (seekTime == 0) {
expect(seekDoneTime).assertEqual(0); expect(seekDoneTime + DELTA_TIME).assertClose(DELTA_TIME, DELTA_TIME);
} else if (seekTime == DURATION_TIME) { } else if (seekTime == DURATION_TIME) {
expect(seekDoneTime).assertEqual(DURATION_TIME); expect(seekDoneTime).assertClose(DURATION_TIME, DELTA_TIME);
} else { } else {
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME); expect(seekDoneTime).assertClose(NEXT_FRAME_TIME, DELTA_TIME);
} }
break; break;
case media.SeekMode.SEEK_PREV_SYNC: case media.SeekMode.SEEK_PREV_SYNC:
if (seekTime == 0) { if (seekTime == 0) {
expect(seekDoneTime).assertEqual(0); expect(seekDoneTime + DELTA_TIME).assertClose(DELTA_TIME, DELTA_TIME);
} else if (seekTime == DURATION_TIME) { } else if (seekTime == DURATION_TIME) {
expect(seekDoneTime).assertEqual(PREV_FRAME_TIME); expect(seekDoneTime).assertClose(NEXT_FRAME_TIME, DELTA_TIME);
} else { } else {
expect(seekDoneTime).assertEqual(PREV_FRAME_TIME); expect(seekDoneTime).assertClose(PREV_FRAME_TIME, DELTA_TIME);
} }
break; break;
default: default:
......
...@@ -20,7 +20,7 @@ export async function toNewPage(page) { ...@@ -20,7 +20,7 @@ export async function toNewPage(page) {
if (page == 0) { if (page == 0) {
path = 'pages/surfaceTest/surfaceTest'; path = 'pages/surfaceTest/surfaceTest';
} else { } else {
path = 'pages/surfaceTest/surfaceTest2'; path = 'pages/surfaceTest2/surfaceTest2';
} }
let options = { let options = {
uri: path, uri: path,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册