annotate iframe-resizer/test/scrolling.html @ 9:7300ed4c1481 draft default tip

Uploaded
author saskia-hiltemann
date Mon, 04 Sep 2017 10:49:00 -0400
parents ac5f9272033b
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:600px;">
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 asyncTest( "scrolling not set", function() {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 $('iframe').iFrameResize({
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 log:true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 resizedCallback:function(messageData){
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 ok( true, 'Receive message back from iFrame.' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 ok( 'hidden' === messageData.iframe.style.overflow, 'iFrame overflow = ' + messageData.iframe.style.overflow + '. Expected \'hidden\'.' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 ok( 'no' === messageData.iframe.scrolling, 'iFrame scrolling = ' + messageData.iframe.scrolling + '. Expected \'no\'.' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 start();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 });
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 });
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 asyncTest( "scrolling = false", function() {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 $('iframe').iFrameResize({
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 log:true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 scrolling:false,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 resizedCallback:function(messageData){
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 ok( true, 'Receive message back from iFrame.' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 ok( 'hidden' === messageData.iframe.style.overflow, 'iFrame overflow = ' + messageData.iframe.style.overflow + '. Expected \'hidden\'.' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 ok( 'no' === messageData.iframe.scrolling, 'iFrame scrolling = ' + messageData.iframe.scrolling + '. Expected \'no\'.' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 start();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 });
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 });
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 asyncTest( "scrolling = true", function() {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 $('iframe').iFrameResize({
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 log:true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 scrolling:true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54 resizedCallback:function(messageData){
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 ok( true, 'Receive message back from iFrame.' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 ok( 'auto' === messageData.iframe.style.overflow, 'iFrame overflow = ' + messageData.iframe.style.overflow + '. Expected \'auto\'.' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57 ok( 'yes' === messageData.iframe.scrolling, 'iFrame scrolling = ' + messageData.iframe.scrolling + '. Expected \'yes\'.' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58 start();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 });
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 });
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 </script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64 </body>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 </html>