OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <!-- This page is meant to loaded inside the host browser (IE, FF, etc.) --> |
| 3 <head> |
| 4 <script type="text/javascript" |
| 5 src="chrome_frame_tester_helpers.js"></script> |
| 6 <script type="text/javascript" |
| 7 src="CFInstance.js"></script> |
| 8 </head> |
| 9 |
| 10 <body> |
| 11 <div id="statusPanel" style="border: 1px solid red; width: 100%"> |
| 12 Test running.... |
| 13 </div> |
| 14 |
| 15 <div id="parent"> |
| 16 <div id="prev">before</div><div id="toBeReplaced"> |
| 17 fallback content goes here |
| 18 </div><div id="after">after</div> |
| 19 </div> |
| 20 <script type="text/javascript"> |
| 21 var testName = "CFInstanceIfrPost"; |
| 22 (function() { |
| 23 if (!CFInstance.contentTests.postMessage()) { |
| 24 onSuccess(testName, 1); |
| 25 } else { |
| 26 try { |
| 27 var cf = new CFInstance({ |
| 28 node: "toBeReplaced", |
| 29 src: "CFInstance_post_frame.html", |
| 30 onload: function() { |
| 31 cf.postMessage("howdy!"); |
| 32 }, |
| 33 onmessage: function(evt) { |
| 34 if (evt.data == 'hola!') { |
| 35 onSuccess(testName, 1); |
| 36 } |
| 37 }, |
| 38 requirements: [] // always use an iframe |
| 39 }); |
| 40 } catch (e) { |
| 41 onFailure(testName, 1, |
| 42 "CFInstance constructor failed with error: "+e); |
| 43 } |
| 44 } |
| 45 })(); |
| 46 </script> |
| 47 <p>Tests CFInstance event handling on iframes</p> |
| 48 </body> |
| 49 </html> |
| 50 |
OLD | NEW |