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

Unified Diff: chrome/test/remoting/remote_desktop_browsertest.h

Issue 382193004: Print callstack in _ASSERT_TRUE (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/remoting/remote_desktop_browsertest.h
diff --git a/chrome/test/remoting/remote_desktop_browsertest.h b/chrome/test/remoting/remote_desktop_browsertest.h
index 579c2f2103fdf73f007a17b9458ffdafc245cc9d..10755b8c27c8cfabe67100ee2e136868af7f7d34 100644
--- a/chrome/test/remoting/remote_desktop_browsertest.h
+++ b/chrome/test/remoting/remote_desktop_browsertest.h
@@ -5,6 +5,7 @@
#ifndef CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_
#define CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_
+#include "base/debug/stack_trace.h"
#include "chrome/browser/apps/app_browsertest_util.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -30,6 +31,13 @@ const char kHttpServer[] = "http-server";
// ASSERT_TRUE can only be used in void returning functions. This version
// should be used in non-void-returning functions.
inline void _ASSERT_TRUE(bool condition) {
+ if (!condition) {
+ // ASSERT_TRUE only prints the first call frame in the error message.
+ // In our case, this is the _ASSERT_TRUE wrapper function, which is not
+ // useful. To help with debugging, we will dump the full callstack.
+ LOG(ERROR) << "Assertion failed.";
+ LOG(ERROR) << base::debug::StackTrace().ToString();
+ }
ASSERT_TRUE(condition);
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698