| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| 11 #include "components/filesystem/files_test_base.h" | 11 #include "components/filesystem/files_test_base.h" |
| 12 #include "mojo/public/cpp/bindings/interface_request.h" | 12 #include "mojo/public/cpp/bindings/interface_request.h" |
| 13 #include "mojo/public/cpp/bindings/type_converter.h" | 13 #include "mojo/public/cpp/bindings/type_converter.h" |
| 14 #include "mojo/public/cpp/system/platform_handle.h" | 14 #include "mojo/public/cpp/system/platform_handle.h" |
| 15 #include "mojo/util/capture_util.h" | |
| 16 | |
| 17 using mojo::Capture; | |
| 18 | 15 |
| 19 namespace filesystem { | 16 namespace filesystem { |
| 20 namespace { | 17 namespace { |
| 21 | 18 |
| 22 using FileImplTest = FilesTestBase; | 19 using FileImplTest = FilesTestBase; |
| 23 | 20 |
| 24 TEST_F(FileImplTest, CreateWriteCloseRenameOpenRead) { | 21 TEST_F(FileImplTest, CreateWriteCloseRenameOpenRead) { |
| 25 mojom::DirectoryPtr directory; | 22 mojom::DirectoryPtr directory; |
| 26 GetTemporaryRoot(&directory); | 23 GetTemporaryRoot(&directory); |
| 27 mojom::FileError error; | 24 mojom::FileError error; |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 // The file shouldn't be locked (and we check by trying to lock it). | 793 // The file shouldn't be locked (and we check by trying to lock it). |
| 797 error = mojom::FileError::FAILED; | 794 error = mojom::FileError::FAILED; |
| 798 file->Lock(Capture(&error)); | 795 file->Lock(Capture(&error)); |
| 799 ASSERT_TRUE(file.WaitForIncomingResponse()); | 796 ASSERT_TRUE(file.WaitForIncomingResponse()); |
| 800 EXPECT_EQ(mojom::FileError::OK, error); | 797 EXPECT_EQ(mojom::FileError::OK, error); |
| 801 } | 798 } |
| 802 } | 799 } |
| 803 | 800 |
| 804 } // namespace | 801 } // namespace |
| 805 } // namespace filesystem | 802 } // namespace filesystem |
| OLD | NEW |