annotate iframe-resizer/test/changePage.html @ 0:ac5f9272033b draft

first upload
author saskia-hiltemann
date Tue, 01 Jul 2014 11:42:23 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
1 <!DOCTYPE html>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 <html>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3 <head>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 <meta charset="utf-8">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5 <title>QUnit LoadHide</title>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6 <link rel="stylesheet" href="resources/qunit.css">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 </head>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 <body>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 <div id="qunit"></div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 <div id="qunit-fixture">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 <div style="width:400px;">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 <iframe src="resources/frame.content.html" width="100%" scrolling="no"></iframe>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 <script src="resources/qunit.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 <script src="resources/jquery.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 <script src="../js/iframeResizer.min.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 <script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 'use strict';
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 var msgId = '[iFrameSizerTest]:';
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 jQuery.noConflict();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 asyncTest( "iFrame change page", function() {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 var callbackCounter = 0;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 jQuery('iframe').iFrameResize({
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 log:true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 resizedCallback:function(messageData){
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 switch (''+(++callbackCounter)){
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 case '1':
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 document.getElementsByTagName('iframe')[0].contentWindow.postMessage( msgId + 'pageChange', '*' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 break;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 case '2':
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 ok( 'init' === messageData.type, 'Received '+messageData.type+' message back from iFrame. Expected init');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 start();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 });
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 });
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 </script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 </body>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 </html>