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

Unified Diff: LayoutTests/fullscreen/full-screen-remove-ancestor-after.html

Issue 457663002: Convert more fullscreen tests to reftests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address feedback 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-remove-ancestor-after.html
diff --git a/LayoutTests/fullscreen/full-screen-remove-ancestor-after.html b/LayoutTests/fullscreen/full-screen-remove-ancestor-after.html
index 9e8b839078d955e604724d7729347bc099373326..0484ed499b3bce1cefe862746785e2548384e6ba 100644
--- a/LayoutTests/fullscreen/full-screen-remove-ancestor-after.html
+++ b/LayoutTests/fullscreen/full-screen-remove-ancestor-after.html
@@ -13,29 +13,34 @@ var init = function() {
if (callback)
callback(event)
};
- waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
+ document.onwebkitfullscreenchange = fullscreenChanged;
var one = document.getElementById('one');
var two = document.getElementById('two');
var three = document.getElementById('three');
var threeEnteredFullScreen = function(event) {
- callback = threeExitedFullScreen;
- testExpected("document.webkitCurrentFullScreenElement", three);
- one.removeChild(two);
+ if (document.webkitCurrentFullScreenElement == three) {
+ callback = threeExitedFullScreen;
+ one.removeChild(two);
+ }
};
var threeExitedFullScreen = function(event) {
- callback = null;
- testExpected("document.webkitCurrentFullScreenElement", null);
- endTest();
+ if (document.webkitCurrentFullScreenElement == null) {
+ callback = null;
+ endTest();
+ }
};
callback = threeEnteredFullScreen;
- runWithKeyDown(function(){three.webkitRequestFullScreen()});
+
+ function goFullScreen() {
+ document.getElementById('three').webkitRequestFullScreen();
+ }
+ runWithKeyDown(goFullScreen);
}
};
-var startTest = function() { document.getElementById('three').webkitRequestFullScreen(); };
</script>
<script src="full-screen-test.js"></script>
<style>
@@ -63,13 +68,12 @@ var startTest = function() { document.getElementById('three').webkitRequestFullS
</style>
</head>
<body onload="init()">
-
-This tests that, if the ancestor of the current full-screen element is removed, full screen mode will exit, and the document will render normally. At the completion of the test, a green box should be visible. Click <button onclick="startTest()">go full screen</button> to run the test.
+
+This tests that, if the ancestor of the current full-screen element is removed, full screen mode will exit, and the document will render normally. At the completion of the test, a green box should be visible. Click <button onclick="goFullScreen()">go full screen</button> to run the test.
<div id="one">
<div id="two">
<div id="three"></div>
</div>
</div>
-
-</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698