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

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

Issue 893213002: Revert of Make GL bindings conditional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 const char* gl_version = "3.2"; 228 GpuServiceTest::SetUp();
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);
239 gl_fake_queries_.Reset(); 229 gl_fake_queries_.Reset();
240 gl_surface_ = new gfx::GLSurfaceStub(); 230 gl_surface_ = new gfx::GLSurfaceStub();
241 gl_context_ = new gfx::GLContextStub(); 231 gl_context_ = new gfx::GLContextStub();
242 gl_context_->MakeCurrent(gl_surface_.get()); 232 gl_context_->MakeCurrent(gl_surface_.get());
243 233
244 outputter_ref_ = new MockOutputter(); 234 outputter_ref_ = new MockOutputter();
245 cpu_time_ref_ = new FakeCPUTime; 235 cpu_time_ref_ = new FakeCPUTime;
246 } 236 }
247 237
248 void TearDown() override { 238 void TearDown() override {
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 kTraceGroupMarker)); 667 kTraceGroupMarker));
678 668
679 ASSERT_TRUE(tracer_tester.BeginDecoding()); 669 ASSERT_TRUE(tracer_tester.BeginDecoding());
680 EXPECT_TRUE(tracer_tester.Begin(category_name, trace_name, 670 EXPECT_TRUE(tracer_tester.Begin(category_name, trace_name,
681 kTraceGroupMarker)); 671 kTraceGroupMarker));
682 ASSERT_TRUE(tracer_tester.EndDecoding()); 672 ASSERT_TRUE(tracer_tester.EndDecoding());
683 } 673 }
684 674
685 } // namespace gles2 675 } // namespace gles2
686 } // namespace gpu 676 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_service_test.cc ('k') | gpu/command_buffer/service/memory_program_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698