OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/cache_manager_host.h" | 8 #include "chrome/browser/cache_manager_host.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "webkit/glue/cache_manager.h" | 10 #include "webkit/glue/cache_manager.h" |
11 | 11 |
| 12 using base::Time; |
| 13 |
12 class CacheManagerHostTest : public testing::Test { | 14 class CacheManagerHostTest : public testing::Test { |
13 protected: | 15 protected: |
14 typedef CacheManagerHost::StatsMap StatsMap; | 16 typedef CacheManagerHost::StatsMap StatsMap; |
15 typedef CacheManagerHost::Allocation Allocation; | 17 typedef CacheManagerHost::Allocation Allocation; |
16 typedef CacheManagerHost::AllocationStrategy AllocationStrategy; | 18 typedef CacheManagerHost::AllocationStrategy AllocationStrategy; |
17 | 19 |
18 static const int kRendererID; | 20 static const int kRendererID; |
19 static const int kRendererID2; | 21 static const int kRendererID2; |
20 static const CacheManager::UsageStats kStats; | 22 static const CacheManager::UsageStats kStats; |
21 static const CacheManager::UsageStats kStats2; | 23 static const CacheManager::UsageStats kStats2; |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 size_t expected_total_bytes = kExtraBytesToAllocate + | 305 size_t expected_total_bytes = kExtraBytesToAllocate + |
304 kStats.live_size + kStats.dead_size + | 306 kStats.live_size + kStats.dead_size + |
305 kStats2.live_size + kStats2.dead_size; | 307 kStats2.live_size + kStats2.dead_size; |
306 | 308 |
307 EXPECT_GE(expected_total_bytes, total_bytes); | 309 EXPECT_GE(expected_total_bytes, total_bytes); |
308 | 310 |
309 h->Remove(kRendererID); | 311 h->Remove(kRendererID); |
310 h->Remove(kRendererID2); | 312 h->Remove(kRendererID2); |
311 } | 313 } |
312 | 314 |
OLD | NEW |