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

Side by Side Diff: webkit/quota/quota_manager_unittest.cc

Issue 10916313: Cleanup: quota::HostUsageCallback and quota::HostQuotaCallback do not need to pass host and type as… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for Kinuko Review #1 Created 8 years, 3 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/quota/quota_manager.cc ('k') | webkit/quota/quota_types.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <set> 5 #include <set>
6 #include <sstream> 6 #include <sstream>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 weak_factory_.GetWeakPtr())); 152 weak_factory_.GetWeakPtr()));
153 } 153 }
154 154
155 void GetHostUsage(const std::string& host, StorageType type) { 155 void GetHostUsage(const std::string& host, StorageType type) {
156 host_.clear(); 156 host_.clear();
157 type_ = kStorageTypeUnknown; 157 type_ = kStorageTypeUnknown;
158 usage_ = -1; 158 usage_ = -1;
159 quota_manager_->GetHostUsage( 159 quota_manager_->GetHostUsage(
160 host, type, 160 host, type,
161 base::Bind(&QuotaManagerTest::DidGetHostUsage, 161 base::Bind(&QuotaManagerTest::DidGetHostUsage,
162 weak_factory_.GetWeakPtr())); 162 weak_factory_.GetWeakPtr(), host, type));
163 } 163 }
164 164
165 void RunAdditionalUsageAndQuotaTask(const GURL& origin, StorageType type) { 165 void RunAdditionalUsageAndQuotaTask(const GURL& origin, StorageType type) {
166 quota_manager_->GetUsageAndQuota( 166 quota_manager_->GetUsageAndQuota(
167 origin, type, 167 origin, type,
168 base::Bind(&QuotaManagerTest::DidGetUsageAndQuotaAdditional, 168 base::Bind(&QuotaManagerTest::DidGetUsageAndQuotaAdditional,
169 weak_factory_.GetWeakPtr())); 169 weak_factory_.GetWeakPtr()));
170 } 170 }
171 171
172 void DeleteClientOriginData(QuotaClient* client, 172 void DeleteClientOriginData(QuotaClient* client,
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after
2052 EXPECT_EQ(predelete_foo_tmp - 2 - 1, usage()); 2052 EXPECT_EQ(predelete_foo_tmp - 2 - 1, usage());
2053 2053
2054 DeleteHostData("foo.com", kTemp, 2054 DeleteHostData("foo.com", kTemp,
2055 QuotaClient::kDatabase | QuotaClient::kIndexedDatabase); 2055 QuotaClient::kDatabase | QuotaClient::kIndexedDatabase);
2056 MessageLoop::current()->RunAllPending(); 2056 MessageLoop::current()->RunAllPending();
2057 GetHostUsage("foo.com", kTemp); 2057 GetHostUsage("foo.com", kTemp);
2058 MessageLoop::current()->RunAllPending(); 2058 MessageLoop::current()->RunAllPending();
2059 EXPECT_EQ(predelete_foo_tmp - 8 - 4 - 2 - 1, usage()); 2059 EXPECT_EQ(predelete_foo_tmp - 8 - 4 - 2 - 1, usage());
2060 } 2060 }
2061 } // namespace quota 2061 } // namespace quota
OLDNEW
« no previous file with comments | « webkit/quota/quota_manager.cc ('k') | webkit/quota/quota_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698