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

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

Issue 611313003: Use estimated vsync period on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused constant Created 6 years, 2 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 a2d723443b056950c36f0891f2af86ff61cf168c..c22aae407e761789d96d86bae5ff3fa3a713d3f4 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
@@ -8,6 +8,7 @@ import android.content.Context;
import android.os.SystemClock;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.MediumTest;
+import android.view.WindowManager;
import org.chromium.base.ThreadUtils;
import org.chromium.ui.VSyncMonitor;
@@ -108,6 +109,17 @@ public class VSyncMonitorTest extends InstrumentationTestCase {
+ " differs by more than 10% from the reported frame period "
+ reportedFramePeriod + " for requested frames");
}
+
+ if (enableJBVSync) {
+ Context context = getInstrumentation().getContext();
+ float refreshRate = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE))
+ .getDefaultDisplay().getRefreshRate();
+ if (refreshRate < 30.0f) {
+ // Reported refresh rate is most likely incorrect.
+ // Estimated vsync period is expected to be lower than (1000000 / 30) microseconds
+ assertTrue(monitor.getVSyncPeriodInMicroseconds() < 1000000 / 30);
+ }
+ }
}
// Check that the vsync period roughly matches the timestamps that the monitor generates.
« 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