From 189075b950a2c7b5bd29637913d2f5ce149bfe4f Mon Sep 17 00:00:00 2001 From: Mason Chang Date: Mon, 9 Nov 2015 19:10:26 -0800 Subject: [PATCH] Bug 1223052 - Add a gtest to test that the vsync source supplies a proper vsync rate. r=kats --- gfx/tests/gtest/TestVsync.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gfx/tests/gtest/TestVsync.cpp b/gfx/tests/gtest/TestVsync.cpp index d50ebbd4f13d..f13afc983fa4 100644 --- a/gfx/tests/gtest/TestVsync.cpp +++ b/gfx/tests/gtest/TestVsync.cpp @@ -195,3 +195,12 @@ TEST_F(VsyncTester, ChildRefreshDriverGetVsyncNotifications) vsyncDispatcher = nullptr; testVsyncObserver = nullptr; } + +// Test that we can read the vsync rate +TEST_F(VsyncTester, VsyncSourceHasVsyncRate) +{ + VsyncSource::Display& globalDisplay = mVsyncSource->GetGlobalDisplay(); + TimeDuration vsyncRate = globalDisplay.GetVsyncRate(); + ASSERT_NE(vsyncRate, TimeDuration::Forever()); + ASSERT_GT(vsyncRate.ToMilliseconds(), 0); +}