@@ -4,25 +4,10 @@ describe('WebRTC API', function() {
4
4
var session ,
5
5
LOGIN_TIMEOUT = 10000 ;
6
6
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
-
22
7
beforeAll ( function ( done ) {
23
8
QB . init ( CREDENTIALS . appId , CREDENTIALS . authKey , CREDENTIALS . authSecret ) ;
24
9
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 ) {
26
11
if ( err ) {
27
12
done . fail ( "Chat login error: " + JSON . stringify ( err ) ) ;
28
13
} else {
@@ -33,7 +18,7 @@ describe('WebRTC API', function() {
33
18
34
19
35
20
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 ) ;
37
22
38
23
expect ( session ) . not . toBeNull ( ) ;
39
24
expect ( session . ID ) . not . toBeNull ( ) ;
@@ -45,45 +30,43 @@ describe('WebRTC API', function() {
45
30
var errorString = 'Can\'t create a session with the same opponentsIDs. There is a session already in NEW or ACTIVE state.' ;
46
31
47
32
expect ( function ( ) {
48
- QB . webrtc . createNewSession ( getAllCalees ( QBUsers ) ) ;
33
+ QB . webrtc . createNewSession ( [ QBUser2 . id ] , QB . webrtc . CallType . VIDEO ) ;
49
34
} ) . toThrow ( new Error ( errorString ) ) ;
50
35
} ) ;
51
36
52
37
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
+ // });
88
71
89
72
} ) ;
0 commit comments