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(); |