| Index: base/profiler/stack_sampling_profiler_unittest.cc
|
| diff --git a/base/profiler/stack_sampling_profiler_unittest.cc b/base/profiler/stack_sampling_profiler_unittest.cc
|
| index 16205ac2b09f22e25975cda252c8306ba6eb918a..f994d410ae8c3c91901faa0a5dc5e8a5f86498ae 100644
|
| --- a/base/profiler/stack_sampling_profiler_unittest.cc
|
| +++ b/base/profiler/stack_sampling_profiler_unittest.cc
|
| @@ -12,6 +12,7 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/compiler_specific.h"
|
| +#include "base/files/file_util.h"
|
| #include "base/macros.h"
|
| #include "base/memory/ptr_util.h"
|
| #include "base/message_loop/message_loop.h"
|
| @@ -38,8 +39,8 @@
|
| #endif
|
|
|
| // STACK_SAMPLING_PROFILER_SUPPORTED is used to conditionally enable the tests
|
| -// below for supported platforms (currently Win x64).
|
| -#if defined(_WIN64)
|
| +// below for supported platforms (currently Win x64 and Mac x64).
|
| +#if defined(_WIN64) || defined(OS_MACOSX)
|
| #define STACK_SAMPLING_PROFILER_SUPPORTED 1
|
| #endif
|
|
|
| @@ -306,6 +307,8 @@ void SynchronousUnloadNativeLibrary(NativeLibrary library) {
|
| ::GetLastError() != ERROR_MOD_NOT_FOUND) {
|
| PlatformThread::Sleep(TimeDelta::FromMilliseconds(1));
|
| }
|
| +#elif defined(OS_MACOSX)
|
| + // Unloading a library on the Mac is synchronous.
|
| #else
|
| NOTIMPLEMENTED();
|
| #endif
|
| @@ -542,7 +545,7 @@ void TestLibraryUnload(bool wait_until_unloaded) {
|
| << "Stack:\n"
|
| << FormatSampleForDiagnosticOutput(sample, profile.modules);
|
| } else {
|
| - // We didn't wait for the asynchonous unloading to complete, so the results
|
| + // We didn't wait for the asynchronous unloading to complete, so the results
|
| // are non-deterministic: if the library finished unloading we should have
|
| // the same stack as |wait_until_unloaded|, if not we should have the full
|
| // stack. The important thing is that we should not crash.
|
| @@ -622,7 +625,8 @@ TEST(StackSamplingProfilerTest, MAYBE_Basic) {
|
| << FormatSampleForDiagnosticOutput(sample, profile.modules);
|
| FilePath executable_path;
|
| EXPECT_TRUE(PathService::Get(FILE_EXE, &executable_path));
|
| - EXPECT_EQ(executable_path, profile.modules[loc->module_index].filename);
|
| + EXPECT_EQ(executable_path,
|
| + MakeAbsoluteFilePath(profile.modules[loc->module_index].filename));
|
| }
|
|
|
| // Checks that annotations are recorded in samples.
|
| @@ -1003,7 +1007,8 @@ TEST(StackSamplingProfilerTest, MAYBE_OtherLibrary) {
|
|
|
| // Checks that a stack that runs through a library that is unloading produces a
|
| // stack, and doesn't crash.
|
| -#if defined(STACK_SAMPLING_PROFILER_SUPPORTED)
|
| +// Unloading is synchronous on the Mac, so this test is inapplicable.
|
| +#if defined(STACK_SAMPLING_PROFILER_SUPPORTED) && !defined(OS_MACOSX)
|
| #define MAYBE_UnloadingLibrary UnloadingLibrary
|
| #else
|
| #define MAYBE_UnloadingLibrary DISABLED_UnloadingLibrary
|
|
|