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

Side by Side Diff: sandbox/win/src/handle_inheritance_test.cc

Issue 1422773008: Fixing remaining VC++ 2015 64-bit build breaks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to latest Created 5 years, 1 month 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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 return; 75 return;
76 76
77 base::SharedMemory test_shared_memory; 77 base::SharedMemory test_shared_memory;
78 ASSERT_TRUE(test_shared_memory.CreateAnonymous(1000)); 78 ASSERT_TRUE(test_shared_memory.CreateAnonymous(1000));
79 ASSERT_TRUE(test_shared_memory.Map(0)); 79 ASSERT_TRUE(test_shared_memory.Map(0));
80 80
81 TestRunner runner; 81 TestRunner runner;
82 void* shared_handle = runner.GetPolicy()->AddHandleToShare( 82 void* shared_handle = runner.GetPolicy()->AddHandleToShare(
83 test_shared_memory.handle().GetHandle()); 83 test_shared_memory.handle().GetHandle());
84 84
85 std::string command_line = 85 std::string command_line = "HandleInheritanceTests_ValidInheritedHandle " +
86 "HandleInheritanceTests_ValidInheritedHandle " + 86 // Cast through uintptr_t and then unsigned int to
87 base::UintToString(reinterpret_cast<unsigned int>(shared_handle)); 87 // make the truncation explicit. Handles are size
88 // of-pointer but are always 32-bit values.
89 base::UintToString(static_cast<unsigned int>(
90 reinterpret_cast<uintptr_t>(shared_handle)));
88 int result = runner.RunTest(base::UTF8ToUTF16(command_line).c_str()); 91 int result = runner.RunTest(base::UTF8ToUTF16(command_line).c_str());
89 ASSERT_EQ(SBOX_TEST_SUCCEEDED, result); 92 ASSERT_EQ(SBOX_TEST_SUCCEEDED, result);
90 } 93 }
91 94
92 } // namespace sandbox 95 } // namespace sandbox
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698