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

Unified Diff: media/base/media_file_checker_unittest.cc

Issue 109273002: Convert base::MemoryMappedFile to use File instead of PlatformFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Posix GetSize Created 7 years 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: media/base/media_file_checker_unittest.cc
diff --git a/media/base/media_file_checker_unittest.cc b/media/base/media_file_checker_unittest.cc
index ec61edf3e6445c750fcb370b6cadc0779cd5d66a..001fe04694ce1c7b26fe151a46ad102389d41290 100644
--- a/media/base/media_file_checker_unittest.cc
+++ b/media/base/media_file_checker_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/files/file.h"
#include "base/logging.h"
#include "build/build_config.h"
#include "media/base/media_file_checker.h"
@@ -11,20 +12,14 @@
namespace media {
static void RunMediaFileChecker(const std::string& filename, bool expectation) {
- base::PlatformFileError error;
- base::PlatformFile file = base::CreatePlatformFile(
- GetTestDataFilePath(filename),
- base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ,
- NULL,
- &error);
- ASSERT_EQ(base::PLATFORM_FILE_OK, error);
-
- MediaFileChecker checker(file);
+ base::File file(GetTestDataFilePath(filename),
+ base::File::FLAG_OPEN | base::File::FLAG_READ);
+ ASSERT_TRUE(file.IsValid());
+
+ MediaFileChecker checker(file.Pass());
const base::TimeDelta check_time = base::TimeDelta::FromMilliseconds(100);
bool result = checker.Start(check_time);
EXPECT_EQ(expectation, result);
-
- base::ClosePlatformFile(file);
}
TEST(MediaFileCheckerTest, InvalidFile) {

Powered by Google App Engine
This is Rietveld 408576698