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

Side by Side Diff: content/browser/quota/quota_backend_impl_unittest.cc

Issue 1782053004: Change how the quota system computes the total poolsize for temporary storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 3 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "storage/browser/fileapi/quota/quota_backend_impl.h" 5 #include "storage/browser/fileapi/quota/quota_backend_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 storage::StorageType type, 63 storage::StorageType type,
64 int64_t delta) override { 64 int64_t delta) override {
65 ++storage_modified_count_; 65 ++storage_modified_count_;
66 usage_ += delta; 66 usage_ += delta;
67 ASSERT_LE(usage_, quota_); 67 ASSERT_LE(usage_, quota_);
68 } 68 }
69 69
70 void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner, 70 void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner,
71 const GURL& origin, 71 const GURL& origin,
72 storage::StorageType type, 72 storage::StorageType type,
73 const GetUsageAndQuotaCallback& callback) override { 73 const UsageAndQuotaCallback& callback) override {
74 callback.Run(storage::kQuotaStatusOk, usage_, quota_); 74 callback.Run(storage::kQuotaStatusOk, usage_, quota_);
75 } 75 }
76 76
77 int storage_modified_count() { return storage_modified_count_; } 77 int storage_modified_count() { return storage_modified_count_; }
78 int64_t usage() { return usage_; } 78 int64_t usage() { return usage_; }
79 void set_usage(int64_t usage) { usage_ = usage; } 79 void set_usage(int64_t usage) { usage_ = usage; }
80 void set_quota(int64_t quota) { quota_ = quota; } 80 void set_quota(int64_t quota) { quota_ = quota; }
81 81
82 protected: 82 protected:
83 ~MockQuotaManagerProxy() override {} 83 ~MockQuotaManagerProxy() override {}
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 uint32_t dirty = 0; 267 uint32_t dirty = 0;
268 ASSERT_TRUE(file_system_usage_cache_.GetDirty(path, &dirty)); 268 ASSERT_TRUE(file_system_usage_cache_.GetDirty(path, &dirty));
269 EXPECT_EQ(1u, dirty); 269 EXPECT_EQ(1u, dirty);
270 270
271 backend_->DecrementDirtyCount(GURL(kOrigin), type); 271 backend_->DecrementDirtyCount(GURL(kOrigin), type);
272 ASSERT_TRUE(file_system_usage_cache_.GetDirty(path, &dirty)); 272 ASSERT_TRUE(file_system_usage_cache_.GetDirty(path, &dirty));
273 EXPECT_EQ(0u, dirty); 273 EXPECT_EQ(0u, dirty);
274 } 274 }
275 275
276 } // namespace content 276 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/quota/mock_quota_manager_proxy.cc ('k') | content/browser/quota/quota_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698