| OLD | NEW |
| 1 <body onload="runTest();"> | 1 <body onload="runTest();"> |
| 2 <div>This tests the restrictions to entering full screen mode laid out in sectio
n 4.1 of the W3C | 2 <div>This tests the restrictions to entering full screen mode laid out in sectio
n 4.1 of the W3C |
| 3 <a href="http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html">Full Scree
n API</a></div> | 3 <a href="http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html">Full Scree
n API</a></div> |
| 4 <script src="full-screen-test.js"></script> | 4 <script src="full-screen-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 // Bail out early if the full screen API is not enabled or is missing: | 6 // Bail out early if the full screen API is not enabled or is missing: |
| 7 if (Element.prototype.webkitRequestFullScreen == undefined) { | 7 if (Element.prototype.webkitRequestFullScreen == undefined) { |
| 8 logResult(false, "Element.prototype.webkitRequestFullScreen == undefined
"); | 8 logResult(false, "Element.prototype.webkitRequestFullScreen == undefined
"); |
| 9 endTest(); | 9 endTest(); |
| 10 } else { | 10 } else { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 document.webkitExitFullscreen(); | 34 document.webkitExitFullscreen(); |
| 35 }); | 35 }); |
| 36 runWithKeyDown(function(){div2.webkitRequestFullscreen()}); | 36 runWithKeyDown(function(){div2.webkitRequestFullscreen()}); |
| 37 }); | 37 }); |
| 38 runWithKeyDown(function(){div.webkitRequestFullscreen()}); | 38 runWithKeyDown(function(){div.webkitRequestFullscreen()}); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 var step4 = function() { | 41 var step4 = function() { |
| 42 consoleWrite('"A descendant browsing context\'s document has a non-e
mpty fullscreen element stack."'); | 42 consoleWrite('"A descendant browsing context\'s document has a non-e
mpty fullscreen element stack."'); |
| 43 var iframe = document.documentElement.appendChild(document.createEle
ment('iframe')); | 43 var iframe = document.documentElement.appendChild(document.createEle
ment('iframe')); |
| 44 iframe.setAttribute('webkitallowfullscreen', 'true'); | 44 iframe.setAttribute('allowfullscreen', 'true'); |
| 45 var div = iframe.contentDocument.documentElement.appendChild(iframe.
contentDocument.createElement('div')); | 45 var div = iframe.contentDocument.documentElement.appendChild(iframe.
contentDocument.createElement('div')); |
| 46 var div2 = document.documentElement.appendChild(document.createEleme
nt('div')); | 46 var div2 = document.documentElement.appendChild(document.createEleme
nt('div')); |
| 47 waitForEventOnce(iframe.contentDocument, 'webkitfullscreenchange', f
unction() { | 47 waitForEventOnce(iframe.contentDocument, 'webkitfullscreenchange', f
unction() { |
| 48 waitForEventOnce(document, 'webkitfullscreenerror', function(){ | 48 waitForEventOnce(document, 'webkitfullscreenerror', function(){ |
| 49 waitForEventOnce(iframe.contentDocument, 'webkitfullscreench
ange', step5); | 49 waitForEventOnce(iframe.contentDocument, 'webkitfullscreench
ange', step5); |
| 50 iframe.contentDocument.webkitExitFullscreen(); | 50 iframe.contentDocument.webkitExitFullscreen(); |
| 51 }); | 51 }); |
| 52 runWithKeyDown(function(){div2.webkitRequestFullscreen()}); | 52 runWithKeyDown(function(){div2.webkitRequestFullscreen()}); |
| 53 }); | 53 }); |
| 54 runWithKeyDown(function(){div.webkitRequestFullscreen()}); | 54 runWithKeyDown(function(){div.webkitRequestFullscreen()}); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 var step5 = function() { | 57 var step5 = function() { |
| 58 consoleWrite('"This algorithm is not allowed to show a pop-up."'); | 58 consoleWrite('"This algorithm is not allowed to show a pop-up."'); |
| 59 var div = document.documentElement.appendChild(document.createElemen
t('div')); | 59 var div = document.documentElement.appendChild(document.createElemen
t('div')); |
| 60 waitForEventOnce(document, 'webkitfullscreenerror', endTest); | 60 waitForEventOnce(document, 'webkitfullscreenerror', endTest); |
| 61 div.webkitRequestFullscreen(); | 61 div.webkitRequestFullscreen(); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 if (typeof(testRunner) != 'undefined') | 64 if (typeof(testRunner) != 'undefined') |
| 65 testRunner.setPopupBlockingEnabled(true); | 65 testRunner.setPopupBlockingEnabled(true); |
| 66 } | 66 } |
| 67 </script> | 67 </script> |
| OLD | NEW |