Commit 5172af85 authored by Etienne Pierre-doray's avatar Etienne Pierre-doray Committed by Commit Bot

[Clank SSM]: Define base_profiler_test_support_library as a loadable module.

Android doesn't support shared_library (see native_library_unittest.cc).
base_profiler_test_support_library is defined as a loadable_module for
upcoming support for android in stack_sampling_profiler_test
https://chromium-review.googlesource.com/c/chromium/src/+/2055743/20

Bug: 989102
Change-Id: Iac0f2764f5177820436db93cc4966782a879308d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2075158Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744851}
parent 7c2b6c4e
......@@ -2380,7 +2380,8 @@ if (is_win) {
if (is_win || is_mac) {
if (current_cpu == "x64" || (current_cpu == "arm64" && is_win)) {
# Must be a shared library so that it can be unloaded during testing.
shared_library("base_profiler_test_support_library") {
loadable_module("base_profiler_test_support_library") {
testonly = true
sources = [ "profiler/test_support_library.cc" ]
}
}
......@@ -3014,7 +3015,7 @@ test("base_unittests") {
"Foundation.framework",
]
if (current_cpu == "x64") {
data_deps += [ ":base_profiler_test_support_library" ]
deps += [ ":base_profiler_test_support_library" ]
}
}
......@@ -3101,7 +3102,7 @@ test("base_unittests") {
deps += [ "//base:scoped_handle_test_dll" ]
if (current_cpu == "x64" || current_cpu == "arm64") {
sources += [ "profiler/win32_stack_frame_unwinder_unittest.cc" ]
data_deps += [ ":base_profiler_test_support_library" ]
deps += [ ":base_profiler_test_support_library" ]
}
sources += [ "files/os_validation_win_unittest.cc" ]
}
......
......@@ -234,9 +234,9 @@ NativeLibrary LoadOtherLibrary() {
// macros in a function returning non-null.
const auto load = [](NativeLibrary* library) {
FilePath other_library_path;
ASSERT_TRUE(PathService::Get(DIR_EXE, &other_library_path));
ASSERT_TRUE(PathService::Get(DIR_MODULE, &other_library_path));
other_library_path = other_library_path.AppendASCII(
GetNativeLibraryName("base_profiler_test_support_library"));
GetLoadableModuleName("base_profiler_test_support_library"));
NativeLibraryLoadError load_error;
*library = LoadNativeLibrary(other_library_path, &load_error);
ASSERT_TRUE(*library) << "error loading " << other_library_path.value()
......
......@@ -5,9 +5,11 @@
// Note: there is intentionally no header file associated with this library so
// we don't risk implicitly demand loading it by accessing a symbol.
#if defined(WIN32)
#include "build/build_config.h"
#if defined(OS_WIN)
#define BASE_PROFILER_TEST_SUPPORT_LIBRARY_EXPORT __declspec(dllexport)
#else // defined(WIN32)
#else // defined(OS_WIN)
#define BASE_PROFILER_TEST_SUPPORT_LIBRARY_EXPORT __attribute__((visibility("default")))
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment