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

Unified Diff: components/nacl/browser/pnacl_host_unittest.cc

Issue 307173002: Remove PlatformFile from components/nacl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update NexeFdCallback definition Created 6 years, 7 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
« no previous file with comments | « components/nacl/browser/pnacl_host.cc ('k') | components/nacl/renderer/file_downloader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/browser/pnacl_host_unittest.cc
diff --git a/components/nacl/browser/pnacl_host_unittest.cc b/components/nacl/browser/pnacl_host_unittest.cc
index 76475148a53f099e5c5b3050dc2c3815753cd915..9bfd5ed81ea97e2b70f11e86d4a71945fe6bfbc7 100644
--- a/components/nacl/browser/pnacl_host_unittest.cc
+++ b/components/nacl/browser/pnacl_host_unittest.cc
@@ -67,24 +67,26 @@ class PnaclHostTest : public testing::Test {
// CallbackExpectMiss checks that the fd is valid and a miss is reported,
// and also writes some data into the file, which is read back by
// CallbackExpectHit
- void CallbackExpectMiss(base::PlatformFile fd, bool is_hit) {
+ void CallbackExpectMiss(const base::File& file, bool is_hit) {
EXPECT_FALSE(is_hit);
- ASSERT_FALSE(fd == base::kInvalidPlatformFileValue);
- base::PlatformFileInfo info;
- EXPECT_TRUE(base::GetPlatformFileInfo(fd, &info));
+ ASSERT_TRUE(file.IsValid());
+ base::File::Info info;
+ base::File* mutable_file = const_cast<base::File*>(&file);
+ EXPECT_TRUE(mutable_file->GetInfo(&info));
EXPECT_FALSE(info.is_directory);
EXPECT_EQ(0LL, info.size);
char str[16];
memset(str, 0x0, 16);
snprintf(str, 16, "testdata%d", ++write_callback_count_);
- EXPECT_EQ(16, base::WritePlatformFile(fd, 0, str, 16));
+ EXPECT_EQ(16, mutable_file->Write(0, str, 16));
temp_callback_count_++;
}
- void CallbackExpectHit(base::PlatformFile fd, bool is_hit) {
+ void CallbackExpectHit(const base::File& file, bool is_hit) {
EXPECT_TRUE(is_hit);
- ASSERT_FALSE(fd == base::kInvalidPlatformFileValue);
- base::PlatformFileInfo info;
- EXPECT_TRUE(base::GetPlatformFileInfo(fd, &info));
+ ASSERT_TRUE(file.IsValid());
+ base::File::Info info;
+ base::File* mutable_file = const_cast<base::File*>(&file);
+ EXPECT_TRUE(mutable_file->GetInfo(&info));
EXPECT_FALSE(info.is_directory);
EXPECT_EQ(16LL, info.size);
char data[16];
@@ -92,7 +94,7 @@ class PnaclHostTest : public testing::Test {
char str[16];
memset(str, 0x0, 16);
snprintf(str, 16, "testdata%d", write_callback_count_);
- EXPECT_EQ(16, base::ReadPlatformFile(fd, 0, data, 16));
+ EXPECT_EQ(16, mutable_file->Read(0, data, 16));
EXPECT_STREQ(str, data);
temp_callback_count_++;
}
« no previous file with comments | « components/nacl/browser/pnacl_host.cc ('k') | components/nacl/renderer/file_downloader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698