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

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

Issue 465040: Added CommandBufferClient, CommandBufferStub and some IPC messages.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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
« no previous file with comments | « gpu/command_buffer/service/command_buffer_service.cc ('k') | gpu/command_buffer/service/common_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/command_buffer_service_unittest.cc
===================================================================
--- gpu/command_buffer/service/command_buffer_service_unittest.cc (revision 34314)
+++ gpu/command_buffer/service/command_buffer_service_unittest.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -14,7 +14,7 @@
using testing::SetArgumentPointee;
using testing::StrictMock;
-namespace command_buffer {
+namespace gpu {
class CommandBufferServiceTest : public testing::Test {
protected:
@@ -30,17 +30,16 @@
}
TEST_F(CommandBufferServiceTest, InitializesCommandBuffer) {
- SharedMemory* ring_buffer = new SharedMemory;
- EXPECT_TRUE(ring_buffer->Create(std::wstring(), false, false, 1024));
- EXPECT_TRUE(command_buffer_->Initialize(ring_buffer));
- EXPECT_TRUE(ring_buffer == command_buffer_->GetRingBuffer());
- EXPECT_EQ(256, command_buffer_->GetSize());
+ base::SharedMemory* ring_buffer = command_buffer_->Initialize(1024);
+ EXPECT_TRUE(NULL != ring_buffer);
+ EXPECT_EQ(ring_buffer, command_buffer_->GetRingBuffer());
+ EXPECT_GT(command_buffer_->GetSize(), 0);
}
TEST_F(CommandBufferServiceTest, InitializeFailsSecondTime) {
SharedMemory* ring_buffer = new SharedMemory;
- EXPECT_TRUE(command_buffer_->Initialize(ring_buffer));
- EXPECT_FALSE(command_buffer_->Initialize(ring_buffer));
+ EXPECT_TRUE(NULL != command_buffer_->Initialize(1024));
+ EXPECT_TRUE(NULL == command_buffer_->Initialize(1024));
}
TEST_F(CommandBufferServiceTest, GetAndPutOffsetsDefaultToZero) {
@@ -54,11 +53,8 @@
};
TEST_F(CommandBufferServiceTest, CanSyncGetAndPutOffset) {
- SharedMemory* ring_buffer = new SharedMemory;
- ring_buffer->Create(std::wstring(), false, false, 1024);
+ command_buffer_->Initialize(1024);
- EXPECT_TRUE(command_buffer_->Initialize(ring_buffer));
-
StrictMock<MockCallback>* put_offset_change_callback =
new StrictMock<MockCallback>;
command_buffer_->SetPutOffsetChangeCallback(put_offset_change_callback);
@@ -175,4 +171,4 @@
EXPECT_TRUE(command_buffer_->GetErrorStatus());
}
-} // namespace command_buffer
+} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/command_buffer_service.cc ('k') | gpu/command_buffer/service/common_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698