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

Unified Diff: ui/gl/gpu_timing_fake.cc

Issue 1687353002: Force time elapsed queries on certain drivers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor tests Created 4 years, 10 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 | « ui/gl/gpu_timing.cc ('k') | ui/gl/gpu_timing_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gpu_timing_fake.cc
diff --git a/ui/gl/gpu_timing_fake.cc b/ui/gl/gpu_timing_fake.cc
index 03f4af3d6ea06256a8c2d21d292d3e47545cd219..86c40e38197bbe9432a9e72112f37622567403c6 100644
--- a/ui/gl/gpu_timing_fake.cc
+++ b/ui/gl/gpu_timing_fake.cc
@@ -16,6 +16,9 @@ using ::testing::AtMost;
using ::testing::Exactly;
using ::testing::Invoke;
using ::testing::NotNull;
+using ::testing::DoAll;
+using ::testing::Return;
+using ::testing::SetArgPointee;
int64_t GPUTimingFake::fake_cpu_time_ = 0;
@@ -75,13 +78,14 @@ void GPUTimingFake::ExpectNoDisjointCalls(MockGLInterface& gl) {
EXPECT_CALL(gl, GetIntegerv(GL_GPU_DISJOINT_EXT, _)).Times(Exactly(0));
}
-void GPUTimingFake::ExpectGPUTimeStampQuery(
- MockGLInterface& gl, bool elapsed_query) {
+void GPUTimingFake::ExpectGPUTimeStampQuery(MockGLInterface& gl,
+ bool elapsed_query) {
EXPECT_CALL(gl, GenQueries(1, NotNull())).Times(Exactly(1))
.WillRepeatedly(Invoke(this, &GPUTimingFake::FakeGLGenQueries));
+ EXPECT_CALL(gl, GetQueryiv(GL_TIMESTAMP, GL_QUERY_COUNTER_BITS, NotNull()))
+ .WillRepeatedly(DoAll(SetArgPointee<2>(64), Return()));
if (!elapsed_query) {
- // Time Stamp based queries.
David Yen 2016/02/17 21:16:43 Was this accidentally deleted?
EXPECT_CALL(gl, GetInteger64v(GL_TIMESTAMP, _))
.WillRepeatedly(
Invoke(this, &GPUTimingFake::FakeGLGetInteger64v));
@@ -121,6 +125,10 @@ void GPUTimingFake::ExpectGPUTimerQuery(
if (!elapsed_query) {
// Time Stamp based queries.
+ EXPECT_CALL(gl, GetQueryiv(GL_TIMESTAMP, GL_QUERY_COUNTER_BITS, NotNull()))
+ .Times(Exactly(1))
David Yen 2016/02/17 21:16:43 nit: Also remove this ".Times(Exactly(1))"
+ .WillRepeatedly(DoAll(SetArgPointee<2>(64), Return()));
+
EXPECT_CALL(gl, GetInteger64v(GL_TIMESTAMP, _))
.WillRepeatedly(
Invoke(this, &GPUTimingFake::FakeGLGetInteger64v));
« no previous file with comments | « ui/gl/gpu_timing.cc ('k') | ui/gl/gpu_timing_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698