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

Side by Side Diff: content/browser/file_descriptor_info_impl_unittest.cc

Issue 2594203004: Unifying ChildProcessLauncher across platforms. (Closed)
Patch Set: Clean-up. Created 3 years, 11 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
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/browser/file_descriptor_info_impl.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698