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

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

Issue 7583053: Add MessageLoopProxy::current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need for MessageLoopProxy destruction observer. 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
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 // This test checks the entire behavior of FileSystem usage and quota, such as: 5 // This test checks the entire behavior of FileSystem usage and quota, such as:
6 // 1) the actual size of files on disk, 6 // 1) the actual size of files on disk,
7 // 2) the described size in .usage, and 7 // 2) the described size in .usage, and
8 // 3) the result of QuotaManager::GetUsageAndQuota. 8 // 3) the result of QuotaManager::GetUsageAndQuota.
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } // namespace (anonymous) 206 } // namespace (anonymous)
207 207
208 void FileSystemQuotaTest::SetUp() { 208 void FileSystemQuotaTest::SetUp() {
209 ASSERT_TRUE(work_dir_.CreateUniqueTempDir()); 209 ASSERT_TRUE(work_dir_.CreateUniqueTempDir());
210 FilePath filesystem_dir_path = work_dir_.path().AppendASCII("filesystem"); 210 FilePath filesystem_dir_path = work_dir_.path().AppendASCII("filesystem");
211 file_util::CreateDirectory(filesystem_dir_path); 211 file_util::CreateDirectory(filesystem_dir_path);
212 212
213 quota_manager_ = new quota::QuotaManager( 213 quota_manager_ = new quota::QuotaManager(
214 false /* is_incognito */, 214 false /* is_incognito */,
215 filesystem_dir_path, 215 filesystem_dir_path,
216 base::MessageLoopProxy::CreateForCurrentThread(), 216 base::MessageLoopProxy::current(),
217 base::MessageLoopProxy::CreateForCurrentThread(), 217 base::MessageLoopProxy::current(),
218 NULL); 218 NULL);
219 219
220 test_helper_.SetUp(filesystem_dir_path, 220 test_helper_.SetUp(filesystem_dir_path,
221 false /* incognito */, 221 false /* incognito */,
222 false /* unlimited quota */, 222 false /* unlimited quota */,
223 quota_manager_->proxy(), 223 quota_manager_->proxy(),
224 local_file_util_.get()); 224 local_file_util_.get());
225 } 225 }
226 226
227 void FileSystemQuotaTest::TearDown() { 227 void FileSystemQuotaTest::TearDown() {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 } 377 }
378 378
379 void FileSystemObfuscatedQuotaTest::SetUp() { 379 void FileSystemObfuscatedQuotaTest::SetUp() {
380 ASSERT_TRUE(work_dir_.CreateUniqueTempDir()); 380 ASSERT_TRUE(work_dir_.CreateUniqueTempDir());
381 FilePath filesystem_dir_path = work_dir_.path().AppendASCII("filesystem"); 381 FilePath filesystem_dir_path = work_dir_.path().AppendASCII("filesystem");
382 file_util::CreateDirectory(filesystem_dir_path); 382 file_util::CreateDirectory(filesystem_dir_path);
383 383
384 quota_manager_ = new quota::QuotaManager( 384 quota_manager_ = new quota::QuotaManager(
385 false /* is_incognito */, 385 false /* is_incognito */,
386 filesystem_dir_path, 386 filesystem_dir_path,
387 base::MessageLoopProxy::CreateForCurrentThread(), 387 base::MessageLoopProxy::current(),
388 base::MessageLoopProxy::CreateForCurrentThread(), 388 base::MessageLoopProxy::current(),
389 NULL); 389 NULL);
390 390
391 file_system_context_ = new FileSystemContext( 391 file_system_context_ = new FileSystemContext(
392 base::MessageLoopProxy::CreateForCurrentThread(), 392 base::MessageLoopProxy::current(),
393 base::MessageLoopProxy::CreateForCurrentThread(), 393 base::MessageLoopProxy::current(),
394 new quota::MockSpecialStoragePolicy(), 394 new quota::MockSpecialStoragePolicy(),
395 quota_manager_->proxy(), 395 quota_manager_->proxy(),
396 filesystem_dir_path, 396 filesystem_dir_path,
397 false /* incognito */, 397 false /* incognito */,
398 true /* allow_file_access_from_files */, 398 true /* allow_file_access_from_files */,
399 false /* unlimitedquota */, 399 false /* unlimitedquota */,
400 NULL); 400 NULL);
401 401
402 test_helper_.SetUp(file_system_context_, 402 test_helper_.SetUp(file_system_context_,
403 NULL /* sandbox_provider's internal file_util */); 403 NULL /* sandbox_provider's internal file_util */);
(...skipping 22 matching lines...) Expand all
426 EXPECT_EQ(-1, SizeInUsageFile()); 426 EXPECT_EQ(-1, SizeInUsageFile());
427 427
428 GetUsageAndQuotaFromQuotaManager(); 428 GetUsageAndQuotaFromQuotaManager();
429 EXPECT_EQ(quota::kQuotaStatusOk, quota_status()); 429 EXPECT_EQ(quota::kQuotaStatusOk, quota_status());
430 EXPECT_EQ(all_file_size + file_path_cost(), SizeInUsageFile()); 430 EXPECT_EQ(all_file_size + file_path_cost(), SizeInUsageFile());
431 EXPECT_EQ(all_file_size + file_path_cost(), usage()); 431 EXPECT_EQ(all_file_size + file_path_cost(), usage());
432 ASSERT_LT(all_file_size, quota()); 432 ASSERT_LT(all_file_size, quota());
433 } 433 }
434 434
435 } // namespace fileapi 435 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_quota_client_unittest.cc ('k') | webkit/fileapi/file_system_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698