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

Side by Side Diff: webkit/browser/fileapi/local_file_system_operation_unittest.cc

Issue 16155009: Update webkit/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
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 "webkit/browser/fileapi/local_file_system_operation.h" 5 #include "webkit/browser/fileapi/local_file_system_operation.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 int status() const { return status_; } 85 int status() const { return status_; }
86 const base::PlatformFileInfo& info() const { return info_; } 86 const base::PlatformFileInfo& info() const { return info_; }
87 const base::FilePath& path() const { return path_; } 87 const base::FilePath& path() const { return path_; }
88 const std::vector<DirectoryEntry>& entries() const { 88 const std::vector<DirectoryEntry>& entries() const {
89 return entries_; 89 return entries_;
90 } 90 }
91 91
92 const ShareableFileReference* shareable_file_ref() const { 92 const ShareableFileReference* shareable_file_ref() const {
93 return shareable_file_ref_; 93 return shareable_file_ref_.get();
94 } 94 }
95 95
96 quota::MockQuotaManager* quota_manager() { 96 quota::MockQuotaManager* quota_manager() {
97 return static_cast<quota::MockQuotaManager*>(quota_manager_.get()); 97 return static_cast<quota::MockQuotaManager*>(quota_manager_.get());
98 } 98 }
99 99
100 quota::MockQuotaManagerProxy* quota_manager_proxy() { 100 quota::MockQuotaManagerProxy* quota_manager_proxy() {
101 return static_cast<quota::MockQuotaManagerProxy*>( 101 return static_cast<quota::MockQuotaManagerProxy*>(
102 quota_manager_proxy_.get()); 102 quota_manager_proxy_.get());
103 } 103 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 shareable_file_ref_ = shareable_file_ref; 218 shareable_file_ref_ = shareable_file_ref;
219 } 219 }
220 220
221 int64 GetDataSizeOnDisk() { 221 int64 GetDataSizeOnDisk() {
222 return sandbox_file_system_.ComputeCurrentOriginUsage() - 222 return sandbox_file_system_.ComputeCurrentOriginUsage() -
223 sandbox_file_system_.ComputeCurrentDirectoryDatabaseUsage(); 223 sandbox_file_system_.ComputeCurrentDirectoryDatabaseUsage();
224 } 224 }
225 225
226 void GetUsageAndQuota(int64* usage, int64* quota) { 226 void GetUsageAndQuota(int64* usage, int64* quota) {
227 quota::QuotaStatusCode status = 227 quota::QuotaStatusCode status =
228 AsyncFileTestHelper::GetUsageAndQuota( 228 AsyncFileTestHelper::GetUsageAndQuota(quota_manager_.get(),
229 quota_manager_, 229 sandbox_file_system_.origin(),
230 sandbox_file_system_.origin(), 230 sandbox_file_system_.type(),
231 sandbox_file_system_.type(), 231 usage,
232 usage, quota); 232 quota);
233 base::MessageLoop::current()->RunUntilIdle(); 233 base::MessageLoop::current()->RunUntilIdle();
234 ASSERT_EQ(quota::kQuotaStatusOk, status); 234 ASSERT_EQ(quota::kQuotaStatusOk, status);
235 } 235 }
236 236
237 int64 ComputePathCost(const FileSystemURL& url) { 237 int64 ComputePathCost(const FileSystemURL& url) {
238 int64 base_usage; 238 int64 base_usage;
239 GetUsageAndQuota(&base_usage, NULL); 239 GetUsageAndQuota(&base_usage, NULL);
240 240
241 AsyncFileTestHelper::CreateFile( 241 AsyncFileTestHelper::CreateFile(
242 sandbox_file_system_.file_system_context(), url); 242 sandbox_file_system_.file_system_context(), url);
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 base::MessageLoop::current()->RunUntilIdle(); 1180 base::MessageLoop::current()->RunUntilIdle();
1181 1181
1182 expected_usage += grandchild_file_size + grandchild_path_cost; 1182 expected_usage += grandchild_file_size + grandchild_path_cost;
1183 usage = GetUsage(); 1183 usage = GetUsage();
1184 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size, 1184 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size,
1185 GetDataSizeOnDisk()); 1185 GetDataSizeOnDisk());
1186 EXPECT_EQ(expected_usage, usage); 1186 EXPECT_EQ(expected_usage, usage);
1187 } 1187 }
1188 1188
1189 } // namespace fileapi 1189 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698