diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/assets/external-script-a.js | 1 | ||||
-rw-r--r-- | test/assets/external-script-b.js | 1 | ||||
-rw-r--r-- | test/assets/external-script-c.js | 1 | ||||
-rw-r--r-- | test/assets/external-script-d.js | 1 | ||||
-rw-r--r-- | test/examples/embedded-media.html | 1 | ||||
-rw-r--r-- | test/examples/math.html | 1 | ||||
-rw-r--r-- | test/examples/slide-backgrounds.html | 1 | ||||
-rw-r--r-- | test/examples/slide-transitions.html | 1 | ||||
-rw-r--r-- | test/test-async-dependencies.html | 74 | ||||
-rw-r--r-- | test/test-dependencies.html | 54 | ||||
-rw-r--r-- | test/test-markdown-element-attributes.html | 1 | ||||
-rw-r--r-- | test/test-markdown-external.html | 1 | ||||
-rw-r--r-- | test/test-markdown-options.html | 1 | ||||
-rw-r--r-- | test/test-markdown-slide-attributes.html | 1 | ||||
-rw-r--r-- | test/test-markdown.html | 1 | ||||
-rw-r--r-- | test/test-pdf.html | 1 | ||||
-rw-r--r-- | test/test.html | 1 |
17 files changed, 132 insertions, 11 deletions
diff --git a/test/assets/external-script-a.js b/test/assets/external-script-a.js new file mode 100644 index 0000000..cbc8da1 --- /dev/null +++ b/test/assets/external-script-a.js @@ -0,0 +1 @@ +window.externalScriptSequence += 'A';
\ No newline at end of file diff --git a/test/assets/external-script-b.js b/test/assets/external-script-b.js new file mode 100644 index 0000000..e5bca5a --- /dev/null +++ b/test/assets/external-script-b.js @@ -0,0 +1 @@ +window.externalScriptSequence += 'B';
\ No newline at end of file diff --git a/test/assets/external-script-c.js b/test/assets/external-script-c.js new file mode 100644 index 0000000..7d4ccf6 --- /dev/null +++ b/test/assets/external-script-c.js @@ -0,0 +1 @@ +window.externalScriptSequence += 'C';
\ No newline at end of file diff --git a/test/assets/external-script-d.js b/test/assets/external-script-d.js new file mode 100644 index 0000000..1c5925b --- /dev/null +++ b/test/assets/external-script-d.js @@ -0,0 +1 @@ +window.externalScriptSequence += 'D';
\ No newline at end of file diff --git a/test/examples/embedded-media.html b/test/examples/embedded-media.html index bbad4be..312c48c 100644 --- a/test/examples/embedded-media.html +++ b/test/examples/embedded-media.html @@ -34,7 +34,6 @@ </div> - <script src="../../lib/js/head.min.js"></script> <script src="../../js/reveal.js"></script> <script> diff --git a/test/examples/math.html b/test/examples/math.html index d35e827..17a1a7e 100644 --- a/test/examples/math.html +++ b/test/examples/math.html @@ -159,7 +159,6 @@ </div> - <script src="../../lib/js/head.min.js"></script> <script src="../../js/reveal.js"></script> <script> diff --git a/test/examples/slide-backgrounds.html b/test/examples/slide-backgrounds.html index 316c92a..e08d260 100644 --- a/test/examples/slide-backgrounds.html +++ b/test/examples/slide-backgrounds.html @@ -122,7 +122,6 @@ </div> - <script src="../../lib/js/head.min.js"></script> <script src="../../js/reveal.js"></script> <script> diff --git a/test/examples/slide-transitions.html b/test/examples/slide-transitions.html index 88119dc..b7520ab 100644 --- a/test/examples/slide-transitions.html +++ b/test/examples/slide-transitions.html @@ -81,7 +81,6 @@ </div> - <script src="../../lib/js/head.min.js"></script> <script src="../../js/reveal.js"></script> <script> diff --git a/test/test-async-dependencies.html b/test/test-async-dependencies.html new file mode 100644 index 0000000..d08db28 --- /dev/null +++ b/test/test-async-dependencies.html @@ -0,0 +1,74 @@ +<!doctype html> +<html lang="en"> + + <head> + <meta charset="utf-8"> + + <title>reveal.js - Test Async Dependencies</title> + + <link rel="stylesheet" href="../css/reveal.css"> + <link rel="stylesheet" href="qunit-2.5.0.css"> + </head> + + <body style="overflow: auto;"> + + <div id="qunit"></div> + <div id="qunit-fixture"></div> + + <div class="reveal" style="display: none;"> + + <div class="slides"> + + <section>Slide content</section> + + </div> + + </div> + + <script src="../js/reveal.js"></script> + <script src="qunit-2.5.0.js"></script> + + <script> + window.externalScriptSequence = ''; + + QUnit.module( 'Async Dependencies' ); + + var scriptCount = 0; + + QUnit.test( 'Async scripts are loaded', function( assert ) { + assert.expect( 5 ); + var done = assert.async( 5 ); + + function callback( event ) { + if( window.externalScriptSequence.length === 1 ) { + assert.ok( window.externalScriptSequence === 'A', 'first callback was sync script' ); + } + else { + assert.ok( true, 'async script loaded' ); + } + + if( window.externalScriptSequence.length === 4 ) { + assert.ok( window.externalScriptSequence.indexOf( 'A' ) !== -1 && + window.externalScriptSequence.indexOf( 'B' ) !== -1 && + window.externalScriptSequence.indexOf( 'C' ) !== -1 && + window.externalScriptSequence.indexOf( 'D' ) !== -1, 'four unique scripts were loaded' ); + } + + done(); + scriptCount ++; + } + + Reveal.initialize({ + dependencies: [ + { src: 'assets/external-script-a.js', async: false, callback: callback }, + { src: 'assets/external-script-b.js', async: true, callback: callback }, + { src: 'assets/external-script-c.js', async: true, callback: callback }, + { src: 'assets/external-script-d.js', async: true, callback: callback } + ] + }); + }); + + </script> + + </body> +</html> diff --git a/test/test-dependencies.html b/test/test-dependencies.html new file mode 100644 index 0000000..49aaf60 --- /dev/null +++ b/test/test-dependencies.html @@ -0,0 +1,54 @@ +<!doctype html> +<html lang="en"> + + <head> + <meta charset="utf-8"> + + <title>reveal.js - Test Dependencies</title> + + <link rel="stylesheet" href="../css/reveal.css"> + <link rel="stylesheet" href="qunit-2.5.0.css"> + </head> + + <body style="overflow: auto;"> + + <div id="qunit"></div> + <div id="qunit-fixture"></div> + + <div class="reveal" style="display: none;"> + + <div class="slides"> + + <section>Slide content</section> + + </div> + + </div> + + <script src="../js/reveal.js"></script> + <script src="qunit-2.5.0.js"></script> + + <script> + window.externalScriptSequence = ''; + + Reveal.addEventListener( 'ready', function() { + + QUnit.module( 'Dependencies' ); + + QUnit.test( 'Load synchronous scripts', function( assert ) { + assert.strictEqual( window.externalScriptSequence, 'ABC', 'Loaded and executed in order' ); + }); + + } ); + + Reveal.initialize({ + dependencies: [ + { src: 'assets/external-script-a.js' }, + { src: 'assets/external-script-b.js' }, + { src: 'assets/external-script-c.js' } + ] + }); + </script> + + </body> +</html> diff --git a/test/test-markdown-element-attributes.html b/test/test-markdown-element-attributes.html index 4a09272..409d068 100644 --- a/test/test-markdown-element-attributes.html +++ b/test/test-markdown-element-attributes.html @@ -122,7 +122,6 @@ </div> - <script src="../lib/js/head.min.js"></script> <script src="../js/reveal.js"></script> <script src="../plugin/markdown/marked.js"></script> <script src="../plugin/markdown/markdown.js"></script> diff --git a/test/test-markdown-external.html b/test/test-markdown-external.html index d4912b0..76c6ae6 100644 --- a/test/test-markdown-external.html +++ b/test/test-markdown-external.html @@ -23,7 +23,6 @@ </div> - <script src="../lib/js/head.min.js"></script> <script src="../js/reveal.js"></script> <script src="../plugin/highlight/highlight.js"></script> <script src="../plugin/markdown/marked.js"></script> diff --git a/test/test-markdown-options.html b/test/test-markdown-options.html index 598243a..5391a19 100644 --- a/test/test-markdown-options.html +++ b/test/test-markdown-options.html @@ -31,7 +31,6 @@ </div> - <script src="../lib/js/head.min.js"></script> <script src="../js/reveal.js"></script> <script src="qunit-2.5.0.js"></script> diff --git a/test/test-markdown-slide-attributes.html b/test/test-markdown-slide-attributes.html index e90a9cf..ba9e710 100644 --- a/test/test-markdown-slide-attributes.html +++ b/test/test-markdown-slide-attributes.html @@ -116,7 +116,6 @@ </div> - <script src="../lib/js/head.min.js"></script> <script src="../js/reveal.js"></script> <script src="../plugin/markdown/marked.js"></script> <script src="../plugin/markdown/markdown.js"></script> diff --git a/test/test-markdown.html b/test/test-markdown.html index 00f7e7a..e1e5926 100644 --- a/test/test-markdown.html +++ b/test/test-markdown.html @@ -40,7 +40,6 @@ </div> - <script src="../lib/js/head.min.js"></script> <script src="../js/reveal.js"></script> <script src="../plugin/markdown/marked.js"></script> <script src="../plugin/markdown/markdown.js"></script> diff --git a/test/test-pdf.html b/test/test-pdf.html index 5ab8578..1455fb9 100644 --- a/test/test-pdf.html +++ b/test/test-pdf.html @@ -73,7 +73,6 @@ </div> - <script src="../lib/js/head.min.js"></script> <script src="../js/reveal.js"></script> <script src="qunit-2.5.0.js"></script> diff --git a/test/test.html b/test/test.html index f0a5050..67932b7 100644 --- a/test/test.html +++ b/test/test.html @@ -76,7 +76,6 @@ </div> - <script src="../lib/js/head.min.js"></script> <script src="../js/reveal.js"></script> <script src="qunit-2.5.0.js"></script> |