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

Side by Side 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, 8 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 unified diff | Download patch
« no previous file with comments | « services/files/file_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <vector> 5 #include <vector>
6 6
7 #include "mojo/public/cpp/bindings/interface_request.h" 7 #include "mojo/public/cpp/bindings/interface_request.h"
8 #include "mojo/public/cpp/bindings/type_converter.h" 8 #include "mojo/public/cpp/bindings/type_converter.h"
9 #include "services/files/files_test_base.h" 9 #include "services/files/files_test_base.h"
10 10
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 // Stat again. 379 // Stat again.
380 error = ERROR_INTERNAL; 380 error = ERROR_INTERNAL;
381 file_info.reset(); 381 file_info.reset();
382 file->Stat(Capture(&error, &file_info)); 382 file->Stat(Capture(&error, &file_info));
383 ASSERT_TRUE(file.WaitForIncomingMethodCall()); 383 ASSERT_TRUE(file.WaitForIncomingMethodCall());
384 EXPECT_EQ(ERROR_OK, error); 384 EXPECT_EQ(ERROR_OK, error);
385 ASSERT_FALSE(file_info.is_null()); 385 ASSERT_FALSE(file_info.is_null());
386 EXPECT_EQ(kTruncatedSize, file_info->size); 386 EXPECT_EQ(kTruncatedSize, file_info->size);
387 } 387 }
388 388
389 TEST_F(FileImplTest, Ioctl) {
390 DirectoryPtr directory;
391 GetTemporaryRoot(&directory);
392 Error error;
393
394 // Create my_file.
395 FilePtr file;
396 error = ERROR_INTERNAL;
397 directory->OpenFile("my_file", GetProxy(&file),
398 kOpenFlagRead | kOpenFlagWrite | kOpenFlagCreate,
399 Capture(&error));
400 ASSERT_TRUE(directory.WaitForIncomingMethodCall());
401 EXPECT_EQ(ERROR_OK, error);
402
403 // Normal files don't support any ioctls.
404 Array<uint32_t> out_values;
405 file->Ioctl(0, Array<uint32_t>(), Capture(&error, &out_values));
406 ASSERT_TRUE(file.WaitForIncomingMethodCall());
407 EXPECT_EQ(ERROR_UNAVAILABLE, error);
408 EXPECT_TRUE(out_values.is_null());
409 }
410
389 } // namespace 411 } // namespace
390 } // namespace files 412 } // namespace files
391 } // namespace mojo 413 } // namespace mojo
OLDNEW
« 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