| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "net/base/net_util.h" | 7 #include "net/base/net_util.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "webkit/browser/quota/mock_special_storage_policy.h" | 9 #include "webkit/browser/quota/mock_special_storage_policy.h" |
| 10 #include "webkit/browser/quota/usage_tracker.h" | 10 #include "webkit/browser/quota/usage_tracker.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 UsageMap usage_map_; | 114 UsageMap usage_map_; |
| 115 | 115 |
| 116 DISALLOW_COPY_AND_ASSIGN(MockQuotaClient); | 116 DISALLOW_COPY_AND_ASSIGN(MockQuotaClient); |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 class UsageTrackerTest : public testing::Test { | 119 class UsageTrackerTest : public testing::Test { |
| 120 public: | 120 public: |
| 121 UsageTrackerTest() | 121 UsageTrackerTest() |
| 122 : storage_policy_(new MockSpecialStoragePolicy()), | 122 : storage_policy_(new MockSpecialStoragePolicy()), |
| 123 usage_tracker_(GetUsageTrackerList(), kStorageTypeTemporary, | 123 usage_tracker_(GetUsageTrackerList(), kStorageTypeTemporary, |
| 124 storage_policy_.get()) { | 124 storage_policy_.get(), NULL) { |
| 125 } | 125 } |
| 126 | 126 |
| 127 virtual ~UsageTrackerTest() {} | 127 virtual ~UsageTrackerTest() {} |
| 128 | 128 |
| 129 UsageTracker* usage_tracker() { | 129 UsageTracker* usage_tracker() { |
| 130 return &usage_tracker_; | 130 return &usage_tracker_; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void UpdateUsage(const GURL& origin, int64 delta) { | 133 void UpdateUsage(const GURL& origin, int64 delta) { |
| 134 quota_client_.UpdateUsage(origin, delta); | 134 quota_client_.UpdateUsage(origin, delta); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 319 |
| 320 GetGlobalLimitedUsage(&limited_usage); | 320 GetGlobalLimitedUsage(&limited_usage); |
| 321 GetGlobalUsage(&total_usage, &unlimited_usage); | 321 GetGlobalUsage(&total_usage, &unlimited_usage); |
| 322 EXPECT_EQ(1 + 16, limited_usage); | 322 EXPECT_EQ(1 + 16, limited_usage); |
| 323 EXPECT_EQ(1 + 2 + 16 + 32, total_usage); | 323 EXPECT_EQ(1 + 2 + 16 + 32, total_usage); |
| 324 EXPECT_EQ(2 + 32, unlimited_usage); | 324 EXPECT_EQ(2 + 32, unlimited_usage); |
| 325 } | 325 } |
| 326 | 326 |
| 327 | 327 |
| 328 } // namespace quota | 328 } // namespace quota |
| OLD | NEW |