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

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: 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 <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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 FilePath GetTestCaseLocalPath(const FilePath& path) { 118 FilePath GetTestCaseLocalPath(const FilePath& path) {
119 FilePath relative; 119 FilePath relative;
120 if (data_dir_.path().AppendRelativePath(path, &relative)) 120 if (data_dir_.path().AppendRelativePath(path, &relative))
121 return relative; 121 return relative;
122 return path; 122 return path;
123 } 123 }
124 124
125 FileSystemURL GetFileSystemURL(const FilePath& path) const { 125 FileSystemURL GetFileSystemURL(const FilePath& path) const {
126 FilePath virtual_path = isolated_context()->CreateVirtualRootPath( 126 FilePath virtual_path = isolated_context()->CreateVirtualRootPath(
127 filesystem_id()).Append(path); 127 filesystem_id()).Append(path);
128 return FileSystemURL(GURL("http://example.com"), 128 return file_system_context_->CreateCrackedFileSystemURL(
129 kFileSystemTypeIsolated, 129 GURL("http://example.com"),
130 virtual_path); 130 kFileSystemTypeIsolated,
131 virtual_path);
131 } 132 }
132 133
133 FileSystemURL GetOtherFileSystemURL(const FilePath& path) { 134 FileSystemURL GetOtherFileSystemURL(const FilePath& path) {
134 return other_file_util_helper_.CreateURL(GetTestCaseLocalPath(path)); 135 return other_file_util_helper_.CreateURL(GetTestCaseLocalPath(path));
135 } 136 }
136 137
137 void VerifyFilesHaveSameContent(FileSystemFileUtil* file_util1, 138 void VerifyFilesHaveSameContent(FileSystemFileUtil* file_util1,
138 FileSystemFileUtil* file_util2, 139 FileSystemFileUtil* file_util2,
139 const FileSystemURL& url1, 140 const FileSystemURL& url1,
140 const FileSystemURL& url2) { 141 const FileSystemURL& url2) {
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 EXPECT_EQ(base::PLATFORM_FILE_OK, 519 EXPECT_EQ(base::PLATFORM_FILE_OK,
519 file_util()->Truncate(GetOperationContext().get(), url, 999)); 520 file_util()->Truncate(GetOperationContext().get(), url, 999));
520 ASSERT_EQ(base::PLATFORM_FILE_OK, 521 ASSERT_EQ(base::PLATFORM_FILE_OK,
521 file_util()->GetFileInfo(GetOperationContext().get(), url, 522 file_util()->GetFileInfo(GetOperationContext().get(), url,
522 &info, &platform_path)); 523 &info, &platform_path));
523 EXPECT_EQ(999, info.size); 524 EXPECT_EQ(999, info.size);
524 } 525 }
525 } 526 }
526 527
527 } // namespace fileapi 528 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/isolated_context_unittest.cc ('k') | webkit/fileapi/local_file_system_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698