| Index: chrome_frame/test/data/initialize_hidden.html
|
| ===================================================================
|
| --- chrome_frame/test/data/initialize_hidden.html (revision 0)
|
| +++ chrome_frame/test/data/initialize_hidden.html (revision 0)
|
| @@ -0,0 +1,120 @@
|
| +<html>
|
| + <!-- This page is meant to load inside the host browser like IE/FF -->
|
| + <head><title>Initialize hidden chrome frame</title>
|
| + <script type="text/javascript" src="chrome_frame_tester_helpers.js">
|
| + </script>
|
| + <script type="text/javascript">
|
| + var g_failure_timeout = null;
|
| + var g_test_id = 1;
|
| + var g_test_name = 'InitializeHidden';
|
| + var g_cf3_loaded = false;
|
| +
|
| + function OnNavigationFailed() {
|
| + onFailure(g_test_name, g_test_id, 'ChromeFrame Navigation failed');
|
| + }
|
| +
|
| + function OnObjectFocusFailed() {
|
| + appendStatus('chrome frame focus failed');
|
| + onFailure(g_test_name, g_test_id, 'Visibility test failed');
|
| + }
|
| +
|
| + function OnCF1Loaded() {
|
| + appendStatus('Chrome frame 1 loaded, not visible yet.');
|
| + try {
|
| + // Make chrome frame visible
|
| + var cf1 = document.getElementById('CFDiv1');
|
| + cf1.style.visibility = 'visible';
|
| + appendStatus('Chrome frame 1 visibility - ' + cf1.style.visibility);
|
| + // Set focus to chrome frame. This should set focus to the
|
| + // first element inside the frame, which a script inside the
|
| + // page will detect and notify us back by sending us a message.
|
| + document.ChromeFrame1.focus();
|
| + g_failure_timeout = window.setTimeout(OnObjectFocusFailed, 10000);
|
| + } catch(e) {
|
| + appendStatus('Error setting focus to CF1. Error: ' + e.description);
|
| + onFailure(g_test_name, g_test_id, 'CF1 focus() error');
|
| + }
|
| + }
|
| +
|
| + function OnCF1Message(evt) {
|
| + if (evt.data == 'btnOnFocus') {
|
| + window.clearTimeout(g_failure_timeout);
|
| + g_failure_timeout = null;
|
| + appendStatus('CF1 visible and focused');
|
| +
|
| + // Now make second chrome frame instance visible
|
| + document.getElementById('CFDiv2').style.display = 'block';
|
| + appendStatus('Chrome frame 2 visible, should start loading now');
|
| + g_failure_timeout = window.setTimeout(OnObjectFocusFailed, 10000);
|
| + }
|
| + }
|
| +
|
| + function OnCF2Loaded() {
|
| + appendStatus('Chrome frame 2 loaded');
|
| + try {
|
| + // Set focus to chrome frame. This should set focus to the
|
| + // first element inside the frame, which a script inside the
|
| + // page will detect and notify us back by sending us a message.
|
| + // We set focus on a timeout as on IE it takes a while for the window
|
| + // to become visible.
|
| + setTimeout(SetFocusToCF2, 100);
|
| + } catch(e) {
|
| + appendStatus('Error setting focus to CF2. Error: ' + e.description);
|
| + onFailure(g_test_name, g_test_id, 'CF2 focus() error');
|
| + }
|
| + }
|
| +
|
| + function SetFocusToCF2() {
|
| + document.ChromeFrame2.focus();
|
| + }
|
| +
|
| + function OnCF2Message(evt) {
|
| + if (evt.data == 'btnOnFocus') {
|
| + window.clearTimeout(g_failure_timeout);
|
| + g_failure_timeout = null;
|
| + appendStatus('CF2 visible and focused');
|
| + onSuccess(g_test_name, g_test_id);
|
| + }
|
| + }
|
| + </script>
|
| + </head>
|
| + <body>
|
| + <div id="CFDiv1" style="visibility: hidden;">
|
| + <object id="ChromeFrame1" width="300" height="80" tabindex="0"
|
| + codebase="http://www.google.com"
|
| + classid="CLSID:E0A900DF-9611-4446-86BD-4B1D47E7DB2A">
|
| + <param name="src" value="simple_object_focus_cf.html">
|
| + <param name="onload" value="OnCF1Loaded();">
|
| + <param name="onloaderror" value="OnNavigationFailed();">
|
| + <param name="onmessage" value="OnCF1Message(arguments[0]);">
|
| + <embed width="300" height="80" name="ChromeFrame1"
|
| + type="application/chromeframe"
|
| + src="simple_object_focus_cf.html"
|
| + onload="OnCF1Loaded();"
|
| + onloaderror="OnNavigationFailed();"
|
| + onmessage="OnCF1Message(arguments[0]);">
|
| + </embed>
|
| + </object>
|
| + </div>
|
| + <div id="CFDiv2" style="display: none;">
|
| + <object id="ChromeFrame2" width="300" height="80" tabindex="1"
|
| + codebase="http://www.google.com"
|
| + classid="CLSID:E0A900DF-9611-4446-86BD-4B1D47E7DB2A">
|
| + <param name="src" value="simple_object_focus_cf.html">
|
| + <param name="onload" value="OnCF2Loaded();">
|
| + <param name="onloaderror" value="OnNavigationFailed();">
|
| + <param name="onmessage" value="OnCF2Message(arguments[0]);">
|
| + <embed width="300" height="80" name="ChromeFrame2"
|
| + type="application/chromeframe"
|
| + src="simple_object_focus_cf.html"
|
| + onload="OnCF2Loaded();"
|
| + onloaderror="OnNavigationFailed();"
|
| + onmessage="OnCF2Message(arguments[0]);">
|
| + </embed>
|
| + </object>
|
| + </div>
|
| + <div id="statusPanel" style="border: 1px solid red; width: 100%">
|
| + Test running....
|
| + </div>
|
| + </body>
|
| +</html>
|
|
|