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

Side by Side Diff: ui/gl/gpu_timing_unittest.cc

Issue 2129043003: Make dynamic mock bindings initialization consistent with other GL implementations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « ui/gl/gl_implementation_x11.cc ('k') | ui/gl/test/gl_surface_test_support.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/gl/gpu_timing.h" 5 #include "ui/gl/gpu_timing.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 GLSurfaceTestSupport::InitializeOneOffWithMockBindings(); 53 GLSurfaceTestSupport::InitializeOneOffWithMockBindings();
54 gl_.reset(new ::testing::StrictMock<MockGLInterface>()); 54 gl_.reset(new ::testing::StrictMock<MockGLInterface>());
55 MockGLInterface::SetGLInterface(gl_.get()); 55 MockGLInterface::SetGLInterface(gl_.get());
56 56
57 context_ = new GLContextStubWithExtensions; 57 context_ = new GLContextStubWithExtensions;
58 context_->AddExtensionsString(gl_extensions); 58 context_->AddExtensionsString(gl_extensions);
59 context_->SetGLVersionString(gl_version); 59 context_->SetGLVersionString(gl_version);
60 surface_ = new GLSurfaceStub; 60 surface_ = new GLSurfaceStub;
61 context_->MakeCurrent(surface_.get()); 61 context_->MakeCurrent(surface_.get());
62 gpu_timing_fake_queries_.Reset(); 62 gpu_timing_fake_queries_.Reset();
63 GLSurfaceTestSupport::InitializeDynamicMockBindings(context_.get());
64 63
65 setup_ = true; 64 setup_ = true;
66 } 65 }
67 66
68 scoped_refptr<GPUTimingClient> CreateGPUTimingClient() { 67 scoped_refptr<GPUTimingClient> CreateGPUTimingClient() {
69 if (!setup_) { 68 if (!setup_) {
70 SetupGLContext("2.0", ""); 69 SetupGLContext("2.0", "");
71 } 70 }
72 71
73 scoped_refptr<GPUTimingClient> client = context_->CreateGPUTimingClient(); 72 scoped_refptr<GPUTimingClient> client = context_->CreateGPUTimingClient();
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 208
210 int64_t start, end; 209 int64_t start, end;
211 gpu_timer->GetStartEndTimestamps(&start, &end); 210 gpu_timer->GetStartEndTimestamps(&start, &end);
212 // Force time elapsed won't be set until a query is actually attempted 211 // Force time elapsed won't be set until a query is actually attempted
213 ASSERT_TRUE(client->IsForceTimeElapsedQuery()); 212 ASSERT_TRUE(client->IsForceTimeElapsedQuery());
214 EXPECT_EQ(begin_cpu_time, start); 213 EXPECT_EQ(begin_cpu_time, start);
215 EXPECT_EQ(begin_cpu_time, end); 214 EXPECT_EQ(begin_cpu_time, end);
216 } 215 }
217 216
218 } // namespace gl 217 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_implementation_x11.cc ('k') | ui/gl/test/gl_surface_test_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698