summaryrefslogtreecommitdiffstats
path: root/chrome/browser/metrics
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 02:23:16 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 02:23:16 +0000
commit57113eacd955181e1267f3f20b889bc6fbfd07f2 (patch)
tree6577b6941409f45cb0215c92f37c4497e62fa87a /chrome/browser/metrics
parente6dbc8c4542c677d6d1a01806535274c1865f69f (diff)
downloadchromium_src-57113eacd955181e1267f3f20b889bc6fbfd07f2.zip
chromium_src-57113eacd955181e1267f3f20b889bc6fbfd07f2.tar.gz
chromium_src-57113eacd955181e1267f3f20b889bc6fbfd07f2.tar.bz2
Linux: Enable metrics_service_uitest.cc. Take 2.
Relands r18641, original code review: http://codereview.chromium.org/125268 Expect a crash on Windows. The old method of crashing was flawed on posix (KillProcess just does a SIGTERM). On Windows though, it would terminate the process with the desired exit code, in order to make DidProcessCrash() return true. This process termination does not dump crash information though, since it just forcibly terminates the process, like a SIGKILL on posix. When I switched it to navigate to about:crash though, it actually crashes, and dumps crash information, which the UITest in windows (but not linux/mac) detects. Therefore, until those platforms can detect, we just use #if defined(OS_WIN) around the expected_crashes = 1. Review URL: http://codereview.chromium.org/131007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18680 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/metrics')
-rw-r--r--chrome/browser/metrics/metrics_service_uitest.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/chrome/browser/metrics/metrics_service_uitest.cc b/chrome/browser/metrics/metrics_service_uitest.cc
index 7245a35..cf453a5 100644
--- a/chrome/browser/metrics/metrics_service_uitest.cc
+++ b/chrome/browser/metrics/metrics_service_uitest.cc
@@ -90,14 +90,12 @@ TEST_F(MetricsServiceTest, CrashRenderers) {
// kill the process for one of the tabs
scoped_refptr<TabProxy> tab(window_->GetTab(1));
ASSERT_TRUE(tab.get());
- int process_id = 0;
- ASSERT_TRUE(tab->GetProcessID(&process_id));
- ASSERT_NE(0, process_id);
- base::ProcessHandle process_handle;
- ASSERT_TRUE(base::OpenProcessHandle(process_id, &process_handle));
- // Fake Access Violation.
- base::KillProcess(process_handle, 0xc0000005, true);
- base::CloseProcessHandle(process_handle);
+
+// Only windows implements the crash service for now.
+#if defined(OS_WIN)
+ expected_crashes_ = 1;
+#endif
+ tab->NavigateToURLAsync(GURL("about:crash"));
// Give the browser a chance to notice the crashed tab.
PlatformThread::Sleep(1000);
@@ -111,6 +109,6 @@ TEST_F(MetricsServiceTest, CrashRenderers) {
local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly));
EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount));
- EXPECT_EQ(3, local_state->GetInteger(prefs::kStabilityPageLoadCount));
+ EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount));
EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount));
}