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

Unified Diff: LayoutTests/fast/events/page-visibility-transition-test.html

Issue 7121007: Merge 88174 - 2011-06-06 Shishir Agrawal <shishir@chromium.org> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 6 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/page-visibility-transition-test-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/page-visibility-transition-test.html
===================================================================
--- LayoutTests/fast/events/page-visibility-transition-test.html (revision 88229)
+++ LayoutTests/fast/events/page-visibility-transition-test.html (working copy)
@@ -22,6 +22,11 @@
layoutTestController.setPageVisibility("hidden");
}
+function makePagePrerender() {
+ if (window.layoutTestController)
+ layoutTestController.setPageVisibility("prerender");
+}
+
function checkIsPageVisible() {
shouldBeEqualToString("document.webkitVisibilityState", "visible");
shouldBeFalse("document.webkitHidden");
@@ -32,11 +37,17 @@
shouldBeTrue("document.webkitHidden");
}
+function checkIsPagePrerendering() {
+ shouldBeEqualToString("document.webkitVisibilityState", "prerender");
+ shouldBeTrue("document.webkitHidden");
+}
+
// We will try to change the visibility states as:
// 0 - visible. (Initial - i.e. on load).
// 1 - hidden (should fire event).
// 2 - hidden (no event).
-// 3 - visible (should fire event).
+// 3 - prerender (should fire event).
+// 4 - visible (should fire event).
var numVisibilityChanges = 0;
function startTest() {
@@ -61,13 +72,18 @@
makePageHidden();
checkIsPageHidden();
numVisibilityChanges++;
- makePageVisible();
+ makePagePrerender();
return;
} else if (numVisibilityChanges == 2) {
testFailed("Invalid event fired on same state change.");
finishTest();
return;
} else if (numVisibilityChanges == 3) {
+ checkIsPagePrerendering();
+ numVisibilityChanges++;
+ makePageVisible();
+ return;
+ } else if (numVisibilityChanges == 4) {
checkIsPageVisible();
numVisibilityChanges++;
finishTest();
« no previous file with comments | « no previous file | LayoutTests/fast/events/page-visibility-transition-test-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698