@@ -4,25 +4,10 @@ describe('WebRTC API', function() {
44 var session ,
55 LOGIN_TIMEOUT = 10000 ;
66
7- /**
8- * [getAllCalees]
9- * @return {[array] } [array of calles's id]
10- */
11- function getAllCalees ( users ) {
12- var arr = [ ] ;
13-
14- users . forEach ( function ( el ) {
15- arr . push ( el . id ) ;
16- } ) ;
17-
18- return arr ;
19- }
20-
21-
227 beforeAll ( function ( done ) {
238 QB . init ( CREDENTIALS . appId , CREDENTIALS . authKey , CREDENTIALS . authSecret ) ;
249
25- QB . chat . connect ( { userId : QBUser2 . id , password : QBUser2 . pass } , function ( err , roster ) {
10+ QB . chat . connect ( { userId : QBUser1 . id , password : QBUser1 . password } , function ( err , roster ) {
2611 if ( err ) {
2712 done . fail ( "Chat login error: " + JSON . stringify ( err ) ) ;
2813 } else {
@@ -33,7 +18,7 @@ describe('WebRTC API', function() {
3318
3419
3520 it ( 'can create a session' , function ( ) {
36- session = QB . webrtc . createNewSession ( getAllCalees ( QBUsers ) , 2 , QBUser2 . id ) ;
21+ session = QB . webrtc . createNewSession ( [ QBUser2 . id ] , QB . webrtc . CallType . VIDEO ) ;
3722
3823 expect ( session ) . not . toBeNull ( ) ;
3924 expect ( session . ID ) . not . toBeNull ( ) ;
@@ -45,45 +30,43 @@ describe('WebRTC API', function() {
4530 var errorString = 'Can\'t create a session with the same opponentsIDs. There is a session already in NEW or ACTIVE state.' ;
4631
4732 expect ( function ( ) {
48- QB . webrtc . createNewSession ( getAllCalees ( QBUsers ) ) ;
33+ QB . webrtc . createNewSession ( [ QBUser2 . id ] , QB . webrtc . CallType . VIDEO ) ;
4934 } ) . toThrow ( new Error ( errorString ) ) ;
5035 } ) ;
5136
5237
53- it ( 'can get user media' , function ( done ) {
54- var mediaParams = {
55- audio : true ,
56- video : true ,
57- options : {
58- muted : true ,
59- mirror : true
60- }
61- } ;
62-
63- session . getUserMedia ( mediaParams , function ( err , stream ) {
64- if ( err ) {
65- done . fail ( 'getUserMedia: No access to mic or camera;' ) ;
66- } else {
67- expect ( stream ) . not . toBeNull ( ) ;
68- done ( ) ;
69- }
70- } ) ;
71- } ) ;
72-
73- it ( 'can call' , function ( done ) {
74- session . call ( { } ) ;
75-
76- expect ( session . state ) . toEqual ( 2 ) ;
77- done ( ) ;
78- } ) ;
79-
80-
81- it ( 'can stop the session' , function ( done ) {
82- session . stop ( { } ) ;
83-
84- expect ( session . state ) . toEqual ( 5 ) ;
85-
86- done ( ) ;
87- } ) ;
38+ // it('can get user media', function(done) {
39+ // var mediaParams = {
40+ // audio: true,
41+ // video: true,
42+ // options: {
43+ // muted: true,
44+ // mirror: true
45+ // }
46+ // };
47+ //
48+ // session.getUserMedia(mediaParams, function(err, stream) {
49+ // if(err) {
50+ // done.fail('getUserMedia: No access to mic or camera;');
51+ // } else {
52+ // expect(stream).not.toBeNull();
53+ // done();
54+ // }
55+ // });
56+ // }, 5000);
57+ //
58+ //
59+ // it('can call', function(done) {
60+ // session.call({});
61+ // expect(session.state).toEqual(2);
62+ // done();
63+ // });
64+ //
65+ //
66+ // it('can stop the session', function(done) {
67+ // session.stop({});
68+ // expect(session.state).toEqual(5);
69+ // done();
70+ // });
8871
8972} ) ;
0 commit comments