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

Side by Side Diff: gpu/command_buffer/client/transfer_buffer_unittest.cc

Issue 782583003: List sync points to wait on in AsyncFlush message Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Tests for the Command Buffer Helper. 5 // Tests for the Command Buffer Helper.
6 6
7 #include "gpu/command_buffer/client/transfer_buffer.h" 7 #include "gpu/command_buffer/client/transfer_buffer.h"
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "gpu/command_buffer/client/client_test_helper.h" 10 #include "gpu/command_buffer/client/client_test_helper.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 } 193 }
194 194
195 TEST_F(TransferBufferTest, Flush) { 195 TEST_F(TransferBufferTest, Flush) {
196 Initialize(16u); 196 Initialize(16u);
197 unsigned int size_allocated = 0; 197 unsigned int size_allocated = 0;
198 for (int i = 0; i < 8; ++i) { 198 for (int i = 0; i < 8; ++i) {
199 void* ptr = transfer_buffer_->AllocUpTo(8u, &size_allocated); 199 void* ptr = transfer_buffer_->AllocUpTo(8u, &size_allocated);
200 ASSERT_TRUE(ptr != NULL); 200 ASSERT_TRUE(ptr != NULL);
201 EXPECT_EQ(8u, size_allocated); 201 EXPECT_EQ(8u, size_allocated);
202 if (i % 2) { 202 if (i % 2) {
203 EXPECT_CALL(*command_buffer(), Flush(_)) 203 EXPECT_CALL(*command_buffer(), Flush(_, _))
204 .Times(1) 204 .Times(1)
205 .RetiresOnSaturation(); 205 .RetiresOnSaturation();
206 } 206 }
207 transfer_buffer_->FreePendingToken(ptr, helper_->InsertToken()); 207 transfer_buffer_->FreePendingToken(ptr, helper_->InsertToken());
208 } 208 }
209 for (int i = 0; i < 8; ++i) { 209 for (int i = 0; i < 8; ++i) {
210 void* ptr = transfer_buffer_->Alloc(8u); 210 void* ptr = transfer_buffer_->Alloc(8u);
211 ASSERT_TRUE(ptr != NULL); 211 ASSERT_TRUE(ptr != NULL);
212 if (i % 2) { 212 if (i % 2) {
213 EXPECT_CALL(*command_buffer(), Flush(_)) 213 EXPECT_CALL(*command_buffer(), Flush(_, _))
214 .Times(1) 214 .Times(1)
215 .RetiresOnSaturation(); 215 .RetiresOnSaturation();
216 } 216 }
217 transfer_buffer_->FreePendingToken(ptr, helper_->InsertToken()); 217 transfer_buffer_->FreePendingToken(ptr, helper_->InsertToken());
218 } 218 }
219 } 219 }
220 220
221 class MockClientCommandBufferCanFail : public MockClientCommandBufferMockFlush { 221 class MockClientCommandBufferCanFail : public MockClientCommandBufferMockFlush {
222 public: 222 public:
223 MockClientCommandBufferCanFail() { 223 MockClientCommandBufferCanFail() {
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 476
477 // Check it's the default size. 477 // Check it's the default size.
478 EXPECT_EQ( 478 EXPECT_EQ(
479 kStartTransferBufferSize - kStartingOffset, 479 kStartTransferBufferSize - kStartingOffset,
480 transfer_buffer_->GetCurrentMaxAllocationWithoutRealloc()); 480 transfer_buffer_->GetCurrentMaxAllocationWithoutRealloc());
481 } 481 }
482 482
483 } // namespace gpu 483 } // namespace gpu
484 484
485 485
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest_autogen.h ('k') | gpu/command_buffer/common/command_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698