| <html> |
| <head> |
| <script> |
| var testFrame; |
| var testDiv; |
| |
| function runTest() { |
| testFrame = document.getElementById('fullscreenFrame'); |
| testDiv = testFrame.contentWindow.document.getElementById('testDiv'); |
| // Bail out early if the full screen API is not enabled or is missing: |
| if (Element.prototype.webkitRequestFullScreen == undefined) { |
| logResult(false, "Element.prototype.webkitRequestFullScreen == undefined"); |
| endTest(); |
| } else { |
| // Test if the iframe expands full screen when max-width/max-height are set. |
| waitForEventTestAndEnd(document, 'webkitfullscreenchange', "testFrame.getBoundingClientRect().right == document.body.getBoundingClientRect().right && testFrame.getBoundingClientRect().bottom == document.body.getBoundingClientRect().bottom"); |
| runWithKeyDown(function(){ testDiv.webkitRequestFullScreen(); }); |
| } |
| } |
| </script> |
| <script src='full-screen-test.js'></script> |
| </head> |
| <body style="margin: 0px;"> |
| <iframe onload='runTest();' id='fullscreenFrame' src='data:text/html,<div id="testDiv">test</div>' style='max-width: 10px; max-height: 10px;' frameborder='0' webkitallowfullscreen></iframe> |
| </body> |