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

Unified Diff: LayoutTests/fullscreen/full-screen-css.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-css.html
diff --git a/LayoutTests/fullscreen/full-screen-css.html b/LayoutTests/fullscreen/full-screen-css.html
index 034cc7be7909833f96bd1b2772d8a5863e132b38..f970f5c61b5798c328a9f0b3e50407edaf796d2b 100644
--- a/LayoutTests/fullscreen/full-screen-css.html
+++ b/LayoutTests/fullscreen/full-screen-css.html
@@ -7,43 +7,37 @@
</style>
<span></span>
<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 callback;
- var fullscreenChanged = function(event)
- {
- if (callback)
- callback(event)
- };
- waitForEvent(document, "webkitfullscreenchange", fullscreenChanged);
+ var callback;
+ var fullscreenChanged = function(event)
+ {
+ if (callback)
+ callback(event)
+ };
+ waitForEvent(document, "webkitfullscreenchange", fullscreenChanged);
- var span = document.getElementsByTagName("span")[0];
+ var span = document.getElementsByTagName("span")[0];
- testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('background-color')", "rgba(0, 0, 0, 0)");
- testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color')", "rgba(0, 0, 0, 0)");
- testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('color')", "rgb(0, 0, 0)");
+ testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('background-color')", "rgba(0, 0, 0, 0)");
+ testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color')", "rgba(0, 0, 0, 0)");
+ testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('color')", "rgb(0, 0, 0)");
- var documentEnteredFullScreen = function(event) {
- testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
- testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('background-color')", "rgba(0, 0, 0, 0)");
- testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color')", "rgb(0, 255, 0)");
- testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('color')", "rgb(0, 0, 255)");
- callback = spanEnteredFullScreen;
- runWithKeyDown(function(){span.webkitRequestFullScreen()});
- };
+ var documentEnteredFullScreen = function(event) {
+ testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
+ testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('background-color')", "rgba(0, 0, 0, 0)");
+ testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color')", "rgb(0, 255, 0)");
+ testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('color')", "rgb(0, 0, 255)");
+ callback = spanEnteredFullScreen;
+ runWithKeyDown(function(){span.webkitRequestFullScreen()});
+ };
- var spanEnteredFullScreen = function(event) {
- testExpected("document.webkitCurrentFullScreenElement", span);
- testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('background-color')", "rgb(0, 255, 0)");
- testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color')", "rgb(255, 0, 0)");
- testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('color')", "rgb(0, 0, 255)");
- endTest();
- };
+ var spanEnteredFullScreen = function(event) {
+ testExpected("document.webkitCurrentFullScreenElement", span);
+ testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('background-color')", "rgb(0, 255, 0)");
+ testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color')", "rgb(255, 0, 0)");
+ testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('color')", "rgb(0, 0, 255)");
+ endTest();
+ };
- callback = documentEnteredFullScreen;
- runWithKeyDown(function(){document.documentElement.webkitRequestFullScreen()});
- }
+ callback = documentEnteredFullScreen;
+ runWithKeyDown(function(){document.documentElement.webkitRequestFullScreen()});
</script>
« no previous file with comments | « LayoutTests/fullscreen/full-screen-crash-offsetLeft.html ('k') | LayoutTests/fullscreen/full-screen-exit-when-popup.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698