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

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

Issue 341043008: Add FileSystemID parameter to IsolatedContext::RegisterFileSystemForPath. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 29 matching lines...) Expand all
40 40
41 void CreateAndRegisterTemporaryFile( 41 void CreateAndRegisterTemporaryFile(
42 FileSystemURL* file_url, 42 FileSystemURL* file_url,
43 base::FilePath* file_path) { 43 base::FilePath* file_path) {
44 EXPECT_TRUE(base::CreateTemporaryFileInDir(data_dir_.path(), file_path)); 44 EXPECT_TRUE(base::CreateTemporaryFileInDir(data_dir_.path(), file_path));
45 fileapi::IsolatedContext* isolated_context = 45 fileapi::IsolatedContext* isolated_context =
46 fileapi::IsolatedContext::GetInstance(); 46 fileapi::IsolatedContext::GetInstance();
47 std::string name = "tmp"; 47 std::string name = "tmp";
48 std::string fsid = isolated_context->RegisterFileSystemForPath( 48 std::string fsid = isolated_context->RegisterFileSystemForPath(
49 fileapi::kFileSystemTypeForTransientFile, 49 fileapi::kFileSystemTypeForTransientFile,
50 std::string(),
50 *file_path, 51 *file_path,
51 &name); 52 &name);
52 ASSERT_TRUE(!fsid.empty()); 53 ASSERT_TRUE(!fsid.empty());
53 base::FilePath virtual_path = isolated_context->CreateVirtualRootPath( 54 base::FilePath virtual_path = isolated_context->CreateVirtualRootPath(
54 fsid).AppendASCII(name); 55 fsid).AppendASCII(name);
55 *file_url = file_system_context_->CreateCrackedFileSystemURL( 56 *file_url = file_system_context_->CreateCrackedFileSystemURL(
56 GURL("http://foo"), 57 GURL("http://foo"),
57 fileapi::kFileSystemTypeIsolated, 58 fileapi::kFileSystemTypeIsolated,
58 virtual_path); 59 virtual_path);
59 } 60 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 base::RunLoop().RunUntilIdle(); 117 base::RunLoop().RunUntilIdle();
117 118
118 // Now the temporary file and the transient filesystem must be gone too. 119 // Now the temporary file and the transient filesystem must be gone too.
119 ASSERT_FALSE(base::PathExists(temp_path)); 120 ASSERT_FALSE(base::PathExists(temp_path));
120 ASSERT_EQ(base::File::FILE_ERROR_NOT_FOUND, 121 ASSERT_EQ(base::File::FILE_ERROR_NOT_FOUND,
121 file_util()->GetFileInfo(NewOperationContext().get(), 122 file_util()->GetFileInfo(NewOperationContext().get(),
122 temp_url, &file_info, &path)); 123 temp_url, &file_info, &path));
123 } 124 }
124 125
125 } // namespace content 126 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/fileapi/isolated_context_unittest.cc ('k') | content/browser/renderer_host/render_view_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698