comparison iframe-resizer/test/sendMessage.html @ 0:ac5f9272033b draft

first upload
author saskia-hiltemann
date Tue, 01 Jul 2014 11:42:23 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:ac5f9272033b
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>QUnit LoadHide</title>
6 <link rel="stylesheet" href="resources/qunit.css">
7 </head>
8 <body>
9 <div id="qunit"></div>
10 <div id="qunit-fixture">
11
12 <div style="width:600px;">
13 <iframe src="resources/frame.content.html" width="100%" scrolling="no"></iframe>
14 </div>
15
16 </div>
17 <script src="resources/qunit.js"></script>
18 <script src="resources/jquery.js"></script>
19 <script src="resources/testLib.js"></script>
20 <script src="../js/iframeResizer.min.js"></script>
21 <script>
22
23 'use strict';
24 var
25 count = 0,
26 msgId = '[iFrameSizerTest]:';
27
28 asyncTest( "sendMessage", function() {
29
30 iFrameResize({
31 log:true,
32 enablePublicMethods:true,
33 resizedCallback:function(messageData){
34 ok( true, 'Receive init message back from iFrame.' );
35 sendMessage('chkSendMsg');
36 },
37 messageCallback:function(messageData){
38 ok( 'message: test' === messageData.message, 'Receive message back from iFrame via sendMessage function.' );
39 if (2===count){
40 sendMessage('chkSendMsg');
41 count++;
42 } else {
43 start();
44 }
45
46 }
47 });
48 });
49
50 </script>
51 </body>
52 </html>