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

Side by Side Diff: webkit/fileapi/file_system_quota_client_unittest.cc

Issue 7057032: Integrated obfuscation with quota; all unit tests now pass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Eliminated a vector copy Created 9 years, 7 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/fileapi/file_system_path_manager_unittest.cc ('k') | webkit/fileapi/file_system_util.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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/memory/scoped_callback_factory.h" 7 #include "base/memory/scoped_callback_factory.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/platform_file.h" 10 #include "base/platform_file.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 callback_factory_.NewCallback( 119 callback_factory_.NewCallback(
120 &FileSystemQuotaClientTest::OnGetAdditionalUsage)); 120 &FileSystemQuotaClientTest::OnGetAdditionalUsage));
121 } 121 }
122 122
123 FilePath GetOriginBasePath(const char* origin_url, 123 FilePath GetOriginBasePath(const char* origin_url,
124 quota::StorageType type) { 124 quota::StorageType type) {
125 // Note: this test assumes sandbox_provider impl is used for 125 // Note: this test assumes sandbox_provider impl is used for
126 // temporary and persistent filesystem. 126 // temporary and persistent filesystem.
127 return file_system_context_->path_manager()->sandbox_provider()-> 127 return file_system_context_->path_manager()->sandbox_provider()->
128 GetBaseDirectoryForOriginAndType( 128 GetBaseDirectoryForOriginAndType(
129 GURL(origin_url), QuotaStorageTypeToFileSystemType(type)); 129 GURL(origin_url), QuotaStorageTypeToFileSystemType(type), true);
130 } 130 }
131 131
132 bool CreateFileSystemDirectory(const char* dir_name, 132 bool CreateFileSystemDirectory(const char* dir_name,
133 const char* origin_url, 133 const char* origin_url,
134 quota::StorageType type) { 134 quota::StorageType type) {
135 FilePath origin_base_path = GetOriginBasePath(origin_url, type); 135 FilePath origin_base_path = GetOriginBasePath(origin_url, type);
136 FilePath dir_path; 136 FilePath dir_path;
137 if (dir_name != NULL) 137 if (dir_name != NULL)
138 dir_path = origin_base_path.AppendASCII(dir_name); 138 dir_path = origin_base_path.AppendASCII(dir_name);
139 else 139 else
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 GetOriginUsage(quota_client.get(), 505 GetOriginUsage(quota_client.get(),
506 "https://bar.com/", 506 "https://bar.com/",
507 kPersistent)); 507 kPersistent));
508 EXPECT_EQ(64 + kUsageFileSize, 508 EXPECT_EQ(64 + kUsageFileSize,
509 GetOriginUsage(quota_client.get(), 509 GetOriginUsage(quota_client.get(),
510 "https://bar.com/", 510 "https://bar.com/",
511 kTemporary)); 511 kTemporary));
512 } 512 }
513 513
514 } // namespace fileapi 514 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_path_manager_unittest.cc ('k') | webkit/fileapi/file_system_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698