diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2013-08-23 15:57:28 -0400 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2013-08-23 15:57:28 -0400 |
commit | f2155285754358f51d4ac3659b39456058f2095a (patch) | |
tree | adcbb8c9348ebc12d67f7203a15f195d2119e61b | |
parent | 798fbc3dff202780723d44d021ee9064ec7443a9 (diff) | |
download | perl-software-in-gnu-guix-f2155285754358f51d4ac3659b39456058f2095a.tar perl-software-in-gnu-guix-f2155285754358f51d4ac3659b39456058f2095a.tar.gz |
pause mode tests
-rw-r--r-- | test/test.js | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/test/test.js b/test/test.js index ff1b675..08c5c37 100644 --- a/test/test.js +++ b/test/test.js @@ -226,7 +226,6 @@ Reveal.addEventListener( 'ready', function() { asyncTest( 'fragmenthidden event', function() { expect( 2 ); - start(); var _onEvent = function( event ) { ok( true, 'event fired' ); @@ -240,6 +239,8 @@ Reveal.addEventListener( 'ready', function() { Reveal.prev(); Reveal.next(); // shouldn't fire fragmenthidden + start(); + Reveal.removeEventListener( 'fragmenthidden', _onEvent ); }); @@ -290,25 +291,60 @@ Reveal.addEventListener( 'ready', function() { QUnit.module( 'Events' ); asyncTest( 'slidechanged', function() { - expect( 1 ); + expect( 3 ); var _onEvent = function( event ) { ok( true, 'event fired' ); - start(); } Reveal.addEventListener( 'slidechanged', _onEvent ); - // Should trigger the event - Reveal.slide( 1, 0 ); + Reveal.slide( 1, 0 ); // should trigger + Reveal.slide( 1, 0 ); // should do nothing + Reveal.next(); // should trigger + Reveal.slide( 3, 0 ); // should trigger + Reveal.next(); // should do nothing - // Should not trigger an event since it's the same # - Reveal.slide( 1, 0 ); + start(); Reveal.removeEventListener( 'slidechanged', _onEvent ); }); + asyncTest( 'paused', function() { + expect( 1 ); + + var _onEvent = function( event ) { + ok( true, 'event fired' ); + } + + Reveal.addEventListener( 'paused', _onEvent ); + + Reveal.togglePause(); + Reveal.togglePause(); + + start(); + + Reveal.removeEventListener( 'paused', _onEvent ); + }); + + asyncTest( 'resumed', function() { + expect( 1 ); + + var _onEvent = function( event ) { + ok( true, 'event fired' ); + } + + Reveal.addEventListener( 'resumed', _onEvent ); + + Reveal.togglePause(); + Reveal.togglePause(); + + start(); + + Reveal.removeEventListener( 'resumed', _onEvent ); + }); + } ); |