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

Side by Side Diff: content/browser/fileapi/obfuscated_file_util_unittest.cc

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <string> 6 #include <string>
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 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after
2400 SandboxIsolatedOriginDatabase database_old( 2400 SandboxIsolatedOriginDatabase database_old(
2401 origin_string, data_dir_path(), 2401 origin_string, data_dir_path(),
2402 base::FilePath( 2402 base::FilePath(
2403 SandboxIsolatedOriginDatabase::kObsoleteOriginDirectory)); 2403 SandboxIsolatedOriginDatabase::kObsoleteOriginDirectory));
2404 base::FilePath path; 2404 base::FilePath path;
2405 EXPECT_TRUE(database_old.GetPathForOrigin(origin_string, &path)); 2405 EXPECT_TRUE(database_old.GetPathForOrigin(origin_string, &path));
2406 EXPECT_FALSE(path.empty()); 2406 EXPECT_FALSE(path.empty());
2407 2407
2408 // Populate the origin directory with some fake data. 2408 // Populate the origin directory with some fake data.
2409 old_directory_db_path = data_dir_path().Append(path); 2409 old_directory_db_path = data_dir_path().Append(path);
2410 ASSERT_TRUE(file_util::CreateDirectory(old_directory_db_path)); 2410 ASSERT_TRUE(base::CreateDirectory(old_directory_db_path));
2411 EXPECT_EQ(static_cast<int>(kFakeDirectoryData.size()), 2411 EXPECT_EQ(static_cast<int>(kFakeDirectoryData.size()),
2412 file_util::WriteFile(old_directory_db_path.AppendASCII("dummy"), 2412 file_util::WriteFile(old_directory_db_path.AppendASCII("dummy"),
2413 kFakeDirectoryData.data(), 2413 kFakeDirectoryData.data(),
2414 kFakeDirectoryData.size())); 2414 kFakeDirectoryData.size()));
2415 } 2415 }
2416 2416
2417 storage_policy_->AddIsolated(origin_); 2417 storage_policy_->AddIsolated(origin_);
2418 scoped_ptr<ObfuscatedFileUtil> file_util( 2418 scoped_ptr<ObfuscatedFileUtil> file_util(
2419 ObfuscatedFileUtil::CreateForTesting( 2419 ObfuscatedFileUtil::CreateForTesting(
2420 storage_policy_.get(), data_dir_path(), 2420 storage_policy_.get(), data_dir_path(),
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
2481 false /* exclusive */, 2481 false /* exclusive */,
2482 true /* recursive */)); 2482 true /* recursive */));
2483 ASSERT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, 2483 ASSERT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY,
2484 ofu()->CreateDirectory(UnlimitedContext().get(), 2484 ofu()->CreateDirectory(UnlimitedContext().get(),
2485 path_in_file_in_file, 2485 path_in_file_in_file,
2486 false /* exclusive */, 2486 false /* exclusive */,
2487 true /* recursive */)); 2487 true /* recursive */));
2488 } 2488 }
2489 2489
2490 } // namespace fileapi 2490 } // namespace fileapi
OLDNEW
« no previous file with comments | « content/browser/download/save_package.cc ('k') | content/browser/indexed_db/indexed_db_backing_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698