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

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

Issue 11787028: New FileSystemURL cracking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test on Win Created 7 years, 11 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 return file_system_context_->GetMountPointProvider(type); 229 return file_system_context_->GetMountPointProvider(type);
230 } 230 }
231 231
232 bool GetRootPath(const GURL& origin_url, 232 bool GetRootPath(const GURL& origin_url,
233 fileapi::FileSystemType type, 233 fileapi::FileSystemType type,
234 bool create, 234 bool create,
235 FilePath* root_path) { 235 FilePath* root_path) {
236 FilePath virtual_path = FilePath(); 236 FilePath virtual_path = FilePath();
237 if (type == kFileSystemTypeExternal) 237 if (type == kFileSystemTypeExternal)
238 virtual_path = FilePath(kVirtualPath); 238 virtual_path = FilePath(kVirtualPath);
239 FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL(
240 origin_url, type, virtual_path);
239 FilePath returned_root_path = 241 FilePath returned_root_path =
240 provider(type)->GetFileSystemRootPathOnFileThread( 242 provider(type)->GetFileSystemRootPathOnFileThread(url, create);
241 FileSystemURL(origin_url, type, virtual_path), create);
242 if (root_path) 243 if (root_path)
243 *root_path = returned_root_path; 244 *root_path = returned_root_path;
244 return !returned_root_path.empty(); 245 return !returned_root_path.empty();
245 } 246 }
246 247
247 FilePath data_path() const { return data_dir_.path(); } 248 FilePath data_path() const { return data_dir_.path(); }
248 FilePath file_system_path() const { 249 FilePath file_system_path() const {
249 return data_dir_.path().Append( 250 return data_dir_.path().Append(
250 SandboxMountPointProvider::kFileSystemDirectory); 251 SandboxMountPointProvider::kFileSystemDirectory);
251 } 252 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 FilePath virtual_unused; 407 FilePath virtual_unused;
407 EXPECT_TRUE(external_provider->GetVirtualPath(FilePath(kMountPoint), 408 EXPECT_TRUE(external_provider->GetVirtualPath(FilePath(kMountPoint),
408 &virtual_unused)); 409 &virtual_unused));
409 external_provider->RemoveMountPoint(FilePath(kMountPoint)); 410 external_provider->RemoveMountPoint(FilePath(kMountPoint));
410 EXPECT_FALSE(external_provider->GetVirtualPath(FilePath(kMountPoint), 411 EXPECT_FALSE(external_provider->GetVirtualPath(FilePath(kMountPoint),
411 &virtual_unused)); 412 &virtual_unused));
412 } 413 }
413 #endif 414 #endif
414 415
415 } // namespace fileapi 416 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_file_stream_reader_unittest.cc ('k') | webkit/fileapi/file_system_quota_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698