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

Unified Diff: base/profiler/stack_sampling_profiler_unittest.cc

Issue 1346453004: NativeStackSampler implementation for Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adress comments. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
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 1426f4647f6154efc8faebe10f071927ae762dbc..b316e45a2d755d60df1d073b5572643fdf09ffdb 100644
--- a/base/profiler/stack_sampling_profiler_unittest.cc
+++ b/base/profiler/stack_sampling_profiler_unittest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <stdlib.h>
+
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_vector.h"
@@ -16,8 +18,8 @@
#include "testing/gtest/include/gtest/gtest.h"
// 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).
+#if defined(_WIN64) || defined(OS_MACOSX)
#define STACK_SAMPLING_PROFILER_SUPPORTED 1
#endif
@@ -256,7 +258,11 @@ 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);
+ // Use realpath here to retrieve absolute path (and resolve all ./ and ../)
+ char filepath[PATH_MAX + 1];
+ realpath(profile.modules[loc->module_index].filename.value().c_str(),
+ filepath);
+ EXPECT_EQ(executable_path, FilePath(filepath));
Mike Wittman 2015/09/15 20:16:49 EXPECT_EQ(executable_path, MakeAbsoluteFilePath(fi
sydli 2015/09/15 20:37:40 Done.
}
// Checks that the fire-and-forget interface works.
« base/profiler/native_stack_sampler_mac.cc ('K') | « base/profiler/native_stack_sampler_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698