Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Unified Diff: LayoutTests/fullscreen/full-screen-restrictions.html

Issue 462253003: Remove early returns in fullscreen tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fullscreen/full-screen-restrictions.html
diff --git a/LayoutTests/fullscreen/full-screen-restrictions.html b/LayoutTests/fullscreen/full-screen-restrictions.html
index e86e0fd5fa7eba36454fc25879b2b7cfc71fac4d..366f5fbe6e6e66c9d1daee498f0b192d82d9e8b3 100644
--- a/LayoutTests/fullscreen/full-screen-restrictions.html
+++ b/LayoutTests/fullscreen/full-screen-restrictions.html
@@ -4,65 +4,59 @@
<a href="http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html">Full Screen API</a></div>
<script src="full-screen-test.js"></script>
<script>
- // 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 {
- var runTest = function() {
- consoleWrite('"The context object is not in a document."');
- var div = document.createElement('div');
- waitForEventOnce(document, 'webkitfullscreenerror', step2);
- runWithKeyDown(function(){div.webkitRequestFullscreen()});
- };
+ var runTest = function() {
+ consoleWrite('"The context object is not in a document."');
+ var div = document.createElement('div');
+ waitForEventOnce(document, 'webkitfullscreenerror', step2);
+ runWithKeyDown(function(){div.webkitRequestFullscreen()});
+ };
- var step2 = function() {
- consoleWrite('"The context object\'s node document, or an ancestor browsing context\'s document does not have the fullscreen enabled flag set."')
- var iframe = document.documentElement.appendChild(document.createElement('iframe'));
- var div = iframe.contentDocument.documentElement.appendChild(iframe.contentDocument.createElement('div'));
+ var step2 = function() {
+ consoleWrite('"The context object\'s node document, or an ancestor browsing context\'s document does not have the fullscreen enabled flag set."')
+ var iframe = document.documentElement.appendChild(document.createElement('iframe'));
+ var div = iframe.contentDocument.documentElement.appendChild(iframe.contentDocument.createElement('div'));
- waitForEventOnce(iframe.contentDocument, 'webkitfullscreenerror', step3);
- runWithKeyDown(function(){div.webkitRequestFullscreen()});
- };
+ waitForEventOnce(iframe.contentDocument, 'webkitfullscreenerror', step3);
+ runWithKeyDown(function(){div.webkitRequestFullscreen()});
+ };
- var step3 = function() {
- consoleWrite('"The context object\'s node document fullscreen element stack is not empty and its top element is not an ancestor of the context object."');
- var div = document.documentElement.appendChild(document.createElement('div'));
- var div2 = document.documentElement.appendChild(document.createElement('div'));
- waitForEventOnce(document, 'webkitfullscreenchange', function() {
- waitForEventOnce(document, 'webkitfullscreenerror', function() {
- waitForEventOnce(document, 'webkitfullscreenchange', step4);
- document.webkitExitFullscreen();
- });
- runWithKeyDown(function(){div2.webkitRequestFullscreen()});
+ var step3 = function() {
+ consoleWrite('"The context object\'s node document fullscreen element stack is not empty and its top element is not an ancestor of the context object."');
+ var div = document.documentElement.appendChild(document.createElement('div'));
+ var div2 = document.documentElement.appendChild(document.createElement('div'));
+ waitForEventOnce(document, 'webkitfullscreenchange', function() {
+ waitForEventOnce(document, 'webkitfullscreenerror', function() {
+ waitForEventOnce(document, 'webkitfullscreenchange', step4);
+ document.webkitExitFullscreen();
});
- runWithKeyDown(function(){div.webkitRequestFullscreen()});
- };
+ runWithKeyDown(function(){div2.webkitRequestFullscreen()});
+ });
+ runWithKeyDown(function(){div.webkitRequestFullscreen()});
+ };
- var step4 = function() {
- consoleWrite('"A descendant browsing context\'s document has a non-empty fullscreen element stack."');
- var iframe = document.documentElement.appendChild(document.createElement('iframe'));
- iframe.setAttribute('allowfullscreen', 'true');
- var div = iframe.contentDocument.documentElement.appendChild(iframe.contentDocument.createElement('div'));
- var div2 = document.documentElement.appendChild(document.createElement('div'));
- waitForEventOnce(iframe.contentDocument, 'webkitfullscreenchange', function() {
- waitForEventOnce(document, 'webkitfullscreenerror', function(){
- waitForEventOnce(iframe.contentDocument, 'webkitfullscreenchange', step5);
- iframe.contentDocument.webkitExitFullscreen();
- });
- runWithKeyDown(function(){div2.webkitRequestFullscreen()});
+ var step4 = function() {
+ consoleWrite('"A descendant browsing context\'s document has a non-empty fullscreen element stack."');
+ var iframe = document.documentElement.appendChild(document.createElement('iframe'));
+ iframe.setAttribute('allowfullscreen', 'true');
+ var div = iframe.contentDocument.documentElement.appendChild(iframe.contentDocument.createElement('div'));
+ var div2 = document.documentElement.appendChild(document.createElement('div'));
+ waitForEventOnce(iframe.contentDocument, 'webkitfullscreenchange', function() {
+ waitForEventOnce(document, 'webkitfullscreenerror', function(){
+ waitForEventOnce(iframe.contentDocument, 'webkitfullscreenchange', step5);
+ iframe.contentDocument.webkitExitFullscreen();
});
- runWithKeyDown(function(){div.webkitRequestFullscreen()});
- };
+ runWithKeyDown(function(){div2.webkitRequestFullscreen()});
+ });
+ runWithKeyDown(function(){div.webkitRequestFullscreen()});
+ };
- var step5 = function() {
- consoleWrite('"This algorithm is not allowed to show a pop-up."');
- var div = document.documentElement.appendChild(document.createElement('div'));
- waitForEventOnce(document, 'webkitfullscreenerror', endTest);
- div.webkitRequestFullscreen();
- };
+ var step5 = function() {
+ consoleWrite('"This algorithm is not allowed to show a pop-up."');
+ var div = document.documentElement.appendChild(document.createElement('div'));
+ waitForEventOnce(document, 'webkitfullscreenerror', endTest);
+ div.webkitRequestFullscreen();
+ };
- if (typeof(testRunner) != 'undefined')
- testRunner.setPopupBlockingEnabled(true);
- }
+ if (typeof(testRunner) != 'undefined')
+ testRunner.setPopupBlockingEnabled(true);
</script>
« no previous file with comments | « LayoutTests/fullscreen/full-screen-request-rejected.html ('k') | LayoutTests/fullscreen/full-screen-stacking-context.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698