comparison iframe-resizer/test/scrolling.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="../js/iframeResizer.min.js"></script>
20 <script>
21
22 'use strict';
23 var msgId = '[iFrameSizerTest]:';
24
25 asyncTest( "scrolling not set", function() {
26 $('iframe').iFrameResize({
27 log:true,
28 resizedCallback:function(messageData){
29 ok( true, 'Receive message back from iFrame.' );
30 ok( 'hidden' === messageData.iframe.style.overflow, 'iFrame overflow = ' + messageData.iframe.style.overflow + '. Expected \'hidden\'.' );
31 ok( 'no' === messageData.iframe.scrolling, 'iFrame scrolling = ' + messageData.iframe.scrolling + '. Expected \'no\'.' );
32 start();
33 }
34 });
35 });
36
37 asyncTest( "scrolling = false", function() {
38 $('iframe').iFrameResize({
39 log:true,
40 scrolling:false,
41 resizedCallback:function(messageData){
42 ok( true, 'Receive message back from iFrame.' );
43 ok( 'hidden' === messageData.iframe.style.overflow, 'iFrame overflow = ' + messageData.iframe.style.overflow + '. Expected \'hidden\'.' );
44 ok( 'no' === messageData.iframe.scrolling, 'iFrame scrolling = ' + messageData.iframe.scrolling + '. Expected \'no\'.' );
45 start();
46 }
47 });
48 });
49
50 asyncTest( "scrolling = true", function() {
51 $('iframe').iFrameResize({
52 log:true,
53 scrolling:true,
54 resizedCallback:function(messageData){
55 ok( true, 'Receive message back from iFrame.' );
56 ok( 'auto' === messageData.iframe.style.overflow, 'iFrame overflow = ' + messageData.iframe.style.overflow + '. Expected \'auto\'.' );
57 ok( 'yes' === messageData.iframe.scrolling, 'iFrame scrolling = ' + messageData.iframe.scrolling + '. Expected \'yes\'.' );
58 start();
59 }
60 });
61 });
62
63 </script>
64 </body>
65 </html>