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

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

Issue 145303002: Convert Media Galleries to use base::File (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 3a07cbb87d32a85ee8822485990ae7e877a6f31b..58305eb8bdc857dcf210b24bbb5dc52a40a35b97 100644
--- a/content/browser/renderer_host/pepper/quota_reservation_unittest.cc
+++ b/content/browser/renderer_host/pepper/quota_reservation_unittest.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/file_util.h"
+#include "base/files/file.h"
#include "base/files/scoped_temp_dir.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
@@ -42,7 +43,7 @@ class FakeBackend : public QuotaReservationManager::QuotaBackend {
const QuotaReservationManager::ReserveQuotaCallback& callback) OVERRIDE {
base::MessageLoopProxy::current()->PostTask(
FROM_HERE,
- base::Bind(base::IgnoreResult(callback), base::PLATFORM_FILE_OK));
+ base::Bind(base::IgnoreResult(callback), base::File::FILE_OK));
}
virtual void ReleaseReservedQuota(const GURL& origin,
@@ -103,15 +104,10 @@ class QuotaReservationTest : public testing::Test {
}
void SetFileSize(const base::FilePath::StringType& file_name, int64 size) {
- bool created = false;
- base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED;
- base::PlatformFile file = CreatePlatformFile(
- MakeFilePath(file_name),
- base::PLATFORM_FILE_OPEN_ALWAYS | base::PLATFORM_FILE_WRITE,
- &created, &error);
- ASSERT_EQ(base::PLATFORM_FILE_OK, error);
- ASSERT_TRUE(base::TruncatePlatformFile(file, size));
- ASSERT_TRUE(base::ClosePlatformFile(file));
+ base::File file(MakeFilePath(file_name),
+ base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_WRITE);
+ ASSERT_TRUE(file.IsValid());
+ ASSERT_TRUE(file.SetLength(size));
}
QuotaReservationManager* reservation_manager() {
« no previous file with comments | « content/browser/renderer_host/pepper/quota_reservation.cc ('k') | content/child/fileapi/file_system_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698