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

Side by Side Diff: chrome/browser/logging_chrome_browsertest.cc

Issue 12212048: Linux/ChromeOS Chromium style checker cleanup, chrome/browser edition. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/environment.h" 6 #include "base/environment.h"
7 #include "chrome/common/chrome_switches.h" 7 #include "chrome/common/chrome_switches.h"
8 #include "chrome/common/url_constants.h" 8 #include "chrome/common/url_constants.h"
9 #include "chrome/common/env_vars.h" 9 #include "chrome/common/env_vars.h"
10 #include "chrome/common/logging_chrome.h" 10 #include "chrome/common/logging_chrome.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 // Tests whether we correctly fail on browser crashes. 67 // Tests whether we correctly fail on browser crashes.
68 class RendererCrashTest : public InProcessBrowserTest, 68 class RendererCrashTest : public InProcessBrowserTest,
69 public content::NotificationObserver{ 69 public content::NotificationObserver{
70 protected: 70 protected:
71 RendererCrashTest() : saw_crash_(false) {} 71 RendererCrashTest() : saw_crash_(false) {}
72 72
73 virtual void Observe(int type, 73 virtual void Observe(int type,
74 const content::NotificationSource& source, 74 const content::NotificationSource& source,
75 const content::NotificationDetails& details) { 75 const content::NotificationDetails& details) OVERRIDE {
76 content::RenderProcessHost::RendererClosedDetails* process_details = 76 content::RenderProcessHost::RendererClosedDetails* process_details =
77 content::Details< 77 content::Details<
78 content::RenderProcessHost::RendererClosedDetails>( 78 content::RenderProcessHost::RendererClosedDetails>(
79 details).ptr(); 79 details).ptr();
80 base::TerminationStatus status = process_details->status; 80 base::TerminationStatus status = process_details->status;
81 if (status == base::TERMINATION_STATUS_PROCESS_CRASHED || 81 if (status == base::TERMINATION_STATUS_PROCESS_CRASHED ||
82 status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION) { 82 status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION) {
83 saw_crash_ = true; 83 saw_crash_ = true;
84 MessageLoopForUI::current()->Quit(); 84 MessageLoopForUI::current()->Quit();
85 } 85 }
86 } 86 }
87 87
88 bool saw_crash_; 88 bool saw_crash_;
89 content::NotificationRegistrar registrar_; 89 content::NotificationRegistrar registrar_;
90 }; 90 };
91 91
92 // Flaky, http://crbug.com/107226 . 92 // Flaky, http://crbug.com/107226 .
93 IN_PROC_BROWSER_TEST_F(RendererCrashTest, DISABLED_Crash) { 93 IN_PROC_BROWSER_TEST_F(RendererCrashTest, DISABLED_Crash) {
94 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, 94 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
95 content::NotificationService::AllSources()); 95 content::NotificationService::AllSources());
96 ui_test_utils::NavigateToURLWithDisposition( 96 ui_test_utils::NavigateToURLWithDisposition(
97 browser(), GURL(chrome::kChromeUICrashURL), CURRENT_TAB, 0); 97 browser(), GURL(chrome::kChromeUICrashURL), CURRENT_TAB, 0);
98 content::RunMessageLoop(); 98 content::RunMessageLoop();
99 ASSERT_TRUE(saw_crash_); 99 ASSERT_TRUE(saw_crash_);
100 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698