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

Unified Diff: content/test/content_browser_test_test.cc

Issue 2857643002: Let google::Symbolize only print address offset in sanitizer builds. (Closed)
Patch Set: test Created 3 years, 8 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 | « base/third_party/symbolize/symbolize.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/content_browser_test_test.cc
diff --git a/content/test/content_browser_test_test.cc b/content/test/content_browser_test_test.cc
index cbf33947d7990d9e82a87396e49e1cae95a26228..446349da297ec89a96034c706cf6336173bc719d 100644
--- a/content/test/content_browser_test_test.cc
+++ b/content/test/content_browser_test_test.cc
@@ -90,25 +90,19 @@ IN_PROC_BROWSER_TEST_F(ContentBrowserTest, RendererCrashCallStack) {
new_test.AppendSwitch(kRunManualTestsFlag);
new_test.AppendSwitch(kSingleProcessTestsFlag);
- // Per https://www.chromium.org/developers/testing/addresssanitizer, there are
- // ASAN bots that run without the sandbox which this test will pass for. The
- // other ones pipe the output to a symbolizer script.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoSandbox)) {
- new_test.AppendSwitch(switches::kNoSandbox);
- } else {
-#if defined(ADDRESS_SANITIZER)
- LOG(INFO) << "Couldn't run ContentBrowserTest.RendererCrashCallStack since "
- << "sandbox is enabled and ASAN requires piping to an external "
- << "script.";
- return;
-#endif
- }
-
std::string output;
base::GetAppOutputAndError(new_test, &output);
+ // In sanitizer builds, an external script is responsible for symbolizing,
+ // so the stack that the tests sees here looks like:
+ // "#0 0x0000007ea911 (...content_browsertests+0x7ea910)"
std::string crash_string =
+#if !defined(ADDRESS_SANITIZER) && !defined(LEAK_SANITIZER) && \
+ !defined(MEMORY_SANITIZER) && !defined(THREAD_SANITIZER)
"content::RenderFrameImpl::PrepareRenderViewForNavigation";
+#else
+ "#0 ";
+#endif
if (output.find(crash_string) == std::string::npos) {
GTEST_FAIL() << "Couldn't find\n" << crash_string << "\n in output\n "
@@ -134,8 +128,17 @@ IN_PROC_BROWSER_TEST_F(ContentBrowserTest, BrowserCrashCallStack) {
std::string output;
base::GetAppOutputAndError(new_test, &output);
+ // In sanitizer builds, an external script is responsible for symbolizing,
+ // so the stack that the test sees here looks like:
+ // "#0 0x0000007ea911 (...content_browsertests+0x7ea910)"
std::string crash_string =
- "content::ContentBrowserTest_MANUAL_BrowserCrash_Test::RunTestOnMainThread";
+#if !defined(ADDRESS_SANITIZER) && !defined(LEAK_SANITIZER) && \
+ !defined(MEMORY_SANITIZER) && !defined(THREAD_SANITIZER)
+ "content::ContentBrowserTest_MANUAL_BrowserCrash_Test::"
+ "RunTestOnMainThread";
+#else
+ "#0 ";
+#endif
if (output.find(crash_string) == std::string::npos) {
GTEST_FAIL() << "Couldn't find\n" << crash_string << "\n in output\n "
« no previous file with comments | « base/third_party/symbolize/symbolize.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698