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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/VSyncMonitorTest.java

Issue 1803793004: Revert of Remove synthetic vsync from Android VsyncMonitor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/android/java/src/org/chromium/ui/VSyncMonitor.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/javatests/src/org/chromium/content/browser/VSyncMonitorTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/VSyncMonitorTest.java b/content/public/android/javatests/src/org/chromium/content/browser/VSyncMonitorTest.java
index 65153f71824148895982a7b5ddc08e9c1292c15b..7b34461316b3fcac311907fe7269a45144d2a635 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/VSyncMonitorTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/VSyncMonitorTest.java
@@ -127,4 +127,21 @@
assertTrue(monitor.getVSyncPeriodInMicroseconds() < 1000000 / 30);
}
}
+
+ @MediumTest
+ public void testVSyncActivationFromIdle() throws InterruptedException {
+ // Check that the vsync period roughly matches the timestamps that the monitor generates.
+ VSyncDataCollector collector = new VSyncDataCollector(1);
+ VSyncMonitor monitor = createVSyncMonitor(collector);
+
+ requestVSyncMonitorUpdate(monitor);
+ collector.waitTillDone();
+ assertTrue(collector.isDone());
+
+ long period = monitor.getVSyncPeriodInMicroseconds() / 1000;
+ long delay = SystemClock.uptimeMillis() - collector.mLastVSyncCpuTimeMillis;
+
+ // The VSync should have activated immediately instead of at the next real vsync.
+ assertTrue(delay < period);
+ }
}
« no previous file with comments | « no previous file | ui/android/java/src/org/chromium/ui/VSyncMonitor.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698