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

Side by Side Diff: webkit/database/database_quota_client_unittest.cc

Issue 7533013: Quota: Add quota::StorageType to the GetOriginsCallback definition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing onto today's ToT. Created 9 years, 4 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 | « webkit/database/database_quota_client.cc ('k') | webkit/fileapi/file_system_quota_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 <map> 5 #include <map>
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/memory/scoped_callback_factory.h" 8 #include "base/memory/scoped_callback_factory.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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 177 }
178 178
179 MockDatabaseTracker* mock_tracker() { return mock_tracker_.get(); } 179 MockDatabaseTracker* mock_tracker() { return mock_tracker_.get(); }
180 180
181 181
182 private: 182 private:
183 void OnGetOriginUsageComplete(int64 usage) { 183 void OnGetOriginUsageComplete(int64 usage) {
184 usage_ = usage; 184 usage_ = usage;
185 } 185 }
186 186
187 void OnGetOriginsComplete(const std::set<GURL>& origins) { 187 void OnGetOriginsComplete(const std::set<GURL>& origins,
188 quota::StorageType type) {
188 origins_ = origins; 189 origins_ = origins;
190 type_ = type;
189 } 191 }
190 192
191 void OnDeleteOriginDataComplete(quota::QuotaStatusCode status) { 193 void OnDeleteOriginDataComplete(quota::QuotaStatusCode status) {
192 delete_status_ = status; 194 delete_status_ = status;
193 } 195 }
194 196
195 int64 usage_; 197 int64 usage_;
196 std::set<GURL> origins_; 198 std::set<GURL> origins_;
199 quota::StorageType type_;
197 quota::QuotaStatusCode delete_status_; 200 quota::QuotaStatusCode delete_status_;
198 scoped_refptr<MockDatabaseTracker> mock_tracker_; 201 scoped_refptr<MockDatabaseTracker> mock_tracker_;
199 base::ScopedCallbackFactory<DatabaseQuotaClientTest> callback_factory_; 202 base::ScopedCallbackFactory<DatabaseQuotaClientTest> callback_factory_;
200 }; 203 };
201 204
202 205
203 TEST_F(DatabaseQuotaClientTest, GetOriginUsage) { 206 TEST_F(DatabaseQuotaClientTest, GetOriginUsage) {
204 DatabaseQuotaClient client( 207 DatabaseQuotaClient client(
205 base::MessageLoopProxy::CreateForCurrentThread(), 208 base::MessageLoopProxy::CreateForCurrentThread(),
206 mock_tracker()); 209 mock_tracker());
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 mock_tracker()->set_async_delete(false); 274 mock_tracker()->set_async_delete(false);
272 EXPECT_TRUE(DeleteOriginData(&client, kTemp, kOriginA)); 275 EXPECT_TRUE(DeleteOriginData(&client, kTemp, kOriginA));
273 EXPECT_EQ(1, mock_tracker()->delete_called_count()); 276 EXPECT_EQ(1, mock_tracker()->delete_called_count());
274 277
275 mock_tracker()->set_async_delete(true); 278 mock_tracker()->set_async_delete(true);
276 EXPECT_TRUE(DeleteOriginData(&client, kTemp, kOriginA)); 279 EXPECT_TRUE(DeleteOriginData(&client, kTemp, kOriginA));
277 EXPECT_EQ(2, mock_tracker()->delete_called_count()); 280 EXPECT_EQ(2, mock_tracker()->delete_called_count());
278 } 281 }
279 282
280 } // namespace webkit_database 283 } // namespace webkit_database
OLDNEW
« no previous file with comments | « webkit/database/database_quota_client.cc ('k') | webkit/fileapi/file_system_quota_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698