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

Unified Diff: trunk/src/gpu/command_buffer/service/mailbox_manager_unittest.cc

Issue 346573002: Revert 278059 "gpu: Add base class for gpu service tests" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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
Index: trunk/src/gpu/command_buffer/service/mailbox_manager_unittest.cc
===================================================================
--- trunk/src/gpu/command_buffer/service/mailbox_manager_unittest.cc (revision 278063)
+++ trunk/src/gpu/command_buffer/service/mailbox_manager_unittest.cc (working copy)
@@ -5,7 +5,6 @@
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/feature_info.h"
-#include "gpu/command_buffer/service/gpu_service_test.h"
#include "gpu/command_buffer/service/mailbox_synchronizer.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -18,32 +17,18 @@
using namespace ::testing;
-class MailboxManagerTest : public GpuServiceTest {
+class MailboxManagerTest : public testing::Test {
public:
- MailboxManagerTest() : initialized_synchronizer_(false) {}
+ MailboxManagerTest() {}
virtual ~MailboxManagerTest() {}
protected:
virtual void SetUp() {
- GpuServiceTest::SetUp();
+ testing::Test::SetUp();
feature_info_ = new FeatureInfo;
manager_ = new MailboxManager;
}
- virtual void SetUpWithSynchronizer() {
- GpuServiceTest::SetUp();
- MailboxSynchronizer::Initialize();
- initialized_synchronizer_ = true;
- feature_info_ = new FeatureInfo;
- manager_ = new MailboxManager;
- }
-
- virtual void TearDown() {
- if (initialized_synchronizer_)
- MailboxSynchronizer::Terminate();
- GpuServiceTest::TearDown();
- }
-
Texture* CreateTexture() {
return new Texture(1);
}
@@ -88,7 +73,6 @@
scoped_refptr<MailboxManager> manager_;
private:
- bool initialized_synchronizer_;
scoped_refptr<FeatureInfo> feature_info_;
DISALLOW_COPY_AND_ASSIGN(MailboxManagerTest);
@@ -201,8 +185,11 @@
protected:
virtual void SetUp() {
- MailboxManagerTest::SetUpWithSynchronizer();
+ MailboxSynchronizer::Initialize();
+ MailboxManagerTest::SetUp();
manager2_ = new MailboxManager;
+ gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>());
+ ::gfx::MockGLInterface::SetGLInterface(gl_.get());
context_ = new gfx::GLContextStub();
surface_ = new gfx::GLSurfaceStub();
context_->MakeCurrent(surface_);
@@ -265,10 +252,14 @@
}
virtual void TearDown() {
- context_->ReleaseCurrent(NULL);
MailboxManagerTest::TearDown();
+ MailboxSynchronizer::Terminate();
+ context_->ReleaseCurrent(NULL);
+ ::gfx::MockGLInterface::SetGLInterface(NULL);
+ gl_.reset();
}
+ scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_;
scoped_refptr<MailboxManager> manager2_;
scoped_refptr<gfx::GLContext> context_;
scoped_refptr<gfx::GLSurface> surface_;

Powered by Google App Engine
This is Rietveld 408576698