提交 1e269872 编写于 作者: W wangqing 提交者: wanggang

add test cases

Signed-off-by: Nwangqing <wangqing@kaihongdigi.com>
上级 ec3ef19e
...@@ -18,5 +18,5 @@ ...@@ -18,5 +18,5 @@
controls="true" onprepared='preparedCallback' onstart='startCallback' onpause='pauseCallback' controls="true" onprepared='preparedCallback' onstart='startCallback' onpause='pauseCallback'
onfinish='finishCallback' onerror='errorCallback' onseeking='seekingCallback' onseeked='seekedCallback' onfinish='finishCallback' onerror='errorCallback' onseeking='seekingCallback' onseeked='seekedCallback'
ontimeupdate='timeupdateCallback' style="object-fit:fill; width:80%; height: 400px;" ontimeupdate='timeupdateCallback' style="object-fit:fill; width:80%; height: 400px;"
onlongpress='change_fullscreenchange' onclick="change_start_pause" loop='true' starttime = '3'></video> onlongpress='changeFullScreenChange' onclick="changeStartPause" loop='true' starttime = '3'></video>
</div> </div>
\ No newline at end of file
...@@ -30,7 +30,7 @@ export default { ...@@ -30,7 +30,7 @@ export default {
errorCallback:function(){ this.event = '视频播放错误';}, errorCallback:function(){ this.event = '视频播放错误';},
seekingCallback:function(e){ this.seekingtime = e.currenttime; }, seekingCallback:function(e){ this.seekingtime = e.currenttime; },
timeupdateCallback:function(e){ this.timeupdatetime = e.currenttime;}, timeupdateCallback:function(e){ this.timeupdatetime = e.currenttime;},
change_start_pause: function() { changeStartPause: function() {
if(this.isStart) { if(this.isStart) {
this.$element('videoId').pause(); this.$element('videoId').pause();
this.isStart = false; this.isStart = false;
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
this.isStart = true; this.isStart = true;
} }
}, },
change_fullscreenchange: function() {//全屏 changeFullScreenChange: function() {//全屏
if(!this.isfullscreenchange) { if(!this.isfullscreenchange) {
this.$element('videoId').requestFullscreen({ screenOrientation : 'default' }); this.$element('videoId').requestFullscreen({ screenOrientation : 'default' });
this.isfullscreenchange = true; this.isfullscreenchange = true;
......
...@@ -416,18 +416,18 @@ describe('basicabilityapi', function () { ...@@ -416,18 +416,18 @@ describe('basicabilityapi', function () {
*/ */
it('testSetTimeout', 0, async function (done) { it('testSetTimeout', 0, async function (done) {
console.info('testSetTimeout START'); console.info('testSetTimeout START');
let start_time = new Date().getTime(); let startTime = new Date().getTime();
const delay = 200; const delay = 200;
await setTimeout(function (v1, v2) { await setTimeout(function (v1, v2) {
let end_time = new Date().getTime(); let endTime = new Date().getTime();
console.info("[settimeout] start_time: " + start_time); console.info("[setTimeout] startTime: " + startTime);
console.info("[settimeout] end_time: " + end_time); console.info("[setTimeout] endTime: " + endTime);
console.info('[settimeout] delay: ' + (end_time - start_time)); console.info('[setTimeout] delay: ' + (endTime - startTime));
console.info('[settimeout] v1: ' + v1); console.info('[setTimeout] v1: ' + v1);
console.info('[settimeout] v2: ' + v2); console.info('[setTimeout] v2: ' + v2);
expect('test').assertEqual(v1); expect('test').assertEqual(v1);
expect('message').assertEqual(v2); expect('message').assertEqual(v2);
expect(end_time - start_time >= delay).assertTrue(); expect(endTime - startTime >= delay).assertTrue();
console.info('testSetTimeout END'); console.info('testSetTimeout END');
done(); done();
}, delay, 'test', 'message'); }, delay, 'test', 'message');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册