Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: webkit/browser/quota/usage_tracker_unittest.cc

Issue 218793002: Provide monitoring of usage for a storage type and origin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failures Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/browser/quota/usage_tracker.cc ('k') | webkit/storage_browser.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webkit/browser/quota/usage_tracker.cc ('k') | webkit/storage_browser.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698