| 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 "files/public/c/lib/file_fd_impl.h" | 5 #include "files/c/lib/file_fd_impl.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "files/public/c/mojio_sys_stat.h" | 11 #include "files/c/mojio_sys_stat.h" |
| 12 #include "files/public/c/mojio_unistd.h" | 12 #include "files/c/mojio_unistd.h" |
| 13 #include "files/public/c/tests/mock_errno_impl.h" | 13 #include "files/c/tests/mock_errno_impl.h" |
| 14 #include "files/public/c/tests/mojio_impl_test_base.h" | 14 #include "files/c/tests/mojio_impl_test_base.h" |
| 15 #include "files/public/c/tests/test_utils.h" | 15 #include "files/c/tests/test_utils.h" |
| 16 #include "files/public/interfaces/files.mojom.h" | 16 #include "files/interfaces/files.mojom.h" |
| 17 #include "files/public/interfaces/types.mojom.h" | 17 #include "files/interfaces/types.mojom.h" |
| 18 | 18 |
| 19 namespace mojio { | 19 namespace mojio { |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 using FileFDImplTest = mojio::test::MojioImplTestBase; | 22 using FileFDImplTest = mojio::test::MojioImplTestBase; |
| 23 | 23 |
| 24 const int kLastErrorSentinel = -12345; | 24 const int kLastErrorSentinel = -12345; |
| 25 | 25 |
| 26 TEST_F(FileFDImplTest, ConstructClose) { | 26 TEST_F(FileFDImplTest, ConstructClose) { |
| 27 test::MockErrnoImpl errno_impl(kLastErrorSentinel); | 27 test::MockErrnoImpl errno_impl(kLastErrorSentinel); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 EXPECT_EQ(-1, ffdi.Write(nullptr, 1)); | 273 EXPECT_EQ(-1, ffdi.Write(nullptr, 1)); |
| 274 EXPECT_EQ(EFAULT, errno_impl.Get()); | 274 EXPECT_EQ(EFAULT, errno_impl.Get()); |
| 275 | 275 |
| 276 errno_impl.Reset(kLastErrorSentinel); | 276 errno_impl.Reset(kLastErrorSentinel); |
| 277 EXPECT_FALSE(ffdi.Fstat(nullptr)); | 277 EXPECT_FALSE(ffdi.Fstat(nullptr)); |
| 278 EXPECT_EQ(EFAULT, errno_impl.Get()); | 278 EXPECT_EQ(EFAULT, errno_impl.Get()); |
| 279 } | 279 } |
| 280 | 280 |
| 281 } // namespace | 281 } // namespace |
| 282 } // namespace mojio | 282 } // namespace mojio |
| OLD | NEW |