summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/prerender/prerender_visibility_quick.html
blob: 144244a4a8a7304b4bedd929c4c750b5afe88828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<html>
<!-- 
This test checks the visibility API when a prerendered page is displayed
before the page has finished loading.

TODO(mmenke):  Currently, we get get extra events when a page is shown on
               Windows.  Make this check for extra events once that's fixed.
-->
<head>
<title>Prerender Visibility Quick Switch</title>

<script>
// Checks that the the current state is visible.  Due to expected races between
// loading the page and switching to the tab, it's possible for the page to
// start out with visibility 'prerender', 'hidden', or 'visible'.
function DidDisplayPass() {
  return !document.webkitHidden &&
         'visible' == document.webkitVisibilityState;
}
</script>

</head>
<body></body>
</html>
<html>
<!-- 
This test checks the visibility API when a prerendered page is displayed
before the page has finished loading.

TODO(mmenke):  Currently, we get get extra events when a page is shown on
               Windows.  Make this check for extra events once that's fixed.
-->
<head>
<title>Prerender Visibility Quick Switch</title>

<script>
// Checks that the the current state is visible.  Due to expected races between
// loading the page and switching to the tab, it's possible for the page to
// start out with visibility 'prerender', 'hidden', or 'visible'.
function DidDisplayPass() {
  return !document.webkitHidden &&
         'visible' == document.webkitVisibilityState;
}
</script>

</head>
<body></body>
</html>