tweak to iframe lazy load test

This commit is contained in:
Hakim El Hattab 2015-05-06 11:02:41 +02:00
parent 3cd871eac0
commit e67dc9251a
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,6 @@
<li class="fragment">4.2</li>
<li class="fragment">4.3</li>
</ul>
<iframe data-src="http://example.com"></iframe>
</section>
<section>
@ -53,6 +52,7 @@
<li class="fragment" data-fragment-index="0">4.1</li>
<li class="fragment" data-fragment-index="0">4.2</li>
</ul>
<iframe data-src="http://example.com"></iframe>
</section>
<section>

View File

@ -498,9 +498,9 @@ Reveal.addEventListener( 'ready', function() {
test( 'iframe with data-src', function() {
Reveal.slide( 0, 0 );
strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 0, 'Iframe source is not set' );
Reveal.slide( 2, 0 );
strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 1, 'Iframe source is set' );
Reveal.slide( 2, 1 );
strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 1, 'Iframe source is set' );
Reveal.slide( 2, 2 );
strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 0, 'Iframe source is not set' );
});