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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_ 5 #ifndef CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_
6 #define CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_ 6 #define CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_
7 7
8 #include "base/debug/stack_trace.h"
8 #include "chrome/browser/apps/app_browsertest_util.h" 9 #include "chrome/browser/apps/app_browsertest_util.h"
9 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" 11 #include "chrome/browser/ui/tabs/tab_strip_model.h"
11 #include "chrome/test/base/ui_test_utils.h" 12 #include "chrome/test/base/ui_test_utils.h"
12 #include "content/public/browser/notification_service.h" 13 #include "content/public/browser/notification_service.h"
13 #include "content/public/test/browser_test_utils.h" 14 #include "content/public/test/browser_test_utils.h"
14 #include "net/dns/mock_host_resolver.h" 15 #include "net/dns/mock_host_resolver.h"
15 16
16 namespace { 17 namespace {
17 // Command line arguments specific to the chromoting browser tests. 18 // Command line arguments specific to the chromoting browser tests.
18 const char kOverrideUserDataDir[] = "override-user-data-dir"; 19 const char kOverrideUserDataDir[] = "override-user-data-dir";
19 const char kNoCleanup[] = "no-cleanup"; 20 const char kNoCleanup[] = "no-cleanup";
20 const char kNoInstall[] = "no-install"; 21 const char kNoInstall[] = "no-install";
21 const char kWebAppCrx[] = "webapp-crx"; 22 const char kWebAppCrx[] = "webapp-crx";
22 const char kWebAppUnpacked[] = "webapp-unpacked"; 23 const char kWebAppUnpacked[] = "webapp-unpacked";
23 const char kUsername[] = "username"; 24 const char kUsername[] = "username";
24 const char kkPassword[] = "password"; 25 const char kkPassword[] = "password";
25 const char kMe2MePin[] = "me2me-pin"; 26 const char kMe2MePin[] = "me2me-pin";
26 const char kRemoteHostName[] = "remote-host-name"; 27 const char kRemoteHostName[] = "remote-host-name";
27 const char kExtensionName[] = "extension-name"; 28 const char kExtensionName[] = "extension-name";
28 const char kHttpServer[] = "http-server"; 29 const char kHttpServer[] = "http-server";
29 30
30 // ASSERT_TRUE can only be used in void returning functions. This version 31 // ASSERT_TRUE can only be used in void returning functions. This version
31 // should be used in non-void-returning functions. 32 // should be used in non-void-returning functions.
32 inline void _ASSERT_TRUE(bool condition) { 33 inline void _ASSERT_TRUE(bool condition) {
34 if (!condition) {
35 // ASSERT_TRUE only prints the first call frame in the error message.
36 // In our case, this is the _ASSERT_TRUE wrapper function, which is not
37 // useful. To help with debugging, we will dump the full callstack.
38 LOG(ERROR) << "Assertion failed.";
39 LOG(ERROR) << base::debug::StackTrace().ToString();
40 }
33 ASSERT_TRUE(condition); 41 ASSERT_TRUE(condition);
34 return; 42 return;
35 } 43 }
36 44
37 } // namespace 45 } // namespace
38 46
39 using extensions::Extension; 47 using extensions::Extension;
40 48
41 namespace remoting { 49 namespace remoting {
42 50
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 std::string password_; 358 std::string password_;
351 std::string me2me_pin_; 359 std::string me2me_pin_;
352 std::string remote_host_name_; 360 std::string remote_host_name_;
353 std::string extension_name_; 361 std::string extension_name_;
354 std::string http_server_; 362 std::string http_server_;
355 }; 363 };
356 364
357 } // namespace remoting 365 } // namespace remoting
358 366
359 #endif // CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_ 367 #endif // CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_
OLDNEW
« 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