| 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.
|
|
|