Skip to content
This repository
Browse code

Merge pull request #117 from stevenaw/t1102

[#1102] Update youtube test 'exec', 'listen' to 'cue', 'on'
  • Loading branch information...
commit 5dda07bba4809f18c6990e994342b67872ad661f 2 parents 5ea8870 + 987a496
ScottDowne authored July 04, 2012

Showing 1 changed file with 19 additions and 19 deletions. Show diff stats Hide diff stats

  1. 38  players/youtube/popcorn.youtube.unit.js
38  players/youtube/popcorn.youtube.unit.js
@@ -22,7 +22,7 @@ asyncTest( "Player play, pause, autoplay", function() {
22 22
 
23 23
   pop1 = Popcorn.youtube( "#video6", "http://www.youtube.com/watch?v=nfGV32RNkhw" );
24 24
 
25  
-  pop1.listen( "canplaythrough", function() {
  25
+  pop1.on( "canplaythrough", function() {
26 26
 
27 27
     pop1.play();
28 28
 
@@ -32,7 +32,7 @@ asyncTest( "Player play, pause, autoplay", function() {
32 32
 
33 33
   pop2 = Popcorn.youtube( "#video7", "http://www.youtube.com/watch?v=nfGV32RNkhw" );
34 34
 
35  
-  pop2.listen( "canplaythrough", function() {
  35
+  pop2.on( "canplaythrough", function() {
36 36
 
37 37
     equal( pop2.media.paused, true, "popcorn 2 pauses" );
38 38
     plus();
@@ -40,7 +40,7 @@ asyncTest( "Player play, pause, autoplay", function() {
40 40
 
41 41
   pop3 = Popcorn.youtube( "#video8", "http://www.youtube.com/watch?v=nfGV32RNkhw&autoplay=0" );
42 42
 
43  
-  pop3.listen( "canplaythrough", function() {
  43
+  pop3.on( "canplaythrough", function() {
44 44
 
45 45
     equal( pop3.media.paused, true, "popcorn 3 autoplay off paused" );
46 46
     plus();
@@ -48,7 +48,7 @@ asyncTest( "Player play, pause, autoplay", function() {
48 48
 
49 49
   pop4 = Popcorn.youtube( "#video9", "http://www.youtube.com/watch?v=nfGV32RNkhw&autoplay=1" );
50 50
 
51  
-  pop4.listen( "canplaythrough", function() {
  51
+  pop4.on( "canplaythrough", function() {
52 52
 
53 53
     equal( pop4.media.paused, false, "popcorn 4 is autoplaying" );
54 54
     plus();
@@ -75,7 +75,7 @@ asyncTest("Update Timer", function () {
75 75
       Popcorn.removePlugin( "forwards" );
76 76
       Popcorn.removePlugin( "backwards" );
77 77
       Popcorn.removePlugin( "wrapper" );
78  
-      p2.removePlugin( "exec" );
  78
+      p2.removePlugin( "cue" );
79 79
       p2.destroy();
80 80
       start();
81 81
     }
@@ -166,7 +166,7 @@ asyncTest("Update Timer", function () {
166 166
     wrapper: "two"
167 167
   })
168 168
   // checking wrapper 2's start
169  
-  .exec( 5, function() {
  169
+  .cue( 5, function() {
170 170
 
171 171
     if ( execCount === 0 ) {
172 172
 
@@ -178,7 +178,7 @@ asyncTest("Update Timer", function () {
178 178
     }
179 179
   })
180 180
   // checking wrapper 1's start
181  
-  .exec( 6, function() {
  181
+  .cue( 6, function() {
182 182
 
183 183
     if ( execCount === 1 ) {
184 184
 
@@ -190,7 +190,7 @@ asyncTest("Update Timer", function () {
190 190
     }
191 191
   })
192 192
   // checking wrapper 1's end
193  
-  .exec( 7, function() {
  193
+  .cue( 7, function() {
194 194
 
195 195
     if ( execCount === 2 ) {
196 196
 
@@ -202,7 +202,7 @@ asyncTest("Update Timer", function () {
202 202
     }
203 203
   })
204 204
   // checking wrapper 2's end
205  
-  .exec( 8, function() {
  205
+  .cue( 8, function() {
206 206
 
207 207
     if ( execCount === 3 ) {
208 208
 
@@ -214,7 +214,7 @@ asyncTest("Update Timer", function () {
214 214
     }
215 215
   });
216 216
 
217  
-  p2.exec( 3, function() {
  217
+  p2.cue( 3, function() {
218 218
     p2.play();
219 219
   });
220 220
 
@@ -369,7 +369,7 @@ asyncTest( "Popcorn YouTube Plugin Url and Duration Tests", function() {
369 369
     plus();
370 370
   });
371 371
 
372  
-  popcorn.listen( "durationchange", function() {
  372
+  popcorn.on( "durationchange", function() {
373 373
 
374 374
     notEqual( popcorn.duration(), 0, "Duration has been changed from 0" );
375 375
     plus();
@@ -423,7 +423,7 @@ asyncTest( "Popcorn YouTube Plugin Url Regex Test", function() {
423 423
     var urlTest = urlTests[ key ],
424 424
         popcorn = Popcorn.youtube( "#video" + i++, urlTest.url );
425 425
 
426  
-    popcorn.listen( "loadeddata", function() {
  426
+    popcorn.on( "loadeddata", function() {
427 427
 
428 428
       equal( popcorn.media.src, urlTest.expected, "Video id is correct for " + urlTest.name + ": " + urlTest.url );
429 429
       popcorn.pause();
@@ -492,12 +492,12 @@ asyncTest( "YouTube ended event", function() {
492 492
 
493 493
   var pop = Popcorn.youtube( "#video10", "http://www.youtube.com/watch?v=nfGV32RNkhw" );
494 494
 
495  
-  pop.listen( "ended", function() {
  495
+  pop.on( "ended", function() {
496 496
     ok( true, "YouTube is successfully firing the ended event" );
497 497
     start();
498 498
   });
499 499
 
500  
-  pop.exec( 5, function(){
  500
+  pop.cue( 5, function(){
501 501
     pop.currentTime( 150 );
502 502
   });
503 503
 
@@ -505,7 +505,7 @@ asyncTest( "YouTube ended event", function() {
505 505
 });
506 506
 
507 507
 asyncTest( "youtube player gets a proper _teardown", function() {
508  
-  
  508
+
509 509
   var count = 0,
510 510
       expects = 1;
511 511
 
@@ -519,7 +519,7 @@ asyncTest( "youtube player gets a proper _teardown", function() {
519 519
   expect( expects );
520 520
 
521 521
   var popcorn = Popcorn.youtube( "#video9", "http://www.youtube.com/watch?v=nfGV32RNkhw" );
522  
-  popcorn.listen( "loadeddata", function() {
  522
+  popcorn.on( "loadeddata", function() {
523 523
 
524 524
     popcorn.destroy();
525 525
     equal( popcorn.media.children.length, 0, "" );
@@ -546,7 +546,7 @@ asyncTest( "Youtube ready state events", function() {
546 546
   expect( expects );
547 547
 
548 548
   var popcorn = Popcorn.youtube( "#video9", "http://www.youtube.com/watch?v=nfGV32RNkhw" );
549  
-  popcorn.listen( "loadeddata", function() {
  549
+  popcorn.on( "loadeddata", function() {
550 550
 
551 551
     popcorn.destroy();
552 552
     equal( popcorn.media.children.length, 0, "" );
@@ -650,13 +650,13 @@ asyncTest( "Youtube media start time fragment", function() {
650 650
 });
651 651
 
652 652
 asyncTest( "youtube player quarantine", function() {
653  
-  
  653
+
654 654
   ok( window.quarantineYT, "quarantine of broken youtube player exists." );
655 655
   start();
656 656
 });
657 657
 
658 658
 asyncTest( "youtube can play type", function() {
659  
-  
  659
+
660 660
   ok( Popcorn.youtube.canPlayType( "div", "http://youtube.com/watch/v/6v3jsVivU6U?format=json" ), "youtube can play url in this format: http://youtube.com/watch/v/6v3jsVivU6U?format=json" );
661 661
   ok( Popcorn.youtube.canPlayType( "div", "http://www.youtube.com/v/M3r2XDceM6A&fs=1" ), "youtube can play url in this format: http://www.youtube.com/v/M3r2XDceM6A&fs=1" );
662 662
   ok( Popcorn.youtube.canPlayType( "div", "youtube.com/v/M3r2XDceM6A&fs=1" ), "youtube can play url in this format: youtube.com/v/M3r2XDceM6A&fs=1" );

0 notes on commit 5dda07b

Please sign in to comment.
Something went wrong with that request. Please try again.