OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/browser/renderer_host/software_frame_manager.h" | 5 #include "content/browser/renderer_host/software_frame_manager.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 void AllocateClients(size_t num_clients) { | 60 void AllocateClients(size_t num_clients) { |
61 for (size_t i = 0; i < num_clients; ++i) | 61 for (size_t i = 0; i < num_clients; ++i) |
62 clients_.push_back(new FakeSoftwareFrameManagerClient); | 62 clients_.push_back(new FakeSoftwareFrameManagerClient); |
63 } | 63 } |
64 void FreeClients() { | 64 void FreeClients() { |
65 for (size_t i = 0; i < clients_.size(); ++i) | 65 for (size_t i = 0; i < clients_.size(); ++i) |
66 delete clients_[i]; | 66 delete clients_[i]; |
67 clients_.clear(); | 67 clients_.clear(); |
68 } | 68 } |
69 size_t MaxNumberOfSavedFrames() const { | 69 size_t MaxNumberOfSavedFrames() const { |
70 size_t result = SoftwareFrameMemoryManager::GetInstance()-> | 70 size_t result = |
71 max_number_of_saved_frames(); | 71 RendererFrameManager::GetInstance()->max_number_of_saved_frames(); |
72 return result; | 72 return result; |
73 } | 73 } |
74 | 74 |
75 protected: | 75 protected: |
76 std::vector<FakeSoftwareFrameManagerClient*> clients_; | 76 std::vector<FakeSoftwareFrameManagerClient*> clients_; |
77 | 77 |
78 private: | 78 private: |
79 DISALLOW_COPY_AND_ASSIGN(SoftwareFrameManagerTest); | 79 DISALLOW_COPY_AND_ASSIGN(SoftwareFrameManagerTest); |
80 }; | 80 }; |
81 | 81 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 EXPECT_EQ(1u, test_client->evicted_frame_count()); | 246 EXPECT_EQ(1u, test_client->evicted_frame_count()); |
247 callback->Run(0, false); | 247 callback->Run(0, false); |
248 callback.reset(); | 248 callback.reset(); |
249 EXPECT_EQ(10u, test_client->freed_frame_count()); | 249 EXPECT_EQ(10u, test_client->freed_frame_count()); |
250 EXPECT_EQ(1u, test_client->evicted_frame_count()); | 250 EXPECT_EQ(1u, test_client->evicted_frame_count()); |
251 | 251 |
252 FreeClients(); | 252 FreeClients(); |
253 } | 253 } |
254 | 254 |
255 } // namespace content | 255 } // namespace content |
OLD | NEW |