| 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/test/test_browser_thread.h" | 9 #include "content/test/test_browser_thread.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 using base::Time; | 12 using base::Time; |
| 13 using base::TimeDelta; | 13 using base::TimeDelta; |
| 14 using content::BrowserThread; |
| 14 using WebKit::WebCache; | 15 using WebKit::WebCache; |
| 15 | 16 |
| 16 class WebCacheManagerTest : public testing::Test { | 17 class WebCacheManagerTest : public testing::Test { |
| 17 protected: | 18 protected: |
| 18 typedef WebCacheManager::StatsMap StatsMap; | 19 typedef WebCacheManager::StatsMap StatsMap; |
| 19 typedef WebCacheManager::Allocation Allocation; | 20 typedef WebCacheManager::Allocation Allocation; |
| 20 typedef WebCacheManager::AllocationStrategy AllocationStrategy; | 21 typedef WebCacheManager::AllocationStrategy AllocationStrategy; |
| 21 | 22 |
| 22 static const int kRendererID; | 23 static const int kRendererID; |
| 23 static const int kRendererID2; | 24 static const int kRendererID2; |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 302 |
| 302 size_t expected_total_bytes = kExtraBytesToAllocate + | 303 size_t expected_total_bytes = kExtraBytesToAllocate + |
| 303 kStats.liveSize + kStats.deadSize + | 304 kStats.liveSize + kStats.deadSize + |
| 304 kStats2.liveSize + kStats2.deadSize; | 305 kStats2.liveSize + kStats2.deadSize; |
| 305 | 306 |
| 306 EXPECT_GE(expected_total_bytes, total_bytes); | 307 EXPECT_GE(expected_total_bytes, total_bytes); |
| 307 | 308 |
| 308 manager()->Remove(kRendererID); | 309 manager()->Remove(kRendererID); |
| 309 manager()->Remove(kRendererID2); | 310 manager()->Remove(kRendererID2); |
| 310 } | 311 } |
| OLD | NEW |