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