( src, assert, callback )
| 9 | } ); |
| 10 | |
| 11 | var loadIframe = function( src, assert, callback ) { |
| 12 | console.log( 'Begin loadIframe' ); |
| 13 | |
| 14 | // When running in Karma, the #qunit-fixture appears from somewhere and we can't set its |
| 15 | // contents in advance, so we set it now. |
| 16 | var fix = document.getElementById( 'qunit-fixture' ); |
| 17 | fix.innerHTML = [ |
| 18 | '\n', |
| 19 | ' <iframe id="presentation-iframe"\n', |
| 20 | ' width="595" height="485"\n', |
| 21 | ' frameborder="0" marginwidth="0" marginheight="0" scrolling="no"\n', |
| 22 | ' style="border:1px solid #CCC; max-width: 100%;">\n', |
| 23 | ' </iframe>' |
| 24 | ].join( '' ); |
| 25 | |
| 26 | var iframe = document.getElementById( 'presentation-iframe' ); |
| 27 | |
| 28 | var onLoad = function() { |
| 29 | assert.ok( true, |
| 30 | 'Presentation loaded. iframe.src = ' + iframe.src ); |
| 31 | try { |
| 32 | assert.ok( iframe.contentDocument, |
| 33 | 'Verifying that tests can access the presentation inside the iframe. ' + |
| 34 | 'Note: On Firefox this fails when using paths with "../" parts for the iframe.' ); |
| 35 | } |
| 36 | catch ( err ) { |
| 37 | assert.ok( false, |
| 38 | 'Error when trying to access presentation in iframe. Note: When using Chrome with ' + |
| 39 | 'local files (file:///) this will fail with SecurityError. ' + |
| 40 | 'You can however use Chrome over Karma.' ); |
| 41 | } |
| 42 | console.log( 'End loadIframe' ); |
| 43 | callback(); |
| 44 | }; |
| 45 | |
| 46 | iframe.addEventListener( 'load', onLoad ); |
| 47 | |
| 48 | assert.ok( iframe.src = src, |
| 49 | 'Setting iframe.src = ' + src ); |
| 50 | }; |
| 51 | |
| 52 | var initPresentation = function( assert, callback, rootId ) { |
| 53 | console.log( 'Begin initPresentation' ); |
no outgoing calls
no test coverage detected