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

Side by Side Diff: gpu/command_buffer/service/gpu_tracer_unittest.cc

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 7
8 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" 8 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
9 #include "gpu/command_buffer/service/gpu_service_test.h" 9 #include "gpu/command_buffer/service/gpu_service_test.h"
10 #include "gpu/command_buffer/service/gpu_tracer.h" 10 #include "gpu/command_buffer/service/gpu_tracer.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 }; 218 };
219 219
220 class BaseGpuTest : public GpuServiceTest { 220 class BaseGpuTest : public GpuServiceTest {
221 public: 221 public:
222 BaseGpuTest(GpuTracerType test_tracer_type) 222 BaseGpuTest(GpuTracerType test_tracer_type)
223 : test_tracer_type_(test_tracer_type) { 223 : test_tracer_type_(test_tracer_type) {
224 } 224 }
225 225
226 protected: 226 protected:
227 void SetUp() override { 227 void SetUp() override {
228 GpuServiceTest::SetUp(); 228 const char* gl_version = "3.2";
229 const char* extensions = nullptr;
230 if (GetTracerType() == kTracerTypeDisjointTimer) {
231 gl_version = "opengl es 3.0";
232 extensions = "GL_EXT_disjoint_timer_query";
233 } else if (GetTracerType() == kTracerTypeARBTimer) {
234 // TODO(sievers): The tracer should not depend on ARB_occlusion_query.
235 // Try merge Query APIs (core, ARB, EXT) into a single binding each.
236 extensions = "GL_ARB_timer_query GL_ARB_occlusion_query";
237 }
238 GpuServiceTest::SetUpWithGLVersion(gl_version, extensions);
229 gl_fake_queries_.Reset(); 239 gl_fake_queries_.Reset();
230 gl_surface_ = new gfx::GLSurfaceStub(); 240 gl_surface_ = new gfx::GLSurfaceStub();
231 gl_context_ = new gfx::GLContextStub(); 241 gl_context_ = new gfx::GLContextStub();
232 gl_context_->MakeCurrent(gl_surface_.get()); 242 gl_context_->MakeCurrent(gl_surface_.get());
233 243
234 outputter_ref_ = new MockOutputter(); 244 outputter_ref_ = new MockOutputter();
235 cpu_time_ref_ = new FakeCPUTime; 245 cpu_time_ref_ = new FakeCPUTime;
236 } 246 }
237 247
238 void TearDown() override { 248 void TearDown() override {
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 kTraceGroupMarker)); 677 kTraceGroupMarker));
668 678
669 ASSERT_TRUE(tracer_tester.BeginDecoding()); 679 ASSERT_TRUE(tracer_tester.BeginDecoding());
670 EXPECT_TRUE(tracer_tester.Begin(category_name, trace_name, 680 EXPECT_TRUE(tracer_tester.Begin(category_name, trace_name,
671 kTraceGroupMarker)); 681 kTraceGroupMarker));
672 ASSERT_TRUE(tracer_tester.EndDecoding()); 682 ASSERT_TRUE(tracer_tester.EndDecoding());
673 } 683 }
674 684
675 } // namespace gles2 685 } // namespace gles2
676 } // namespace gpu 686 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_tracer.cc ('k') | gpu/command_buffer/service/mailbox_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698