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

Side by Side Diff: chrome/test/data/prerender/prerender_visibility_hidden_quick.html

Issue 7736003: Revert 98539 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <!--
3 This test checks the visibility API when a prerendered page is visited without
4 being displayed, before the page has finished loading.
5 -->
6 <head>
7 <title>Prerender Visibility Hidden Quick Switch</title>
8
9 <script>
10 // Checks visibility state while the page is still loading.
11 var lastState = document.webkitVisibilityState;
12 var loadingStatePassed = document.webkitHidden && lastState != 'visible';
13 var unexpectedStateChange = false;
14
15 function onVisibilityChange(event) {
16 if (lastState == 'hidden' ||
17 document.webkitVisibilityState != 'hidden') {
18 unexpectedStateChange = true;
19 return;
20 }
21 lastState = document.webkitVisibilityState;
22 }
23
24 document.addEventListener('webkitvisibilitychange',
25 onVisibilityChange,
26 false);
27
28 // Checks that either the first visibility state was 'prerender' and there
29 // was one and only one visibility change event to 'hidden', or visibility
30 // was always 'hidden'.
31 function DidDisplayPass() {
32 return loadingStatePassed &&
33 !unexpectedStateChange &&
34 'hidden' == document.webkitVisibilityState &&
35 document.webkitHidden;
36 }
37 </script>
38
39 </head>
40 <body></body>
41 </html>
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_contents.cc ('k') | chrome/test/data/prerender/prerender_visibility_quick.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698