OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 14 matching lines...) Expand all Loading... |
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 | 32 |
33 // This file contains the tests for the FencedAllocator class. | 33 // This file contains the tests for the FencedAllocator class. |
34 | 34 |
| 35 #include "base/at_exit.h" |
35 #include "base/message_loop.h" | 36 #include "base/message_loop.h" |
36 #include "gpu/command_buffer/client/cmd_buffer_helper.h" | 37 #include "gpu/command_buffer/client/cmd_buffer_helper.h" |
37 #include "gpu/command_buffer/client/fenced_allocator.h" | 38 #include "gpu/command_buffer/client/fenced_allocator.h" |
38 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 39 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
39 #include "gpu/command_buffer/service/mocks.h" | 40 #include "gpu/command_buffer/service/mocks.h" |
40 #include "gpu/command_buffer/service/command_buffer_service.h" | 41 #include "gpu/command_buffer/service/command_buffer_service.h" |
41 #include "gpu/command_buffer/service/gpu_processor.h" | 42 #include "gpu/command_buffer/service/gpu_processor.h" |
42 #include "gpu/np_utils/np_browser_stub.h" | 43 #include "gpu/np_utils/np_browser_stub.h" |
43 #include "gpu/np_utils/np_object_pointer.h" | 44 #include "gpu/np_utils/np_object_pointer.h" |
44 #include "testing/gtest/include/gtest/gtest.h" | 45 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 api_mock_->set_engine(gpu_processor.get()); | 95 api_mock_->set_engine(gpu_processor.get()); |
95 | 96 |
96 helper_.reset(new CommandBufferHelper(command_buffer_.get())); | 97 helper_.reset(new CommandBufferHelper(command_buffer_.get())); |
97 helper_->Initialize(); | 98 helper_->Initialize(); |
98 } | 99 } |
99 | 100 |
100 virtual void TearDown() { | 101 virtual void TearDown() { |
101 helper_.release(); | 102 helper_.release(); |
102 } | 103 } |
103 | 104 |
| 105 base::AtExitManager at_exit_manager_; |
104 MessageLoop message_loop_; | 106 MessageLoop message_loop_; |
105 np_utils::StubNPBrowser browser_; | 107 np_utils::StubNPBrowser browser_; |
106 scoped_ptr<AsyncAPIMock> api_mock_; | 108 scoped_ptr<AsyncAPIMock> api_mock_; |
107 scoped_ptr<CommandBufferService> command_buffer_; | 109 scoped_ptr<CommandBufferService> command_buffer_; |
108 command_buffer::CommandParser* parser_; | 110 command_buffer::CommandParser* parser_; |
109 scoped_ptr<CommandBufferHelper> helper_; | 111 scoped_ptr<CommandBufferHelper> helper_; |
110 }; | 112 }; |
111 | 113 |
112 #ifndef COMPILER_MSVC | 114 #ifndef COMPILER_MSVC |
113 const unsigned int BaseFencedAllocatorTest::kBufferSize; | 115 const unsigned int BaseFencedAllocatorTest::kBufferSize; |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 EXPECT_LE(token, command_buffer_->GetToken()); | 492 EXPECT_LE(token, command_buffer_->GetToken()); |
491 | 493 |
492 // Free up everything. | 494 // Free up everything. |
493 for (unsigned int i = 0; i < kAllocCount; ++i) { | 495 for (unsigned int i = 0; i < kAllocCount; ++i) { |
494 allocator_->Free(pointers[i]); | 496 allocator_->Free(pointers[i]); |
495 EXPECT_TRUE(allocator_->CheckConsistency()); | 497 EXPECT_TRUE(allocator_->CheckConsistency()); |
496 } | 498 } |
497 } | 499 } |
498 | 500 |
499 } // namespace command_buffer | 501 } // namespace command_buffer |
OLD | NEW |