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

Unified Diff: base/profiler/stack_sampling_profiler_unittest.cc

Issue 1469983002: Stack sampling profiler: fix off-by-one error on truncated stacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: update tests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/profiler/native_stack_sampler_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a169c9d064d335a5e937ff5ef9e8eb69280616bf..2ba769f8b5020aade8f1aa8701a8c881a4a3386a 100644
--- a/base/profiler/stack_sampling_profiler_unittest.cc
+++ b/base/profiler/stack_sampling_profiler_unittest.cc
@@ -515,15 +515,14 @@ void TestLibraryUnload(bool wait_until_unloaded) {
<< FormatSampleForDiagnosticOutput(sample, profile.modules);
if (wait_until_unloaded) {
- // The stack should look like this, resulting in two frames between
- // SignalAndWaitUntilSignaled and the last frame, which should be the one in
- // the now-unloaded library:
+ // The stack should look like this, resulting one frame after
+ // SignalAndWaitUntilSignaled. The frame in the now-unloaded library is not
+ // recorded since we can't get module information.
//
// ... WaitableEvent and system frames ...
// TargetThread::SignalAndWaitUntilSignaled
// TargetThread::OtherLibraryCallback
- // InvokeCallbackFunction (in other library, now unloaded)
- EXPECT_EQ(2, (sample.end() - 1) - end_frame)
+ EXPECT_EQ(2, sample.end() - end_frame)
<< "Stack:\n"
<< FormatSampleForDiagnosticOutput(sample, profile.modules);
} else {
« no previous file with comments | « base/profiler/native_stack_sampler_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698