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

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

Issue 11787028: New FileSystemURL cracking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 FilePath GetTestCaseLocalPath(const FilePath& path) { 107 FilePath GetTestCaseLocalPath(const FilePath& path) {
108 FilePath relative; 108 FilePath relative;
109 if (data_dir_.path().AppendRelativePath(path, &relative)) 109 if (data_dir_.path().AppendRelativePath(path, &relative))
110 return relative; 110 return relative;
111 return path; 111 return path;
112 } 112 }
113 113
114 FileSystemURL GetFileSystemURL(const FilePath& path) const { 114 FileSystemURL GetFileSystemURL(const FilePath& path) const {
115 FilePath virtual_path = isolated_context()->CreateVirtualRootPath( 115 FilePath virtual_path = isolated_context()->CreateVirtualRootPath(
116 filesystem_id()).Append(path); 116 filesystem_id()).Append(path);
117 return FileSystemURL(GURL("http://example.com"), 117 return file_system_context_->CreateCrackedFileSystemURL(
118 kFileSystemTypeIsolated, 118 GURL("http://example.com"),
119 virtual_path); 119 kFileSystemTypeIsolated,
120 virtual_path);
120 } 121 }
121 122
122 FileSystemURL GetOtherFileSystemURL(const FilePath& path) { 123 FileSystemURL GetOtherFileSystemURL(const FilePath& path) {
123 return other_file_util_helper_.CreateURL(GetTestCaseLocalPath(path)); 124 return other_file_util_helper_.CreateURL(GetTestCaseLocalPath(path));
124 } 125 }
125 126
126 void VerifyFilesHaveSameContent(FileSystemFileUtil* file_util1, 127 void VerifyFilesHaveSameContent(FileSystemFileUtil* file_util1,
127 FileSystemFileUtil* file_util2, 128 FileSystemFileUtil* file_util2,
128 const FileSystemURL& url1, 129 const FileSystemURL& url1,
129 const FileSystemURL& url2) { 130 const FileSystemURL& url2) {
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 EXPECT_EQ(base::PLATFORM_FILE_OK, 508 EXPECT_EQ(base::PLATFORM_FILE_OK,
508 file_util()->Truncate(GetOperationContext().get(), url, 999)); 509 file_util()->Truncate(GetOperationContext().get(), url, 999));
509 ASSERT_EQ(base::PLATFORM_FILE_OK, 510 ASSERT_EQ(base::PLATFORM_FILE_OK,
510 file_util()->GetFileInfo(GetOperationContext().get(), url, 511 file_util()->GetFileInfo(GetOperationContext().get(), url,
511 &info, &platform_path)); 512 &info, &platform_path));
512 EXPECT_EQ(999, info.size); 513 EXPECT_EQ(999, info.size);
513 } 514 }
514 } 515 }
515 516
516 } // namespace fileapi 517 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698