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

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

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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/shader_manager.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 946d8ae8bbf152ad7e5eaa7f0e941d0c55b8b051..48a4db9943403f1c9b80a39c452a9f2085bbb68c 100644
--- a/gpu/command_buffer/service/gpu_tracer_unittest.cc
+++ b/gpu/command_buffer/service/gpu_tracer_unittest.cc
@@ -198,7 +198,10 @@ class BaseGpuTest : public GpuServiceTest {
g_fakeCPUTime = 0;
const char* gl_version = "3.2";
const char* extensions = "";
- if (GetTimerType() == gfx::GPUTiming::kTimerTypeDisjoint) {
+ if (GetTimerType() == gfx::GPUTiming::kTimerTypeEXT) {
+ gl_version = "opengl 2.1";
+ extensions = "GL_EXT_timer_query";
+ } else if (GetTimerType() == gfx::GPUTiming::kTimerTypeDisjoint) {
gl_version = "opengl es 3.0";
extensions = "GL_EXT_disjoint_timer_query";
} else if (GetTimerType() == gfx::GPUTiming::kTimerTypeARB) {
@@ -231,7 +234,8 @@ class BaseGpuTest : public GpuServiceTest {
}
void ExpectTraceQueryMocks() {
- if (GetTimerType() != gfx::GPUTiming::kTimerTypeInvalid) {
+ if (gpu_timing_client_->IsAvailable() &&
+ gpu_timing_client_->IsTimerOffsetAvailable()) {
// Delegate query APIs used by GPUTrace to a GlFakeQueries
EXPECT_CALL(*gl_, GenQueriesARB(2, NotNull())).Times(AtLeast(1))
.WillRepeatedly(
@@ -293,7 +297,8 @@ class BaseGpuTest : public GpuServiceTest {
const std::string& name, int64 expect_start_time,
int64 expect_end_time) {
ExpectOutputterBeginMocks(outputter, category, name);
- bool valid_timer = GetTimerType() != gfx::GPUTiming::kTimerTypeInvalid;
+ bool valid_timer = gpu_timing_client_->IsAvailable() &&
+ gpu_timing_client_->IsTimerOffsetAvailable();
ExpectOutputterEndMocks(outputter, category, name, expect_start_time,
expect_end_time, valid_timer);
}
@@ -478,7 +483,8 @@ class BaseGpuTracerTest : public BaseGpuTest {
std::string source_category = category_name + num_char;
std::string source_trace_name = trace_name + num_char;
- bool valid_timer = GetTimerType() != gfx::GPUTiming::kTimerTypeInvalid;
+ bool valid_timer = gpu_timing_client_->IsAvailable() &&
+ gpu_timing_client_->IsTimerOffsetAvailable();
ExpectOutputterEndMocks(outputter_ref_.get(), source_category,
source_trace_name, expect_start_time + i,
expect_end_time + i, valid_timer);
@@ -565,6 +571,11 @@ class InvalidTimerTracerTest : public BaseGpuTracerTest {
: BaseGpuTracerTest(gfx::GPUTiming::kTimerTypeInvalid) {}
};
+class GpuEXTTimerTracerTest : public BaseGpuTracerTest {
+ public:
+ GpuEXTTimerTracerTest() : BaseGpuTracerTest(gfx::GPUTiming::kTimerTypeEXT) {}
+};
+
class GpuARBTimerTracerTest : public BaseGpuTracerTest {
public:
GpuARBTimerTracerTest()
@@ -581,6 +592,10 @@ TEST_F(InvalidTimerTracerTest, InvalidTimerBasicTracerTest) {
DoBasicTracerTest();
}
+TEST_F(GpuEXTTimerTracerTest, EXTTimerBasicTracerTest) {
+ DoBasicTracerTest();
+}
+
TEST_F(GpuARBTimerTracerTest, ARBTimerBasicTracerTest) {
DoBasicTracerTest();
}
@@ -593,6 +608,10 @@ TEST_F(InvalidTimerTracerTest, InvalidTimerTracerMarkersTest) {
DoTracerMarkersTest();
}
+TEST_F(GpuEXTTimerTracerTest, EXTTimerTracerMarkersTest) {
+ DoTracerMarkersTest();
+}
+
TEST_F(GpuARBTimerTracerTest, ARBTimerBasicTracerMarkersTest) {
DoTracerMarkersTest();
}
« no previous file with comments | « gpu/command_buffer/service/gpu_tracer.cc ('k') | gpu/command_buffer/service/shader_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698