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 | 7 |
8 #include <cstdlib> | 8 #include <cstdlib> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 264 } |
265 | 265 |
266 // Loads the other library, which defines a function to be called in the | 266 // Loads the other library, which defines a function to be called in the |
267 // WITH_OTHER_LIBRARY configuration. | 267 // WITH_OTHER_LIBRARY configuration. |
268 NativeLibrary LoadOtherLibrary() { | 268 NativeLibrary LoadOtherLibrary() { |
269 // The lambda gymnastics works around the fact that we can't use ASSERT_* | 269 // The lambda gymnastics works around the fact that we can't use ASSERT_* |
270 // macros in a function returning non-null. | 270 // macros in a function returning non-null. |
271 const auto load = [](NativeLibrary* library) { | 271 const auto load = [](NativeLibrary* library) { |
272 FilePath other_library_path; | 272 FilePath other_library_path; |
273 ASSERT_TRUE(PathService::Get(DIR_EXE, &other_library_path)); | 273 ASSERT_TRUE(PathService::Get(DIR_EXE, &other_library_path)); |
274 other_library_path = other_library_path.Append(FilePath::FromUTF16Unsafe( | 274 other_library_path = other_library_path.AppendASCII( |
275 GetNativeLibraryName(ASCIIToUTF16( | 275 GetNativeLibraryName("base_profiler_test_support_library")); |
276 "base_profiler_test_support_library")))); | |
277 NativeLibraryLoadError load_error; | 276 NativeLibraryLoadError load_error; |
278 *library = LoadNativeLibrary(other_library_path, &load_error); | 277 *library = LoadNativeLibrary(other_library_path, &load_error); |
279 ASSERT_TRUE(*library) << "error loading " << other_library_path.value() | 278 ASSERT_TRUE(*library) << "error loading " << other_library_path.value() |
280 << ": " << load_error.ToString(); | 279 << ": " << load_error.ToString(); |
281 }; | 280 }; |
282 | 281 |
283 NativeLibrary library = nullptr; | 282 NativeLibrary library = nullptr; |
284 load(&library); | 283 load(&library); |
285 return library; | 284 return library; |
286 } | 285 } |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 #if defined(STACK_SAMPLING_PROFILER_SUPPORTED) | 976 #if defined(STACK_SAMPLING_PROFILER_SUPPORTED) |
978 #define MAYBE_UnloadedLibrary UnloadedLibrary | 977 #define MAYBE_UnloadedLibrary UnloadedLibrary |
979 #else | 978 #else |
980 #define MAYBE_UnloadedLibrary DISABLED_UnloadedLibrary | 979 #define MAYBE_UnloadedLibrary DISABLED_UnloadedLibrary |
981 #endif | 980 #endif |
982 TEST(StackSamplingProfilerTest, MAYBE_UnloadedLibrary) { | 981 TEST(StackSamplingProfilerTest, MAYBE_UnloadedLibrary) { |
983 TestLibraryUnload(true); | 982 TestLibraryUnload(true); |
984 } | 983 } |
985 | 984 |
986 } // namespace base | 985 } // namespace base |
OLD | NEW |