Index: chrome/test/data/tab-restore-visibilty.html |
diff --git a/chrome/test/data/tab-restore-visibilty.html b/chrome/test/data/tab-restore-visibilty.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f2a2b84aa55786f5fe4d9f8148cf80afaf59f6c4 |
--- /dev/null |
+++ b/chrome/test/data/tab-restore-visibilty.html |
@@ -0,0 +1,31 @@ |
+<script> |
+var count = 0; |
+ |
+function setTitle() { |
+ // document.title reports the DOM page visibility and RAF count. |
+ document.title = document.visibilityState + ' ' + count++; |
+ |
+ if (!window.ready) |
+ setTimeout(setReady, count > 10 ? 0 : 100); |
+} |
+ |
+document.addEventListener('visibilitychange', setTitle); |
+ |
+(function changeTitle() { |
+ window.requestAnimationFrame(changeTitle); |
+ setTitle(); |
+})(); |
+ |
+function setReady() { |
+ if (!window.ready) |
+ sendReady(); |
+ window.ready = true; |
+} |
+ |
+function sendReady() { |
+ if (window.domAutomationController) { |
+ domAutomationController.setAutomationId(1); |
+ domAutomationController.send("READY"); |
+ } |
+} |
+</script> |