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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc

Issue 621673002: command_buffer: Remove unused shared id code (GenSharedIdsCHROMIUM, ...) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
index 9ddadf83f41ccde50466be7a381c29881f66c0df..e97b4c4eb95ef30606a788d2ee8512687c735cb2 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -8,7 +8,6 @@
#include "base/strings/string_number_conversions.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
-#include "gpu/command_buffer/common/id_allocator.h"
#include "gpu/command_buffer/service/async_pixel_transfer_delegate_mock.h"
#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
#include "gpu/command_buffer/service/async_pixel_transfer_manager_mock.h"
@@ -209,123 +208,6 @@ TEST_P(GLES2DecoderWithShaderTest, GetMaxValueInBufferCHROMIUM) {
EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
}
-TEST_P(GLES2DecoderTest, SharedIds) {
- GenSharedIdsCHROMIUM gen_cmd;
- RegisterSharedIdsCHROMIUM reg_cmd;
- DeleteSharedIdsCHROMIUM del_cmd;
-
- const GLuint kNamespaceId = id_namespaces::kTextures;
- const GLuint kExpectedId1 = 1;
- const GLuint kExpectedId2 = 2;
- const GLuint kExpectedId3 = 4;
- const GLuint kRegisterId = 3;
- GLuint* ids = GetSharedMemoryAs<GLuint*>();
- gen_cmd.Init(kNamespaceId, 0, 2, kSharedMemoryId, kSharedMemoryOffset);
- EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
- IdAllocatorInterface* id_allocator = GetIdAllocator(kNamespaceId);
- ASSERT_TRUE(id_allocator != NULL);
- // This check is implementation dependant but it's kind of hard to check
- // otherwise.
- EXPECT_EQ(kExpectedId1, ids[0]);
- EXPECT_EQ(kExpectedId2, ids[1]);
- EXPECT_TRUE(id_allocator->InUse(kExpectedId1));
- EXPECT_TRUE(id_allocator->InUse(kExpectedId2));
- EXPECT_FALSE(id_allocator->InUse(kRegisterId));
- EXPECT_FALSE(id_allocator->InUse(kExpectedId3));
-
- ClearSharedMemory();
- ids[0] = kRegisterId;
- reg_cmd.Init(kNamespaceId, 1, kSharedMemoryId, kSharedMemoryOffset);
- EXPECT_EQ(error::kNoError, ExecuteCmd(reg_cmd));
- EXPECT_TRUE(id_allocator->InUse(kExpectedId1));
- EXPECT_TRUE(id_allocator->InUse(kExpectedId2));
- EXPECT_TRUE(id_allocator->InUse(kRegisterId));
- EXPECT_FALSE(id_allocator->InUse(kExpectedId3));
-
- ClearSharedMemory();
- gen_cmd.Init(kNamespaceId, 0, 1, kSharedMemoryId, kSharedMemoryOffset);
- EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
- EXPECT_EQ(kExpectedId3, ids[0]);
- EXPECT_TRUE(id_allocator->InUse(kExpectedId1));
- EXPECT_TRUE(id_allocator->InUse(kExpectedId2));
- EXPECT_TRUE(id_allocator->InUse(kRegisterId));
- EXPECT_TRUE(id_allocator->InUse(kExpectedId3));
-
- ClearSharedMemory();
- ids[0] = kExpectedId1;
- ids[1] = kRegisterId;
- del_cmd.Init(kNamespaceId, 2, kSharedMemoryId, kSharedMemoryOffset);
- EXPECT_EQ(error::kNoError, ExecuteCmd(del_cmd));
- EXPECT_FALSE(id_allocator->InUse(kExpectedId1));
- EXPECT_TRUE(id_allocator->InUse(kExpectedId2));
- EXPECT_FALSE(id_allocator->InUse(kRegisterId));
- EXPECT_TRUE(id_allocator->InUse(kExpectedId3));
-
- ClearSharedMemory();
- ids[0] = kExpectedId3;
- ids[1] = kExpectedId2;
- del_cmd.Init(kNamespaceId, 2, kSharedMemoryId, kSharedMemoryOffset);
- EXPECT_EQ(error::kNoError, ExecuteCmd(del_cmd));
- EXPECT_FALSE(id_allocator->InUse(kExpectedId1));
- EXPECT_FALSE(id_allocator->InUse(kExpectedId2));
- EXPECT_FALSE(id_allocator->InUse(kRegisterId));
- EXPECT_FALSE(id_allocator->InUse(kExpectedId3));
-
- // Check passing in an id_offset.
- ClearSharedMemory();
- const GLuint kOffset = 0xABCDEF;
- gen_cmd.Init(kNamespaceId, kOffset, 2, kSharedMemoryId, kSharedMemoryOffset);
- EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
- EXPECT_EQ(kOffset, ids[0]);
- EXPECT_EQ(kOffset + 1, ids[1]);
-}
-
-TEST_P(GLES2DecoderTest, GenSharedIdsCHROMIUMBadArgs) {
- const GLuint kNamespaceId = id_namespaces::kTextures;
- GenSharedIdsCHROMIUM cmd;
- cmd.Init(kNamespaceId, 0, -1, kSharedMemoryId, kSharedMemoryOffset);
- EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
- cmd.Init(kNamespaceId, 0, 1, kInvalidSharedMemoryId, kSharedMemoryOffset);
- EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
- cmd.Init(kNamespaceId, 0, 1, kSharedMemoryId, kInvalidSharedMemoryOffset);
- EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
-}
-
-TEST_P(GLES2DecoderTest, RegisterSharedIdsCHROMIUMBadArgs) {
- const GLuint kNamespaceId = id_namespaces::kTextures;
- RegisterSharedIdsCHROMIUM cmd;
- cmd.Init(kNamespaceId, -1, kSharedMemoryId, kSharedMemoryOffset);
- EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
- cmd.Init(kNamespaceId, 1, kInvalidSharedMemoryId, kSharedMemoryOffset);
- EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
- cmd.Init(kNamespaceId, 1, kSharedMemoryId, kInvalidSharedMemoryOffset);
- EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
-}
-
-TEST_P(GLES2DecoderTest, RegisterSharedIdsCHROMIUMDuplicateIds) {
- const GLuint kNamespaceId = id_namespaces::kTextures;
- const GLuint kRegisterId = 3;
- RegisterSharedIdsCHROMIUM cmd;
- GLuint* ids = GetSharedMemoryAs<GLuint*>();
- ids[0] = kRegisterId;
- cmd.Init(kNamespaceId, 1, kSharedMemoryId, kSharedMemoryOffset);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- cmd.Init(kNamespaceId, 1, kSharedMemoryId, kSharedMemoryOffset);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
-}
-
-TEST_P(GLES2DecoderTest, DeleteSharedIdsCHROMIUMBadArgs) {
- const GLuint kNamespaceId = id_namespaces::kTextures;
- DeleteSharedIdsCHROMIUM cmd;
- cmd.Init(kNamespaceId, -1, kSharedMemoryId, kSharedMemoryOffset);
- EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
- cmd.Init(kNamespaceId, 1, kInvalidSharedMemoryId, kSharedMemoryOffset);
- EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
- cmd.Init(kNamespaceId, 1, kSharedMemoryId, kInvalidSharedMemoryOffset);
- EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
-}
-
TEST_P(GLES2DecoderTest, IsBuffer) {
EXPECT_FALSE(DoIsBuffer(client_buffer_id_));
DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId);
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698