Index: gpu/command_buffer/client/gles2_implementation_unittest.cc |
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc |
index f57d07a8ded8be41387f469e42477697ed149271..aa9073388dca4e0e228b3374d19c9dd954701e26 100644 |
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc |
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc |
@@ -5,8 +5,6 @@ |
// Tests for GLES2Implementation. |
#include "gpu/command_buffer/client/gles2_implementation.h" |
- |
-#include <limits> |
#include <GLES2/gl2ext.h> |
#include <GLES2/gl2extchromium.h> |
@@ -392,9 +390,7 @@ |
public: |
TestContext() : commands_(NULL), token_(0) {} |
- void Initialize(ShareGroup* share_group, |
- bool bind_generates_resource, |
- bool lose_context_when_out_of_memory) { |
+ void Initialize(ShareGroup* share_group, bool bind_generates_resource) { |
command_buffer_.reset(new StrictMock<MockClientCommandBuffer>()); |
ASSERT_TRUE(command_buffer_->Initialize()); |
@@ -443,12 +439,12 @@ |
.RetiresOnSaturation(); |
GetNextToken(); // eat the token that starting up will use. |
- gl_.reset(new GLES2Implementation(helper_.get(), |
- share_group, |
- transfer_buffer_.get(), |
- bind_generates_resource, |
- lose_context_when_out_of_memory, |
- gpu_control_.get())); |
+ gl_.reset( |
+ new GLES2Implementation(helper_.get(), |
+ share_group, |
+ transfer_buffer_.get(), |
+ bind_generates_resource, |
+ gpu_control_.get())); |
ASSERT_TRUE(gl_->Initialize(kTransferBufferSize, |
kTransferBufferSize, |
kTransferBufferSize, |
@@ -518,14 +514,11 @@ |
return gl_->query_tracker_->GetQuery(id); |
} |
- void Initialize(bool bind_generates_resource, |
- bool lose_context_when_out_of_memory) { |
+ void Initialize(bool bind_generates_resource) { |
share_group_ = new ShareGroup(bind_generates_resource); |
for (int i = 0; i < kNumTestContexts; i++) |
- test_contexts_[i].Initialize(share_group_.get(), |
- bind_generates_resource, |
- lose_context_when_out_of_memory); |
+ test_contexts_[i].Initialize(share_group_.get(), bind_generates_resource); |
// Default to test context 0. |
gpu_control_ = test_contexts_[0].gpu_control_.get(); |
@@ -592,20 +585,13 @@ |
}; |
void GLES2ImplementationTest::SetUp() { |
- bool bind_generates_resource = true; |
- bool lose_context_when_out_of_memory = false; |
- Initialize(bind_generates_resource, lose_context_when_out_of_memory); |
+ Initialize(true); |
} |
void GLES2ImplementationTest::TearDown() { |
for (int i = 0; i < kNumTestContexts; i++) |
test_contexts_[i].TearDown(); |
} |
- |
-class GLES2ImplementationManualInitTest : public GLES2ImplementationTest { |
- protected: |
- virtual void SetUp() OVERRIDE {} |
-}; |
class GLES2ImplementationStrictSharedTest : public GLES2ImplementationTest { |
protected: |
@@ -697,9 +683,7 @@ |
}; |
void GLES2ImplementationStrictSharedTest::SetUp() { |
- bool bind_generates_resource = false; |
- bool lose_context_when_out_of_memory = false; |
- Initialize(bind_generates_resource, lose_context_when_out_of_memory); |
+ Initialize(false); |
} |
// GCC requires these declarations, but MSVC requires they not be present |
@@ -3116,42 +3100,6 @@ |
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
} |
-TEST_F(GLES2ImplementationManualInitTest, LoseContextOnOOM) { |
- bool bind_generates_resource = false; |
- bool lose_context_when_out_of_memory = true; |
- Initialize(bind_generates_resource, lose_context_when_out_of_memory); |
- |
- struct Cmds { |
- cmds::LoseContextCHROMIUM cmd; |
- }; |
- |
- GLsizei max = std::numeric_limits<GLsizei>::max(); |
- EXPECT_CALL(*gpu_control_, CreateGpuMemoryBuffer(max, max, _, _)) |
- .WillOnce(Return(static_cast<gfx::GpuMemoryBuffer*>(NULL))); |
- gl_->CreateImageCHROMIUM(max, max, 0); |
- // The context should be lost. |
- Cmds expected; |
- expected.cmd.Init(GL_GUILTY_CONTEXT_RESET_ARB, GL_UNKNOWN_CONTEXT_RESET_ARB); |
- EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
-} |
- |
-TEST_F(GLES2ImplementationManualInitTest, NoLoseContextOnOOM) { |
- bool bind_generates_resource = false; |
- bool lose_context_when_out_of_memory = false; |
- Initialize(bind_generates_resource, lose_context_when_out_of_memory); |
- |
- struct Cmds { |
- cmds::LoseContextCHROMIUM cmd; |
- }; |
- |
- GLsizei max = std::numeric_limits<GLsizei>::max(); |
- EXPECT_CALL(*gpu_control_, CreateGpuMemoryBuffer(max, max, _, _)) |
- .WillOnce(Return(static_cast<gfx::GpuMemoryBuffer*>(NULL))); |
- gl_->CreateImageCHROMIUM(max, max, 0); |
- // The context should not be lost. |
- EXPECT_TRUE(NoCommandsWritten()); |
-} |
- |
#include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
} // namespace gles2 |