| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "chrome/browser/renderer_host/web_cache_manager.h" | 8 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 9 #include "content/public/test/test_browser_thread.h" | 9 #include "content/public/test/test_browser_thread.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 KEEP_CURRENT_WITH_HEADROOM = WebCacheManager::KEEP_CURRENT_WITH_HEADROOM, | 86 KEEP_CURRENT_WITH_HEADROOM = WebCacheManager::KEEP_CURRENT_WITH_HEADROOM, |
| 87 KEEP_CURRENT = WebCacheManager::KEEP_CURRENT, | 87 KEEP_CURRENT = WebCacheManager::KEEP_CURRENT, |
| 88 KEEP_LIVE_WITH_HEADROOM = WebCacheManager::KEEP_LIVE_WITH_HEADROOM, | 88 KEEP_LIVE_WITH_HEADROOM = WebCacheManager::KEEP_LIVE_WITH_HEADROOM, |
| 89 KEEP_LIVE = WebCacheManager::KEEP_LIVE, | 89 KEEP_LIVE = WebCacheManager::KEEP_LIVE, |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 WebCacheManager* manager() { return &manager_; } | 92 WebCacheManager* manager() { return &manager_; } |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 WebCacheManager manager_; | 95 WebCacheManager manager_; |
| 96 MessageLoop message_loop_; | 96 base::MessageLoop message_loop_; |
| 97 content::TestBrowserThread ui_thread_; | 97 content::TestBrowserThread ui_thread_; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 // static | 100 // static |
| 101 const int WebCacheManagerTest::kRendererID = 146; | 101 const int WebCacheManagerTest::kRendererID = 146; |
| 102 | 102 |
| 103 // static | 103 // static |
| 104 const int WebCacheManagerTest::kRendererID2 = 245; | 104 const int WebCacheManagerTest::kRendererID2 = 245; |
| 105 | 105 |
| 106 // static | 106 // static |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 302 |
| 303 size_t expected_total_bytes = kExtraBytesToAllocate + | 303 size_t expected_total_bytes = kExtraBytesToAllocate + |
| 304 kStats.liveSize + kStats.deadSize + | 304 kStats.liveSize + kStats.deadSize + |
| 305 kStats2.liveSize + kStats2.deadSize; | 305 kStats2.liveSize + kStats2.deadSize; |
| 306 | 306 |
| 307 EXPECT_GE(expected_total_bytes, total_bytes); | 307 EXPECT_GE(expected_total_bytes, total_bytes); |
| 308 | 308 |
| 309 manager()->Remove(kRendererID); | 309 manager()->Remove(kRendererID); |
| 310 manager()->Remove(kRendererID2); | 310 manager()->Remove(kRendererID2); |
| 311 } | 311 } |
| OLD | NEW |