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

Unified Diff: webkit/browser/fileapi/quota/quota_reservation_manager_unittest.cc

Issue 61593002: Quota: Implement QuotaBackendImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: webkit/browser/fileapi/quota/quota_reservation_manager_unittest.cc
diff --git a/webkit/browser/fileapi/quota/quota_reservation_manager_unittest.cc b/webkit/browser/fileapi/quota/quota_reservation_manager_unittest.cc
index 86590c7a69a85667a60ae775cd6274d18506f156..d9a521d4324797c97319a9c09ac31109d2a2939f 100644
--- a/webkit/browser/fileapi/quota/quota_reservation_manager_unittest.cc
+++ b/webkit/browser/fileapi/quota/quota_reservation_manager_unittest.cc
@@ -23,7 +23,6 @@ const FileSystemType kType = kFileSystemTypeTemporary;
const int64 kInitialFileSize = 30;
typedef QuotaReservationManager::ReserveQuotaCallback ReserveQuotaCallback;
-typedef QuotaReservationManager::StatusCallback StatusCallback;
class FakeBackend : public QuotaReservationManager::QuotaBackend {
public:
@@ -55,19 +54,16 @@ class FakeBackend : public QuotaReservationManager::QuotaBackend {
virtual void CommitQuotaUsage(const GURL& origin,
FileSystemType type,
- int64 delta,
- const StatusCallback& callback) OVERRIDE {
+ int64 delta) OVERRIDE {
EXPECT_EQ(GURL(kOrigin), origin);
EXPECT_EQ(kType, type);
on_disk_usage_ += delta;
- base::MessageLoopProxy::current()->PostTask(
- FROM_HERE, base::Bind(callback, base::PLATFORM_FILE_OK));
}
- virtual void IncreaseDirtyCount(const GURL& origin,
- FileSystemType type) OVERRIDE {}
- virtual void DecreaseDirtyCount(const GURL& origin,
- FileSystemType type) OVERRIDE {}
+ virtual void IncrementDirtyCount(const GURL& origin,
+ FileSystemType type) OVERRIDE {}
+ virtual void DecrementDirtyCount(const GURL& origin,
+ FileSystemType type) OVERRIDE {}
int64 on_memory_usage() { return on_memory_usage_; }
int64 on_disk_usage() { return on_disk_usage_; }
@@ -106,14 +102,12 @@ class QuotaReservationManagerTest : public testing::Test {
file_path_ = work_dir_.path().Append(FILE_PATH_LITERAL("hoge"));
SetFileSize(kInitialFileSize);
- fake_backend_.reset(new FakeBackend);
- reservation_manager_.reset(new QuotaReservationManager(
- fake_backend_.get()));
+ scoped_ptr<QuotaReservationManager::QuotaBackend> backend(new FakeBackend);
+ reservation_manager_.reset(new QuotaReservationManager(backend.Pass()));
}
virtual void TearDown() OVERRIDE {
reservation_manager_.reset();
- fake_backend_.reset();
}
int64 GetFileSize() {
@@ -140,7 +134,7 @@ class QuotaReservationManagerTest : public testing::Test {
}
FakeBackend* fake_backend() {
- return fake_backend_.get();
+ return static_cast<FakeBackend*>(reservation_manager_->backend_.get());
}
QuotaReservationManager* reservation_manager() {
@@ -155,7 +149,6 @@ class QuotaReservationManagerTest : public testing::Test {
base::MessageLoop message_loop_;
base::ScopedTempDir work_dir_;
base::FilePath file_path_;
- scoped_ptr<FakeBackend> fake_backend_;
scoped_ptr<QuotaReservationManager> reservation_manager_;
DISALLOW_COPY_AND_ASSIGN(QuotaReservationManagerTest);

Powered by Google App Engine
This is Rietveld 408576698