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

Unified Diff: content/browser/renderer_host/pepper/quota_reservation_unittest.cc

Issue 131043002: [Pepper] Use platform path for QuotaReservation::GetOpenFileHandle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: suppress DCHECK failure Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/pepper/quota_reservation_unittest.cc
diff --git a/content/browser/renderer_host/pepper/quota_reservation_unittest.cc b/content/browser/renderer_host/pepper/quota_reservation_unittest.cc
index a9a5f71008156d3efb27ebe7f1214e79c57717ba..3f760e5566428abc531ff58305ebaf94eebb5869 100644
--- a/content/browser/renderer_host/pepper/quota_reservation_unittest.cc
+++ b/content/browser/renderer_host/pepper/quota_reservation_unittest.cc
@@ -82,10 +82,16 @@ class QuotaReservationTest : public testing::Test {
reservation_manager_.reset();
}
- base::FilePath MakeFilePath(base::FilePath::StringType file_name) {
+ base::FilePath MakeFilePath(const base::FilePath::StringType& file_name) {
return work_dir_.path().Append(file_name);
}
+ fileapi::FileSystemURL MakeFileSystemURL(
+ const base::FilePath::StringType& file_name) {
+ return fileapi::FileSystemURL::CreateForTest(
+ GURL(kOrigin), kType, MakeFilePath(file_name));
+ }
+
scoped_refptr<QuotaReservation> CreateQuotaReservation(
scoped_refptr<fileapi::QuotaReservation> reservation,
const GURL& origin,
@@ -164,7 +170,8 @@ TEST_F(QuotaReservationTest, DISABLED_ReserveQuota) {
// Open a file, refresh the reservation, extend the file, and close it.
int64 file_size = 10;
SetFileSize(file1_name, file_size);
- int64 open_file_size = test->OpenFile(kFile1ID, MakeFilePath(file1_name));
+ int64 open_file_size = test->OpenFile(kFile1ID,
+ MakeFileSystemURL(file1_name));
EXPECT_EQ(file_size, open_file_size);
max_written_offsets[kFile1ID] = file_size; // 1 file open.
@@ -196,15 +203,18 @@ TEST_F(QuotaReservationTest, DISABLED_MultipleFiles) {
// Open some files of different sizes.
int64 file1_size = 10;
SetFileSize(file1_name, file1_size);
- int64 open_file1_size = test->OpenFile(kFile1ID, MakeFilePath(file1_name));
+ int64 open_file1_size = test->OpenFile(kFile1ID,
+ MakeFileSystemURL(file1_name));
EXPECT_EQ(file1_size, open_file1_size);
int64 file2_size = 20;
SetFileSize(file2_name, file2_size);
- int64 open_file2_size = test->OpenFile(kFile2ID, MakeFilePath(file2_name));
+ int64 open_file2_size = test->OpenFile(kFile2ID,
+ MakeFileSystemURL(file2_name));
EXPECT_EQ(file2_size, open_file2_size);
int64 file3_size = 30;
SetFileSize(file3_name, file3_size);
- int64 open_file3_size = test->OpenFile(kFile3ID, MakeFilePath(file3_name));
+ int64 open_file3_size = test->OpenFile(kFile3ID,
+ MakeFileSystemURL(file3_name));
EXPECT_EQ(file3_size, open_file3_size);
// Reserve quota.
« no previous file with comments | « content/browser/renderer_host/pepper/quota_reservation.cc ('k') | webkit/browser/fileapi/quota/quota_reservation_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698