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

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

Issue 682743002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "gpu/command_buffer/service/feature_info.h" 5 #include "gpu/command_buffer/service/feature_info.h"
6 #include "gpu/command_buffer/service/gpu_service_test.h" 6 #include "gpu/command_buffer/service/gpu_service_test.h"
7 #include "gpu/command_buffer/service/mailbox_manager_impl.h" 7 #include "gpu/command_buffer/service/mailbox_manager_impl.h"
8 #include "gpu/command_buffer/service/mailbox_manager_sync.h" 8 #include "gpu/command_buffer/service/mailbox_manager_sync.h"
9 #include "gpu/command_buffer/service/texture_manager.h" 9 #include "gpu/command_buffer/service/texture_manager.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "ui/gl/gl_context_stub.h" 11 #include "ui/gl/gl_context_stub.h"
12 #include "ui/gl/gl_mock.h" 12 #include "ui/gl/gl_mock.h"
13 #include "ui/gl/gl_surface_stub.h" 13 #include "ui/gl/gl_surface_stub.h"
14 14
15 namespace gpu { 15 namespace gpu {
16 namespace gles2 { 16 namespace gles2 {
17 17
18 using namespace ::testing; 18 using namespace ::testing;
19 19
20 class MailboxManagerTest : public GpuServiceTest { 20 class MailboxManagerTest : public GpuServiceTest {
21 public: 21 public:
22 MailboxManagerTest() {} 22 MailboxManagerTest() {}
23 virtual ~MailboxManagerTest() {} 23 ~MailboxManagerTest() override {}
24 24
25 protected: 25 protected:
26 virtual void SetUp() { 26 void SetUp() override {
27 GpuServiceTest::SetUp(); 27 GpuServiceTest::SetUp();
28 feature_info_ = new FeatureInfo; 28 feature_info_ = new FeatureInfo;
29 manager_ = new MailboxManagerImpl; 29 manager_ = new MailboxManagerImpl;
30 DCHECK(!manager_->UsesSync()); 30 DCHECK(!manager_->UsesSync());
31 } 31 }
32 32
33 virtual void SetUpWithSynchronizer() { 33 virtual void SetUpWithSynchronizer() {
34 GpuServiceTest::SetUp(); 34 GpuServiceTest::SetUp();
35 feature_info_ = new FeatureInfo; 35 feature_info_ = new FeatureInfo;
36 manager_ = new MailboxManagerSync(); 36 manager_ = new MailboxManagerSync();
37 DCHECK(manager_->UsesSync()); 37 DCHECK(manager_->UsesSync());
38 } 38 }
39 39
40 virtual void TearDown() { 40 void TearDown() override { GpuServiceTest::TearDown(); }
41 GpuServiceTest::TearDown();
42 }
43 41
44 Texture* CreateTexture() { 42 Texture* CreateTexture() {
45 return new Texture(1); 43 return new Texture(1);
46 } 44 }
47 45
48 void SetTarget(Texture* texture, GLenum target, GLuint max_level) { 46 void SetTarget(Texture* texture, GLenum target, GLuint max_level) {
49 texture->SetTarget(NULL, target, max_level); 47 texture->SetTarget(NULL, target, max_level);
50 } 48 }
51 49
52 void SetLevelInfo( 50 void SetLevelInfo(
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 EXPECT_EQ(NULL, manager_->ConsumeTexture(name2)); 181 EXPECT_EQ(NULL, manager_->ConsumeTexture(name2));
184 } 182 }
185 183
186 const GLsizei kMaxTextureWidth = 64; 184 const GLsizei kMaxTextureWidth = 64;
187 const GLsizei kMaxTextureHeight = 64; 185 const GLsizei kMaxTextureHeight = 64;
188 const GLsizei kMaxTextureDepth = 1; 186 const GLsizei kMaxTextureDepth = 1;
189 187
190 class MailboxManagerSyncTest : public MailboxManagerTest { 188 class MailboxManagerSyncTest : public MailboxManagerTest {
191 public: 189 public:
192 MailboxManagerSyncTest() {} 190 MailboxManagerSyncTest() {}
193 virtual ~MailboxManagerSyncTest() {} 191 ~MailboxManagerSyncTest() override {}
194 192
195 protected: 193 protected:
196 virtual void SetUp() { 194 void SetUp() override {
197 MailboxManagerTest::SetUpWithSynchronizer(); 195 MailboxManagerTest::SetUpWithSynchronizer();
198 manager2_ = new MailboxManagerSync(); 196 manager2_ = new MailboxManagerSync();
199 context_ = new gfx::GLContextStub(); 197 context_ = new gfx::GLContextStub();
200 surface_ = new gfx::GLSurfaceStub(); 198 surface_ = new gfx::GLSurfaceStub();
201 context_->MakeCurrent(surface_.get()); 199 context_->MakeCurrent(surface_.get());
202 } 200 }
203 201
204 Texture* DefineTexture() { 202 Texture* DefineTexture() {
205 Texture* texture = CreateTexture(); 203 Texture* texture = CreateTexture();
206 const GLsizei levels_needed = TextureManager::ComputeMipMapCount( 204 const GLsizei levels_needed = TextureManager::ComputeMipMapCount(
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 .Times(1) 248 .Times(1)
251 .RetiresOnSaturation(); 249 .RetiresOnSaturation();
252 EXPECT_CALL(*gl_, Flush()) 250 EXPECT_CALL(*gl_, Flush())
253 .Times(1) 251 .Times(1)
254 .RetiresOnSaturation(); 252 .RetiresOnSaturation();
255 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kCurrentTexture)) 253 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kCurrentTexture))
256 .Times(1) 254 .Times(1)
257 .RetiresOnSaturation(); 255 .RetiresOnSaturation();
258 } 256 }
259 257
260 virtual void TearDown() { 258 void TearDown() override {
261 context_->ReleaseCurrent(NULL); 259 context_->ReleaseCurrent(NULL);
262 MailboxManagerTest::TearDown(); 260 MailboxManagerTest::TearDown();
263 } 261 }
264 262
265 scoped_refptr<MailboxManager> manager2_; 263 scoped_refptr<MailboxManager> manager2_;
266 scoped_refptr<gfx::GLContext> context_; 264 scoped_refptr<gfx::GLContext> context_;
267 scoped_refptr<gfx::GLSurface> surface_; 265 scoped_refptr<gfx::GLSurface> surface_;
268 266
269 private: 267 private:
270 DISALLOW_COPY_AND_ASSIGN(MailboxManagerSyncTest); 268 DISALLOW_COPY_AND_ASSIGN(MailboxManagerSyncTest);
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 } 620 }
623 621
624 // TODO: Produce incomplete texture 622 // TODO: Produce incomplete texture
625 623
626 // TODO: Texture::level_infos_[][].size() 624 // TODO: Texture::level_infos_[][].size()
627 625
628 // TODO: unsupported targets and formats 626 // TODO: unsupported targets and formats
629 627
630 } // namespace gles2 628 } // namespace gles2
631 } // namespace gpu 629 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/id_manager_unittest.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