| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/file_descriptor_info_impl.h" | 5 #include "content/browser/file_descriptor_info_impl.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <unistd.h> | 8 #include <unistd.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } | 70 } |
| 71 | 71 |
| 72 TEST_F(FileDescriptorInfoTest, GetMappingWithIDAdjustment) { | 72 TEST_F(FileDescriptorInfoTest, GetMappingWithIDAdjustment) { |
| 73 int testingId1 = 42; | 73 int testingId1 = 42; |
| 74 int testingId2 = 43; | 74 int testingId2 = 43; |
| 75 std::unique_ptr<FileDescriptorInfo> target(FileDescriptorInfoImpl::Create()); | 75 std::unique_ptr<FileDescriptorInfo> target(FileDescriptorInfoImpl::Create()); |
| 76 | 76 |
| 77 target->Transfer(testingId1, base::ScopedFD(GetSafeFd())); | 77 target->Transfer(testingId1, base::ScopedFD(GetSafeFd())); |
| 78 target->Transfer(testingId2, base::ScopedFD(GetSafeFd())); | 78 target->Transfer(testingId2, base::ScopedFD(GetSafeFd())); |
| 79 | 79 |
| 80 base::FileHandleMappingVector mapping = | 80 std::unique_ptr<base::FileHandleMappingVector> mapping = |
| 81 target->GetMappingWithIDAdjustment(100); | 81 target->GetMappingWithIDAdjustment(100); |
| 82 ASSERT_EQ(mapping[0].second, 142); | 82 ASSERT_EQ((*mapping)[0].second, 142); |
| 83 ASSERT_EQ(mapping[1].second, 143); | 83 ASSERT_EQ((*mapping)[1].second, 143); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace content | 86 } // namespace content |
| OLD | NEW |