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

Side by Side Diff: chrome/browser/browsing_data_quota_helper_unittest.cc

Issue 9369027: Remove `kMockStart` from `quota::MockStorageClient` (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/quota/mock_storage_client.h » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 void StartFetching() { 64 void StartFetching() {
65 fetching_completed_ = false; 65 fetching_completed_ = false;
66 helper_->StartFetching( 66 helper_->StartFetching(
67 base::Bind(&BrowsingDataQuotaHelperTest::FetchCompleted, 67 base::Bind(&BrowsingDataQuotaHelperTest::FetchCompleted,
68 weak_factory_.GetWeakPtr())); 68 weak_factory_.GetWeakPtr()));
69 } 69 }
70 70
71 void RegisterClient(const quota::MockOriginData* data, std::size_t data_len) { 71 void RegisterClient(const quota::MockOriginData* data, std::size_t data_len) {
72 quota::MockStorageClient* client = 72 quota::MockStorageClient* client =
73 new quota::MockStorageClient( 73 new quota::MockStorageClient(
74 quota_manager_->proxy(), data, data_len); 74 quota_manager_->proxy(), data, quota::QuotaClient::kFileSystem,
75 data_len);
75 quota_manager_->proxy()->RegisterClient(client); 76 quota_manager_->proxy()->RegisterClient(client);
76 client->TouchAllOriginsAndNotify(); 77 client->TouchAllOriginsAndNotify();
77 } 78 }
78 79
79 void SetPersistentHostQuota(const std::string& host, int64 quota) { 80 void SetPersistentHostQuota(const std::string& host, int64 quota) {
80 quota_ = -1; 81 quota_ = -1;
81 quota_manager_->SetPersistentHostQuota( 82 quota_manager_->SetPersistentHostQuota(
82 host, quota, 83 host, quota,
83 base::Bind(&BrowsingDataQuotaHelperTest::GotPersistentHostQuota, 84 base::Bind(&BrowsingDataQuotaHelperTest::GotPersistentHostQuota,
84 weak_factory_.GetWeakPtr())); 85 weak_factory_.GetWeakPtr()));
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 MessageLoop::current()->RunAllPending(); 172 MessageLoop::current()->RunAllPending();
172 173
173 GetPersistentHostQuota(kHost1); 174 GetPersistentHostQuota(kHost1);
174 MessageLoop::current()->RunAllPending(); 175 MessageLoop::current()->RunAllPending();
175 EXPECT_EQ(0, quota()); 176 EXPECT_EQ(0, quota());
176 177
177 GetPersistentHostQuota(kHost2); 178 GetPersistentHostQuota(kHost2);
178 MessageLoop::current()->RunAllPending(); 179 MessageLoop::current()->RunAllPending();
179 EXPECT_EQ(10, quota()); 180 EXPECT_EQ(10, quota());
180 } 181 }
OLDNEW
« no previous file with comments | « no previous file | webkit/quota/mock_storage_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698