You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/tests.js
+56-8Lines changed: 56 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -403,6 +403,7 @@ exports.defineAutoTests = function () {
403
403
expect(position).toBeLessThan(10);
404
404
media1.stop();
405
405
media1.release();
406
+
context.done=true;
406
407
done();
407
408
},failed.bind(null,done,'media1.getCurrentPosition - Error getting media current position'),context);
408
409
},4000);
@@ -436,6 +437,7 @@ exports.defineAutoTests = function () {
436
437
expect(true).toBe(true);
437
438
media1.stop();
438
439
media1.release();
440
+
context.done=true;
439
441
done();
440
442
}
441
443
};
@@ -444,27 +446,73 @@ exports.defineAutoTests = function () {
444
446
media1.play();
445
447
},ACTUAL_PLAYBACK_TEST_TIMEOUT);
446
448
447
-
it("media.spec.26 should not crash or throw when setting the volume right after creating the media",function(){
449
+
it("media.spec.26 should not crash or throw when setting the volume right after creating the media",function(done){
448
450
//bb10 dialog pops up, preventing tests from running
449
451
if(cordova.platformId==='blackberry10'){
450
452
pending();
451
453
}
452
454
453
-
varcontext=this;
454
455
varmediaFile=WEB_MP3_FILE;
455
456
varmedia=null;
456
457
457
-
varsuccessCallback=function(){};
458
-
varstatusChange=function(){};
459
-
460
458
expect(function(){
461
-
media=newMedia(mediaFile,successCallback,failed.bind(null,successCallback,'Error creating Media object. Media file: '+mediaFile,context),statusChange);
459
+
media=newMedia(mediaFile);
462
460
media.setVolume('0.5');
463
461
}).not.toThrow();
464
-
if(media){
465
-
media.release();
462
+
463
+
// if there is no exception or crash in 3 seconds, the spec is completed
464
+
setTimeout(function(){
465
+
if(media){
466
+
media.release();
467
+
done();
468
+
}
469
+
},3000);
470
+
});
471
+
472
+
it("media.spec.27 should call success or error when trying to stop a media that is in starting state",function(done){
473
+
//bb10 dialog pops up, preventing tests from running
0 commit comments