Commit e548e076 authored by Egor Pasko's avatar Egor Pasko Committed by Commit Bot

Remove PrerenderBrowserTest.PrerenderVisibility

The test legitimately fails when "prerender" value gets removed from
visibilityState as it is done in http://crrev.com/c/1356120

Unblock this change by removing the test. Traditional prerenders should
no longer happen, while nostate-prefetch should not ever look at
visibility state.

TBR=mattcary@chromium.org

Bug: 908582, 755921
Change-Id: I44da809f924b2730ac2b00fd85a1d1e484a3aacb
Reviewed-on: https://chromium-review.googlesource.com/c/1356939Reviewed-by: default avatarEgor Pasko <pasko@chromium.org>
Commit-Queue: Egor Pasko <pasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612792}
parent 104459db
...@@ -1289,13 +1289,6 @@ IN_PROC_BROWSER_TEST_F( ...@@ -1289,13 +1289,6 @@ IN_PROC_BROWSER_TEST_F(
EXPECT_TRUE(IsEmptyPrerenderLinkManager()); EXPECT_TRUE(IsEmptyPrerenderLinkManager());
} }
// Checks that the visibility API works.
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderVisibility) {
PrerenderTestURL("/prerender/prerender_visibility.html", FINAL_STATUS_USED,
1);
NavigateToDestURL();
}
// Checks that the prerendering of a page is canceled correctly if we try to // Checks that the prerendering of a page is canceled correctly if we try to
// swap it in before it commits. // swap it in before it commits.
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderNoCommitNoSwap) { IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderNoCommitNoSwap) {
......
<html>
<!--
This test checks the visibility API when a prerendered page is displayed.
-->
<head>
<title>Prerender Visibility</title>
<script src="prerender_visibility_shared.js"></script>
<script>
// Checks that no visibility change events have occurred, current visibility
// state is "prerender", and visibility state while the page was loading was
// also "prerender".
function DidPrerenderPass() {
return visibilityStates.length == 1 &&
hiddenValues.length == 1 &&
visibilityStates[0] == 'prerender' &&
hiddenValues[0] == true &&
document.visibilityState == 'prerender' &&
document.hidden == true;
}
// Checks that we've only had three visibility states:
// prerender -> hidden -> visible.
// Also checks current visibility state.
function DidDisplayPass() {
return visibilityStates.length == 3 &&
hiddenValues.length == 3 &&
visibilityStates[1] == 'hidden' &&
hiddenValues[1] == true &&
visibilityStates[2] == 'visible' &&
hiddenValues[2] == false &&
document.visibilityState == 'visible' &&
document.hidden == false;
}
</script>
</head>
<body></body>
</html>
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Code shared by some of the visibility tests. Maintains a list of
// visibility states, starting with the state when this file was loaded.
// New states are added on each visibility change event.
// Array of previously observed visibility states.
var visibilityStates = [document.visibilityState];
// Array of previously observed hidden values.
var hiddenValues = [document.hidden];
// Record all visibility changes in corresponding arrays.
function onVisibilityChange(event) {
visibilityStates.push(document.visibilityState);
hiddenValues.push(document.hidden);
}
document.addEventListener("visibilitychange",
onVisibilityChange,
false);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment