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

Unified Diff: gpu/command_buffer/service/gpu_tracer_unittest.cc

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 11 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 | « gpu/command_buffer/service/gpu_tracer.cc ('k') | gpu/command_buffer/service/in_process_command_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gpu_tracer_unittest.cc
diff --git a/gpu/command_buffer/service/gpu_tracer_unittest.cc b/gpu/command_buffer/service/gpu_tracer_unittest.cc
index 1b55e785e4517576c002fbd6fc90183d4582c150..37370187c0333e2bae426cf43824a09f777e040b 100644
--- a/gpu/command_buffer/service/gpu_tracer_unittest.cc
+++ b/gpu/command_buffer/service/gpu_tracer_unittest.cc
@@ -88,7 +88,7 @@ class GlFakeQueries {
}
}
- void GetQueryObjectiv(GLuint id, GLenum pname, GLint* params) {
+ void GetQueryObjectivARB(GLuint id, GLenum pname, GLint* params) {
switch (pname) {
case GL_QUERY_RESULT_AVAILABLE: {
std::map<GLuint, GLint64>::iterator it = query_timestamp_.find(id);
@@ -99,7 +99,7 @@ class GlFakeQueries {
break;
}
default:
- FAIL() << "Invalid variable passed to GetQueryObjectiv: " << pname;
+ FAIL() << "Invalid variable passed to GetQueryObjectivARB: " << pname;
}
}
@@ -255,10 +255,10 @@ class BaseGpuTest : public GpuServiceTest {
.WillRepeatedly(
Invoke(&gl_fake_queries_, &GlFakeQueries::GenQueriesARB));
- EXPECT_CALL(*gl_, GetQueryObjectiv(_, GL_QUERY_RESULT_AVAILABLE,
+ EXPECT_CALL(*gl_, GetQueryObjectivARB(_, GL_QUERY_RESULT_AVAILABLE,
NotNull()))
.WillRepeatedly(
- Invoke(&gl_fake_queries_, &GlFakeQueries::GetQueryObjectiv));
+ Invoke(&gl_fake_queries_, &GlFakeQueries::GetQueryObjectivARB));
if (GetTracerType() == kTracerTypeDisjointTimer) {
EXPECT_CALL(*gl_, GetInteger64v(GL_TIMESTAMP, _))
@@ -330,36 +330,13 @@ class BaseGpuTest : public GpuServiceTest {
// Timer offset calculation should only happen for the regular timer.
if (GetTracerType() != kTracerTypeARBTimer) {
- EXPECT_CALL(*gl_, GenQueriesARB(_, NotNull())).Times(Exactly(0));
- EXPECT_CALL(*gl_, Finish()).Times(Exactly(0));
- EXPECT_CALL(*gl_, QueryCounter(_, GL_TIMESTAMP)).Times(Exactly(0));
- EXPECT_CALL(*gl_, GetQueryObjectui64v(_, GL_QUERY_RESULT, NotNull()))
+ EXPECT_CALL(*gl_, GetInteger64v(GL_TIMESTAMP, NotNull()))
.Times(Exactly(0));
- EXPECT_CALL(*gl_, DeleteQueriesARB(_, NotNull())).Times(Exactly(0));
} else {
- EXPECT_CALL(*gl_, GenQueriesARB(_, NotNull())).Times(AtLeast(1))
- .WillRepeatedly(
- Invoke(&gl_fake_queries_, &GlFakeQueries::GenQueriesARB));
-
- EXPECT_CALL(*gl_, Finish()).Times(AtLeast(2))
- .WillRepeatedly(
- Invoke(&gl_fake_queries_, &GlFakeQueries::Finish));
-
- EXPECT_CALL(*gl_, QueryCounter(_, GL_TIMESTAMP))
- .Times(AtLeast(1))
- .WillRepeatedly(
- Invoke(&gl_fake_queries_, &GlFakeQueries::QueryCounter));
-
- EXPECT_CALL(*gl_, GetQueryObjectui64v(_, GL_QUERY_RESULT, NotNull()))
+ EXPECT_CALL(*gl_, GetInteger64v(GL_TIMESTAMP, NotNull()))
.Times(AtLeast(1))
.WillRepeatedly(
- Invoke(&gl_fake_queries_,
- &GlFakeQueries::GetQueryObjectui64v));
-
- EXPECT_CALL(*gl_, DeleteQueriesARB(1, NotNull()))
- .Times(AtLeast(1))
- .WillRepeatedly(
- Invoke(&gl_fake_queries_, &GlFakeQueries::DeleteQueriesARB));
+ Invoke(&gl_fake_queries_, &GlFakeQueries::GetInteger64v));
}
}
@@ -404,6 +381,7 @@ class BaseGpuTraceTest : public BaseGpuTest {
offset_time, GetTracerType());
gl_fake_queries_.SetCurrentGLTime(start_timestamp);
+ cpu_time_ref_->SetFakeCPUTime(expect_start_time);
trace->Start(true);
// Shouldn't be available before End() call
« no previous file with comments | « gpu/command_buffer/service/gpu_tracer.cc ('k') | gpu/command_buffer/service/in_process_command_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698