提交 52636e5c 编写于 作者: F fulizhong

modify testcases Signed-off-by: FULIZHONG<fulizhong1@huawei.com>

Signed-off-by: Nfulizhong <fulizhong@huawei.com>
上级 282c7077
...@@ -83,12 +83,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -83,12 +83,12 @@ describe('VideoPlayerAPICallbackTest', function () {
function failureCallback(error) { function failureCallback(error) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
} }
function catchCallback(error) { function catchCallback(error) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
} }
async function getFd() { async function getFd() {
...@@ -134,7 +134,7 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -134,7 +134,7 @@ describe('VideoPlayerAPICallbackTest', function () {
function printfError(error, done) { function printfError(error, done) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
done(); done();
} }
...@@ -160,12 +160,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -160,12 +160,12 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.on(CREATE_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(CREATE_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
media.createVideoPlayer((err, video) => { media.createVideoPlayer((err, video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case createVideoPlayer success!!'); console.info('case createVideoPlayer success!!');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -178,11 +178,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -178,11 +178,11 @@ describe('VideoPlayerAPICallbackTest', function () {
steps.shift(); steps.shift();
videoPlayer.url = fdPath; videoPlayer.url = fdPath;
videoPlayer.setDisplaySurface(surfaceID, (err) => { videoPlayer.setDisplaySurface(surfaceID, (err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success!!'); console.info('case setDisplaySurface success!!');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -195,14 +195,14 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -195,14 +195,14 @@ describe('VideoPlayerAPICallbackTest', function () {
steps.shift(); steps.shift();
videoPlayer.url = fdPath; videoPlayer.url = fdPath;
videoPlayer.prepare((err) => { videoPlayer.prepare((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('prepared'); expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare success!!'); console.info('case prepare success!!');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -214,12 +214,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -214,12 +214,12 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.on(GETDESCRIPTION, (videoPlayer, steps, done) => { eventEmitter.on(GETDESCRIPTION, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.getTrackDescription((err, arrlist) => { videoPlayer.getTrackDescription((err, arrlist) => {
if (typeof (err) == 'undefined') { if (err == null) {
for (let i = 0; i < arrlist.length; i++) { for (let i = 0; i < arrlist.length; i++) {
printfDescription(arrlist[i]); printfDescription(arrlist[i]);
} }
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -231,12 +231,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -231,12 +231,12 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.on(PLAY_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(PLAY_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.play((err) => { videoPlayer.play((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.state).assertEqual('playing');
console.info('case play success!!'); console.info('case play success!!');
sleep(PLAY_TIME); sleep(PLAY_TIME);
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -248,11 +248,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -248,11 +248,11 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.on(PAUSE_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(PAUSE_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.pause((err) => { videoPlayer.pause((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('paused'); expect(videoPlayer.state).assertEqual('paused');
console.info('case pause success!!'); console.info('case pause success!!');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -264,11 +264,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -264,11 +264,11 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.on(STOP_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(STOP_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.stop((err) => { videoPlayer.stop((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('stopped'); expect(videoPlayer.state).assertEqual('stopped');
console.info('case stop success!!'); console.info('case stop success!!');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -280,11 +280,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -280,11 +280,11 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.on(RESET_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(RESET_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.reset((err) => { videoPlayer.reset((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case reset success!!'); console.info('case reset success!!');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -296,10 +296,10 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -296,10 +296,10 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.on(RELEASE_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(RELEASE_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.release((err) => { videoPlayer.release((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case release success!!'); console.info('case release success!!');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -313,10 +313,10 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -313,10 +313,10 @@ describe('VideoPlayerAPICallbackTest', function () {
steps.shift(); steps.shift();
steps.shift(); steps.shift();
videoPlayer.seek(seekTime, (err, seekDoneTime) => { videoPlayer.seek(seekTime, (err, seekDoneTime) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case seek success and seekDoneTime is '+ seekDoneTime); console.info('case seek success and seekDoneTime is '+ seekDoneTime);
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -355,11 +355,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -355,11 +355,11 @@ describe('VideoPlayerAPICallbackTest', function () {
steps.shift(); steps.shift();
steps.shift(); steps.shift();
videoPlayer.seek(seekTime, media.SeekMode.SEEK_NEXT_SYNC, (err, seekDoneTime) => { videoPlayer.seek(seekTime, media.SeekMode.SEEK_NEXT_SYNC, (err, seekDoneTime) => {
if (typeof (err) == 'undefined') { if (err == null) {
checkSeekTime(media.SeekMode.SEEK_NEXT_SYNC, seekTime, seekDoneTime); checkSeekTime(media.SeekMode.SEEK_NEXT_SYNC, seekTime, seekDoneTime);
console.info('case seek success and seekDoneTime is '+ seekDoneTime); console.info('case seek success and seekDoneTime is '+ seekDoneTime);
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -373,10 +373,10 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -373,10 +373,10 @@ describe('VideoPlayerAPICallbackTest', function () {
steps.shift(); steps.shift();
steps.shift(); steps.shift();
videoPlayer.setVolume(volumeValue, (err) => { videoPlayer.setVolume(volumeValue, (err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case setVolume success'); console.info('case setVolume success');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -390,11 +390,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -390,11 +390,11 @@ describe('VideoPlayerAPICallbackTest', function () {
steps.shift(); steps.shift();
steps.shift(); steps.shift();
videoPlayer.setSpeed(speedValue, (err, speedMode) => { videoPlayer.setSpeed(speedValue, (err, speedMode) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(speedValue).assertEqual(speedMode); expect(speedValue).assertEqual(speedMode);
console.info('case setSpeed success and speedMode is '+ speedMode); console.info('case setSpeed success and speedMode is '+ speedMode);
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -587,7 +587,7 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -587,7 +587,7 @@ describe('VideoPlayerAPICallbackTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, GETDESCRIPTION, let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, GETDESCRIPTION,
PREPARE_EVENT, RELEASE_EVENT, END_EVENT); PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
...@@ -604,7 +604,7 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -604,7 +604,7 @@ describe('VideoPlayerAPICallbackTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PREPARE_EVENT, let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PREPARE_EVENT,
PREPARE_EVENT, RELEASE_EVENT, END_EVENT); ERROR_EVENT, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
...@@ -807,7 +807,8 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -807,7 +807,8 @@ describe('VideoPlayerAPICallbackTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
PREPARE_EVENT, PLAY_EVENT, PLAY_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT); PREPARE_EVENT, PLAY_EVENT, PLAY_EVENT, ERROR_EVENT,
PLAY_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
...@@ -1010,7 +1011,8 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1010,7 +1011,8 @@ describe('VideoPlayerAPICallbackTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, PAUSE_EVENT, PAUSE_EVENT, RELEASE_EVENT, END_EVENT); PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, PAUSE_EVENT, ERROR_EVENT,
PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
...@@ -1213,7 +1215,8 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1213,7 +1215,8 @@ describe('VideoPlayerAPICallbackTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, STOP_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT); PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, STOP_EVENT, ERROR_EVENT,
STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
...@@ -1416,7 +1419,8 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1416,7 +1419,8 @@ describe('VideoPlayerAPICallbackTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
PREPARE_EVENT, RESET_EVENT, RESET_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT); PREPARE_EVENT, RESET_EVENT, RESET_EVENT, ERROR_EVENT,
RESET_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
...@@ -1995,7 +1999,7 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1995,7 +1999,7 @@ describe('VideoPlayerAPICallbackTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
SETVOLUME_EVENT, VOLUME_VALUE, END_EVENT); SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
......
...@@ -80,12 +80,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -80,12 +80,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
function failureCallback(error) { function failureCallback(error) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
} }
function catchCallback(error) { function catchCallback(error) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
} }
function sleep(time) { function sleep(time) {
...@@ -135,7 +135,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -135,7 +135,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
function printfError(error, done) { function printfError(error, done) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
done(); done();
} }
...@@ -177,14 +177,14 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -177,14 +177,14 @@ describe('VideoPlayerFuncCallbackTest', function () {
}); });
videoPlayer.on('error', (error) => { videoPlayer.on('error', (error) => {
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
}); });
} }
eventEmitter.on(CREATE_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(CREATE_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
media.createVideoPlayer((err, video) => { media.createVideoPlayer((err, video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
setOnCallback(videoPlayer); setOnCallback(videoPlayer);
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
...@@ -200,7 +200,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -200,7 +200,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
steps.shift(); steps.shift();
videoPlayer.url = fdPath; videoPlayer.url = fdPath;
videoPlayer.setDisplaySurface(surfaceID, (err) => { videoPlayer.setDisplaySurface(surfaceID, (err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success!!'); console.info('case setDisplaySurface success!!');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
...@@ -213,7 +213,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -213,7 +213,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
eventEmitter.on(PREPARE_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(PREPARE_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.prepare((err) => { videoPlayer.prepare((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('prepared'); expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
...@@ -230,7 +230,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -230,7 +230,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
steps.shift(); steps.shift();
videoPlayer.url = fdPath; videoPlayer.url = fdPath;
videoPlayer.prepare((err) => { videoPlayer.prepare((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('prepared'); expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
...@@ -246,7 +246,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -246,7 +246,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
eventEmitter.on(GETDESCRIPTION, (videoPlayer, steps, done) => { eventEmitter.on(GETDESCRIPTION, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.getTrackDescription((err, arrlist) => { videoPlayer.getTrackDescription((err, arrlist) => {
if (typeof (err) == 'undefined') { if (err == null) {
for (let i = 0; i < arrlist.length; i++) { for (let i = 0; i < arrlist.length; i++) {
printfDescription(arrlist[i]); printfDescription(arrlist[i]);
} }
...@@ -261,7 +261,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -261,7 +261,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
steps.shift(); steps.shift();
let startTime = videoPlayer.currentTime; let startTime = videoPlayer.currentTime;
videoPlayer.play((err) => { videoPlayer.play((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.state).assertEqual('playing');
console.info('case play success!!'); console.info('case play success!!');
sleep(PLAY_TIME); sleep(PLAY_TIME);
...@@ -277,7 +277,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -277,7 +277,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
eventEmitter.on(PAUSE_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(PAUSE_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.pause((err) => { videoPlayer.pause((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('paused'); expect(videoPlayer.state).assertEqual('paused');
console.info('case pause success!!'); console.info('case pause success!!');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
...@@ -290,7 +290,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -290,7 +290,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
eventEmitter.on(STOP_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(STOP_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.stop((err) => { videoPlayer.stop((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('stopped'); expect(videoPlayer.state).assertEqual('stopped');
console.info('case stop success!!'); console.info('case stop success!!');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
...@@ -303,7 +303,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -303,7 +303,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
eventEmitter.on(RESET_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(RESET_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.reset((err) => { videoPlayer.reset((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case reset success!!'); console.info('case reset success!!');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
...@@ -316,7 +316,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -316,7 +316,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
eventEmitter.on(RELEASE_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(RELEASE_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.release((err) => { videoPlayer.release((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case release success!!'); console.info('case release success!!');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -355,7 +355,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -355,7 +355,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
steps.shift(); steps.shift();
steps.shift(); steps.shift();
videoPlayer.seek(seekTime, (err, seekDoneTime) => { videoPlayer.seek(seekTime, (err, seekDoneTime) => {
if (typeof (err) == 'undefined') { if (err == null) {
if (seekTime > DURATION_TIME) { if (seekTime > DURATION_TIME) {
seekTime = DURATION_TIME; seekTime = DURATION_TIME;
} }
...@@ -375,7 +375,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -375,7 +375,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
steps.shift(); steps.shift();
steps.shift(); steps.shift();
videoPlayer.seek(seekTime, seekMode, (err, seekDoneTime) => { videoPlayer.seek(seekTime, seekMode, (err, seekDoneTime) => {
if (typeof (err) == 'undefined') { if (err == null) {
if (seekTime > DURATION_TIME) { if (seekTime > DURATION_TIME) {
seekTime = DURATION_TIME; seekTime = DURATION_TIME;
} }
...@@ -393,7 +393,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -393,7 +393,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
steps.shift(); steps.shift();
steps.shift(); steps.shift();
videoPlayer.setVolume(volumeValue, (err) => { videoPlayer.setVolume(volumeValue, (err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case setVolume success'); console.info('case setVolume success');
toNextStep(videoPlayer, steps, done); toNextStep(videoPlayer, steps, done);
} else { } else {
...@@ -433,7 +433,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -433,7 +433,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
steps.shift(); steps.shift();
let startTime = videoPlayer.currentTime; let startTime = videoPlayer.currentTime;
videoPlayer.setSpeed(speedValue, (err, speedMode) => { videoPlayer.setSpeed(speedValue, (err, speedMode) => {
if (typeof (err) == 'undefined') { if (err == null) {
sleep(1000); sleep(1000);
expect(speedValue).assertEqual(speedMode); expect(speedValue).assertEqual(speedMode);
console.info('case setSpeed success and speedMode is '+ speedMode); console.info('case setSpeed success and speedMode is '+ speedMode);
......
...@@ -68,12 +68,12 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -68,12 +68,12 @@ describe('VideoPlayerFuncPromiseTest', function () {
function failureCallback(error) { function failureCallback(error) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
} }
function catchCallback(error) { function catchCallback(error) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
} }
async function toNewPage() { async function toNewPage() {
...@@ -163,7 +163,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -163,7 +163,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
let testVideoPlayer1 = null; let testVideoPlayer1 = null;
let testVideoPlayer2 = null; let testVideoPlayer2 = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
testVideoPlayer1 = video testVideoPlayer1 = video
console.info('case createVideoPlayer success '); console.info('case createVideoPlayer success ');
} else { } else {
...@@ -201,7 +201,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -201,7 +201,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
testVideoPlayer1 = null; testVideoPlayer1 = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
testVideoPlayer2 = video testVideoPlayer2 = video
console.info('case createVideoPlayer success '); console.info('case createVideoPlayer success ');
} else { } else {
...@@ -253,7 +253,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -253,7 +253,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
console.info('case createVideoPlayer success'); console.info('case createVideoPlayer success');
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
...@@ -277,13 +277,13 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -277,13 +277,13 @@ describe('VideoPlayerFuncPromiseTest', function () {
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
}, failureCallback).catch(catchCallback); }, failureCallback).catch(catchCallback);
startTime = videoPlayer.currentTime; let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.play().then(() => {
console.info('case play called!!'); console.info('case play called!!');
sleep(PLAY_TIME); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback); }, failureCallback).catch(catchCallback);
endTime = videoPlayer.currentTime; let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.release().then(() => { await videoPlayer.release().then(() => {
...@@ -305,7 +305,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -305,7 +305,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -361,7 +361,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -361,7 +361,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -426,7 +426,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -426,7 +426,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -482,7 +482,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -482,7 +482,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -538,7 +538,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -538,7 +538,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -595,7 +595,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -595,7 +595,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -682,7 +682,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -682,7 +682,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -738,7 +738,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -738,7 +738,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -800,7 +800,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -800,7 +800,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
let videoPlayer = null; let videoPlayer = null;
let arrayDescription = null; let arrayDescription = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -822,7 +822,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -822,7 +822,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
await videoPlayer.getTrackDescription().then((arrayList) => { await videoPlayer.getTrackDescription().then((arrayList) => {
console.info('case getTrackDescription called!!'); console.info('case getTrackDescription called!!');
if (typeof (arrayList) != 'undefined') { if (arrayList != null) {
arrayDescription = arrayList; arrayDescription = arrayList;
} else { } else {
console.info('case getTrackDescription is failed'); console.info('case getTrackDescription is failed');
...@@ -853,7 +853,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -853,7 +853,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -912,7 +912,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -912,7 +912,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -973,7 +973,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -973,7 +973,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1034,7 +1034,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1034,7 +1034,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1105,7 +1105,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1105,7 +1105,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1182,7 +1182,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1182,7 +1182,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1252,7 +1252,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1252,7 +1252,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1323,7 +1323,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1323,7 +1323,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1384,7 +1384,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1384,7 +1384,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1462,7 +1462,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1462,7 +1462,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1529,7 +1529,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1529,7 +1529,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1602,7 +1602,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1602,7 +1602,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1668,7 +1668,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1668,7 +1668,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1740,7 +1740,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1740,7 +1740,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1809,7 +1809,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1809,7 +1809,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1876,7 +1876,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1876,7 +1876,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
...@@ -1934,7 +1934,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1934,7 +1934,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
console.info('case new surfaceID is ' + surfaceID); console.info('case new surfaceID is ' + surfaceID);
let videoPlayer = null; let videoPlayer = null;
await media.createVideoPlayer().then((video) => { await media.createVideoPlayer().then((video) => {
if (typeof (video) != 'undefined') { if (video != null) {
videoPlayer = video; videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
} else { } else {
......
...@@ -179,17 +179,15 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -179,17 +179,15 @@ describe('VideoRecorderAPICallbackTest', function () {
await captureSession.addInput(cameraInput); await captureSession.addInput(cameraInput);
await captureSession.addOutput(videoOutPut); await captureSession.addOutput(videoOutPut);
await captureSession.commitConfig(); await captureSession.commitConfig();
await captureSession.start();
} }
async function stopCaptureSession() { async function stopCaptureSession() {
await captureSession.stop();
await captureSession.release(); await captureSession.release();
} }
function printfError(error, done) { function printfError(error, done) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
done(); done();
} }
...@@ -235,7 +233,7 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -235,7 +233,7 @@ describe('VideoRecorderAPICallbackTest', function () {
await videoOutput.release().then(() => { await videoOutput.release().then(() => {
console.info('[camera] case videoOutput release success'); console.info('[camera] case videoOutput release success');
}); });
videoOutput = undefined; videoOutput = null;
await stopCaptureSession(); await stopCaptureSession();
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
}); });
...@@ -243,12 +241,12 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -243,12 +241,12 @@ describe('VideoRecorderAPICallbackTest', function () {
eventEmitter.on(CREATE_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(CREATE_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
media.createVideoRecorder((err, recorder) => { media.createVideoRecorder((err, recorder) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case createVideoRecorder success '); console.info('case createVideoRecorder success ');
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
console.info('case createVideoRecorder error hanpped'); console.info('case createVideoRecorder error hanpped');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -261,11 +259,11 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -261,11 +259,11 @@ describe('VideoRecorderAPICallbackTest', function () {
eventEmitter.on(PREPARE_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(PREPARE_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.prepare(videoConfig, (err) => { videoRecorder.prepare(videoConfig, (err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case prepare success'); console.info('case prepare success');
expect(videoRecorder.state).assertEqual('prepared'); expect(videoRecorder.state).assertEqual('prepared');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
console.info('case prepare error hanpped'); console.info('case prepare error hanpped');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -278,11 +276,11 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -278,11 +276,11 @@ describe('VideoRecorderAPICallbackTest', function () {
eventEmitter.on(PREPARE_OLNYVIDEO_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(PREPARE_OLNYVIDEO_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.prepare(onlyVideoConfig, (err) => { videoRecorder.prepare(onlyVideoConfig, (err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case prepare success'); console.info('case prepare success');
expect(videoRecorder.state).assertEqual('prepared'); expect(videoRecorder.state).assertEqual('prepared');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
console.info('case prepare error hanpped'); console.info('case prepare error hanpped');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -295,11 +293,11 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -295,11 +293,11 @@ describe('VideoRecorderAPICallbackTest', function () {
eventEmitter.on(GETSURFACE_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(GETSURFACE_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.getInputSurface((err, outPutSurface) => { videoRecorder.getInputSurface((err, outPutSurface) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case getInputSurface success'); console.info('case getInputSurface success');
surfaceID = outPutSurface; surfaceID = outPutSurface;
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
console.info('case getInputSurface error hanpped'); console.info('case getInputSurface error hanpped');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -312,12 +310,12 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -312,12 +310,12 @@ describe('VideoRecorderAPICallbackTest', function () {
eventEmitter.on(START_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(START_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.start((err) => { videoRecorder.start((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case start success'); console.info('case start success');
expect(videoRecorder.state).assertEqual('playing'); expect(videoRecorder.state).assertEqual('playing');
sleep(RECORDER_TIME); sleep(RECORDER_TIME);
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
console.info('case start error hanpped'); console.info('case start error hanpped');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -330,12 +328,12 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -330,12 +328,12 @@ describe('VideoRecorderAPICallbackTest', function () {
eventEmitter.on(PAUSE_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(PAUSE_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.pause((err) => { videoRecorder.pause((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case pause success'); console.info('case pause success');
sleep(PAUSE_TIME); sleep(PAUSE_TIME);
expect(videoRecorder.state).assertEqual('paused'); expect(videoRecorder.state).assertEqual('paused');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
console.info('case pause error hanpped'); console.info('case pause error hanpped');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -348,12 +346,12 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -348,12 +346,12 @@ describe('VideoRecorderAPICallbackTest', function () {
eventEmitter.on(RESUME_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(RESUME_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.resume((err) => { videoRecorder.resume((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case resume success'); console.info('case resume success');
sleep(RECORDER_TIME); sleep(RECORDER_TIME);
expect(videoRecorder.state).assertEqual('playing'); expect(videoRecorder.state).assertEqual('playing');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
console.info('case resume error hanpped'); console.info('case resume error hanpped');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -366,11 +364,11 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -366,11 +364,11 @@ describe('VideoRecorderAPICallbackTest', function () {
eventEmitter.on(STOP_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(STOP_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.stop((err) => { videoRecorder.stop((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case stop success'); console.info('case stop success');
expect(videoRecorder.state).assertEqual('stopped'); expect(videoRecorder.state).assertEqual('stopped');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
console.info('case stop error hanpped'); console.info('case stop error hanpped');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -383,11 +381,11 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -383,11 +381,11 @@ describe('VideoRecorderAPICallbackTest', function () {
eventEmitter.on(RESET_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(RESET_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.reset((err) => { videoRecorder.reset((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case reset success'); console.info('case reset success');
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
console.info('case reset error hanpped'); console.info('case reset error hanpped');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -400,11 +398,11 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -400,11 +398,11 @@ describe('VideoRecorderAPICallbackTest', function () {
eventEmitter.on(RELEASE_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(RELEASE_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.release((err) => { videoRecorder.release((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
console.info('case release success'); console.info('case release success');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) { } else if ((err != null) && (steps[0] == ERROR_EVENT)) {
steps.shift(); steps.shift();
console.info('case release error hanpped'); console.info('case release error hanpped');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -591,7 +589,7 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -591,7 +589,7 @@ describe('VideoRecorderAPICallbackTest', function () {
let videoRecorder = null; let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, SETPAUSE, PAUSE_EVENT, SETPAUSE, SETSTART, RESUME_EVENT, START_EVENT, SETPAUSE, PAUSE_EVENT, SETPAUSE, SETSTART, RESUME_EVENT,
START_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT); START_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done); eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
}) })
...@@ -651,7 +649,8 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -651,7 +649,8 @@ describe('VideoRecorderAPICallbackTest', function () {
it('SUB_MEDIA_VIDEO_RECORDER_START_CALLBACK_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_START_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null; let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, START_EVENT, START_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT); START_EVENT, START_EVENT, ERROR_EVENT, START_EVENT,
ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done); eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
}) })
...@@ -770,7 +769,8 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -770,7 +769,8 @@ describe('VideoRecorderAPICallbackTest', function () {
it('SUB_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null; let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, SETPAUSE, PAUSE_EVENT, PAUSE_EVENT, PAUSE_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT); START_EVENT, SETPAUSE, PAUSE_EVENT, PAUSE_EVENT, ERROR_EVENT,
PAUSE_EVENT, ERROR_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done); eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
}) })
...@@ -813,7 +813,7 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -813,7 +813,7 @@ describe('VideoRecorderAPICallbackTest', function () {
it('SUB_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null; let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RESUME_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT); START_EVENT, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done); eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
}) })
...@@ -890,7 +890,8 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -890,7 +890,8 @@ describe('VideoRecorderAPICallbackTest', function () {
let videoRecorder = null; let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, SETPAUSE, PAUSE_EVENT, SETPAUSE, SETSTART, START_EVENT, SETPAUSE, PAUSE_EVENT, SETPAUSE, SETSTART,
RESUME_EVENT, RESUME_EVENT, RESUME_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT); RESUME_EVENT, RESUME_EVENT, ERROR_EVENT, RESUME_EVENT, ERROR_EVENT,
RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done); eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
}) })
......
...@@ -223,17 +223,15 @@ describe('VideoRecorderFuncCallbackTest', function () { ...@@ -223,17 +223,15 @@ describe('VideoRecorderFuncCallbackTest', function () {
await captureSession.addInput(cameraInput); await captureSession.addInput(cameraInput);
await captureSession.addOutput(videoOutPut); await captureSession.addOutput(videoOutPut);
await captureSession.commitConfig(); await captureSession.commitConfig();
await captureSession.start();
} }
async function stopCaptureSession() { async function stopCaptureSession() {
await captureSession.stop();
await captureSession.release(); await captureSession.release();
} }
function printfError(error, done) { function printfError(error, done) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
done(); done();
} }
...@@ -256,7 +254,7 @@ describe('VideoRecorderFuncCallbackTest', function () { ...@@ -256,7 +254,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
}); });
videoRecorder.on('error', (err) => { videoRecorder.on('error', (err) => {
console.info('case error called, errMessage is ' + err.message); console.info('case error called, err code is ' + err.code);
expect().assertFail(); expect().assertFail();
}); });
} }
...@@ -264,7 +262,7 @@ describe('VideoRecorderFuncCallbackTest', function () { ...@@ -264,7 +262,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
eventEmitter.on(CREATE_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(CREATE_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
media.createVideoRecorder((err, recorder) => { media.createVideoRecorder((err, recorder) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case createVideoRecorder success '); console.info('case createVideoRecorder success ');
videoRecorder = recorder; videoRecorder = recorder;
setOnCallback(videoRecorder); setOnCallback(videoRecorder);
...@@ -279,7 +277,7 @@ describe('VideoRecorderFuncCallbackTest', function () { ...@@ -279,7 +277,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
eventEmitter.on(PREPARE_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(PREPARE_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.prepare(videoConfig, (err) => { videoRecorder.prepare(videoConfig, (err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case prepare success'); console.info('case prepare success');
expect(videoRecorder.state).assertEqual('prepared'); expect(videoRecorder.state).assertEqual('prepared');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -292,7 +290,7 @@ describe('VideoRecorderFuncCallbackTest', function () { ...@@ -292,7 +290,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
eventEmitter.on(PREPARE_OLNYVIDEO_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(PREPARE_OLNYVIDEO_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.prepare(onlyVideoConfig, (err) => { videoRecorder.prepare(onlyVideoConfig, (err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case prepare success'); console.info('case prepare success');
expect(videoRecorder.state).assertEqual('prepared'); expect(videoRecorder.state).assertEqual('prepared');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -305,7 +303,7 @@ describe('VideoRecorderFuncCallbackTest', function () { ...@@ -305,7 +303,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
eventEmitter.on(GETSURFACE_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(GETSURFACE_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.getInputSurface((err, outPutsurface) => { videoRecorder.getInputSurface((err, outPutsurface) => {
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoRecorder.state).assertEqual('prepared'); expect(videoRecorder.state).assertEqual('prepared');
surfaceID = outPutsurface; surfaceID = outPutsurface;
console.info('case getInputSurface success :' + surfaceID); console.info('case getInputSurface success :' + surfaceID);
...@@ -329,7 +327,7 @@ describe('VideoRecorderFuncCallbackTest', function () { ...@@ -329,7 +327,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
console.info('case videoOutput start success'); console.info('case videoOutput start success');
}); });
videoRecorder.start((err) => { videoRecorder.start((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case start success'); console.info('case start success');
expect(videoRecorder.state).assertEqual('playing'); expect(videoRecorder.state).assertEqual('playing');
sleep(RECORDER_TIME); sleep(RECORDER_TIME);
...@@ -343,7 +341,7 @@ describe('VideoRecorderFuncCallbackTest', function () { ...@@ -343,7 +341,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
eventEmitter.on(PAUSE_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(PAUSE_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.pause((err) => { videoRecorder.pause((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case pause success'); console.info('case pause success');
expect(videoRecorder.state).assertEqual('paused'); expect(videoRecorder.state).assertEqual('paused');
sleep(PAUSE_TIME); sleep(PAUSE_TIME);
...@@ -357,7 +355,7 @@ describe('VideoRecorderFuncCallbackTest', function () { ...@@ -357,7 +355,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
eventEmitter.on(RESUME_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(RESUME_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.resume((err) => { videoRecorder.resume((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case resume success'); console.info('case resume success');
sleep(RECORDER_TIME); sleep(RECORDER_TIME);
expect(videoRecorder.state).assertEqual('playing'); expect(videoRecorder.state).assertEqual('playing');
...@@ -371,7 +369,7 @@ describe('VideoRecorderFuncCallbackTest', function () { ...@@ -371,7 +369,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
eventEmitter.on(STOP_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(STOP_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.stop((err) => { videoRecorder.stop((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case stop success'); console.info('case stop success');
expect(videoRecorder.state).assertEqual('stopped'); expect(videoRecorder.state).assertEqual('stopped');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -384,7 +382,7 @@ describe('VideoRecorderFuncCallbackTest', function () { ...@@ -384,7 +382,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
eventEmitter.on(RESET_EVENT, async (videoRecorder, steps, done) => { eventEmitter.on(RESET_EVENT, async (videoRecorder, steps, done) => {
steps.shift(); steps.shift();
videoRecorder.reset((err) => { videoRecorder.reset((err) => {
if (typeof (err) == 'undefined') { if (err == null) {
console.info('case reset success'); console.info('case reset success');
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
...@@ -403,9 +401,9 @@ describe('VideoRecorderFuncCallbackTest', function () { ...@@ -403,9 +401,9 @@ describe('VideoRecorderFuncCallbackTest', function () {
await videoOutput.release().then(() => { await videoOutput.release().then(() => {
console.info('case videoOutput release success'); console.info('case videoOutput release success');
}); });
videoOutput = undefined; videoOutput = null;
await stopCaptureSession(); await stopCaptureSession();
if (typeof (err) == 'undefined') { if (err == null) {
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
console.info('case release success'); console.info('case release success');
toNextStep(videoRecorder, steps, done); toNextStep(videoRecorder, steps, done);
......
...@@ -124,11 +124,9 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -124,11 +124,9 @@ describe('VideoRecorderFuncPromiseTest', function () {
await captureSession.addInput(cameraInput); await captureSession.addInput(cameraInput);
await captureSession.addOutput(videoOutPut); await captureSession.addOutput(videoOutPut);
await captureSession.commitConfig(); await captureSession.commitConfig();
await captureSession.start();
} }
async function stopCaptureSession() { async function stopCaptureSession() {
await captureSession.stop();
await captureSession.release(); await captureSession.release();
} }
...@@ -148,7 +146,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -148,7 +146,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
await videoOutPut.release().then(() => { await videoOutPut.release().then(() => {
console.info('[camera] case videoOutput release success'); console.info('[camera] case videoOutput release success');
}); });
videoOutPut = undefined; videoOutPut = null;
await stopCaptureSession(); await stopCaptureSession();
} }
...@@ -186,12 +184,12 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -186,12 +184,12 @@ describe('VideoRecorderFuncPromiseTest', function () {
function failureCallback(error) { function failureCallback(error) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
} }
function catchCallback(error) { function catchCallback(error) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,err code is ${error.code}`);
} }
/* * /* *
...@@ -203,14 +201,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -203,14 +201,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0100', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0100', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('01.mp4'); await getFd('01.mp4');
videoConfig.url = fdPath; videoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -253,14 +251,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -253,14 +251,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0200', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0200', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('02.mp4'); await getFd('02.mp4');
videoConfig.url = fdPath; videoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -310,14 +308,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -310,14 +308,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0300', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('03.mp4'); await getFd('03.mp4');
videoConfig.url = fdPath; videoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -375,14 +373,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -375,14 +373,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0400', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0400', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('04.mp4'); await getFd('04.mp4');
videoConfig.url = fdPath; videoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -431,14 +429,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -431,14 +429,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0500', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0500', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('05.mp4'); await getFd('05.mp4');
videoConfig.url = fdPath; videoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -486,14 +484,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -486,14 +484,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0600', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0600', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('06.mp4'); await getFd('06.mp4');
videoConfig.url = fdPath; videoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -548,14 +546,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -548,14 +546,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0700', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0700', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('07.mp4'); await getFd('07.mp4');
videoConfig.url = fdPath; videoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -610,14 +608,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -610,14 +608,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0800', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('08.mp4'); await getFd('08.mp4');
videoConfig.url = fdPath; videoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -680,14 +678,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -680,14 +678,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0900', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0900', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('09.mp4'); await getFd('09.mp4');
videoConfig.url = fdPath; videoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -750,7 +748,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -750,7 +748,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1000', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1000', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('10.mp4'); await getFd('10.mp4');
...@@ -760,7 +758,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -760,7 +758,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
configFile.videoBitrate = 8000; configFile.videoBitrate = 8000;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -810,7 +808,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -810,7 +808,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1100', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1100', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('11.mp4'); await getFd('11.mp4');
...@@ -820,7 +818,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -820,7 +818,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
configFile.videoBitrate = 16000; configFile.videoBitrate = 16000;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -870,7 +868,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -870,7 +868,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1200', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1200', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('12.mp4'); await getFd('12.mp4');
...@@ -880,7 +878,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -880,7 +878,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
configFile.videoBitrate = 32000; configFile.videoBitrate = 32000;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -930,7 +928,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -930,7 +928,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1300', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1300', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('13.mp4'); await getFd('13.mp4');
...@@ -940,7 +938,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -940,7 +938,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
configFile.videoBitrate = 112000; configFile.videoBitrate = 112000;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -989,14 +987,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -989,14 +987,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1400', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1400', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('14.mp4'); await getFd('14.mp4');
onlyVideoConfig.url = fdPath; onlyVideoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -1038,14 +1036,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1038,14 +1036,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1500', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1500', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('15.mp4'); await getFd('15.mp4');
onlyVideoConfig.url = fdPath; onlyVideoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -1096,14 +1094,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1096,14 +1094,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1600', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1600', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('16.mp4'); await getFd('16.mp4');
onlyVideoConfig.url = fdPath; onlyVideoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -1160,14 +1158,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1160,14 +1158,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1700', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1700', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('17.mp4'); await getFd('17.mp4');
onlyVideoConfig.url = fdPath; onlyVideoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -1215,14 +1213,14 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1215,14 +1213,14 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1800', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1800', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('18.mp4'); await getFd('18.mp4');
onlyVideoConfig.url = fdPath; onlyVideoConfig.url = fdPath;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -1270,7 +1268,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1270,7 +1268,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1900', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1900', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('40.mp4'); await getFd('40.mp4');
...@@ -1278,7 +1276,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1278,7 +1276,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
videoConfig.rotation = 90; videoConfig.rotation = 90;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -1319,7 +1317,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1319,7 +1317,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2000', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2000', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('41.mp4'); await getFd('41.mp4');
...@@ -1327,7 +1325,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1327,7 +1325,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
videoConfig.rotation = 180; videoConfig.rotation = 180;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -1368,7 +1366,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1368,7 +1366,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2100', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2100', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('42.mp4'); await getFd('42.mp4');
...@@ -1376,7 +1374,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1376,7 +1374,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
videoConfig.rotation = 270; videoConfig.rotation = 270;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -1417,7 +1415,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1417,7 +1415,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2200', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2200', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('43.mp4'); await getFd('43.mp4');
...@@ -1425,7 +1423,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1425,7 +1423,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
configFile.videoFrameRate = 20; configFile.videoFrameRate = 20;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -1466,7 +1464,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1466,7 +1464,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2300', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2300', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('44.mp4'); await getFd('44.mp4');
...@@ -1474,7 +1472,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1474,7 +1472,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
configFile.videoFrameRate = 30; configFile.videoFrameRate = 30;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
...@@ -1515,7 +1513,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1515,7 +1513,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2400', 0, async function (done) { it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2400', 0, async function (done) {
let videoRecorder = undefined; let videoRecorder = null;
let surfaceID = ''; let surfaceID = '';
let videoOutput; let videoOutput;
await getFd('45.mp4'); await getFd('45.mp4');
...@@ -1523,7 +1521,7 @@ describe('VideoRecorderFuncPromiseTest', function () { ...@@ -1523,7 +1521,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
configFile.videoFrameRate = 60; configFile.videoFrameRate = 60;
await media.createVideoRecorder().then((recorder) => { await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called'); console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') { if (recorder != null) {
videoRecorder = recorder; videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle'); expect(videoRecorder.state).assertEqual('idle');
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册