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

Unified Diff: services/files/file_impl_unittest.cc

Issue 1055403002: Add an Ioctl() message to the File interface. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 9 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 | « services/files/file_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/files/file_impl_unittest.cc
diff --git a/services/files/file_impl_unittest.cc b/services/files/file_impl_unittest.cc
index ebd7a471ce78b4d7f1986b0af2671e9b84bee8d4..dd7fc236540873934cd170746abd48a2fdffa2b3 100644
--- a/services/files/file_impl_unittest.cc
+++ b/services/files/file_impl_unittest.cc
@@ -386,6 +386,28 @@ TEST_F(FileImplTest, Truncate) {
EXPECT_EQ(kTruncatedSize, file_info->size);
}
+TEST_F(FileImplTest, Ioctl) {
+ DirectoryPtr directory;
+ GetTemporaryRoot(&directory);
+ Error error;
+
+ // Create my_file.
+ FilePtr file;
+ error = ERROR_INTERNAL;
+ directory->OpenFile("my_file", GetProxy(&file),
+ kOpenFlagRead | kOpenFlagWrite | kOpenFlagCreate,
+ Capture(&error));
+ ASSERT_TRUE(directory.WaitForIncomingMethodCall());
+ EXPECT_EQ(ERROR_OK, error);
+
+ // Normal files don't support any ioctls.
+ Array<uint32_t> out_values;
+ file->Ioctl(0, Array<uint32_t>(), Capture(&error, &out_values));
+ ASSERT_TRUE(file.WaitForIncomingMethodCall());
+ EXPECT_EQ(ERROR_UNAVAILABLE, error);
+ EXPECT_TRUE(out_values.is_null());
+}
+
} // namespace
} // namespace files
} // namespace mojo
« no previous file with comments | « services/files/file_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698