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

Side by Side Diff: chrome/browser/metrics/metrics_service_uitest.cc

Issue 24004: Fix the windows implementation of KillProcess and WaitForSingleProcess to not... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « chrome/browser/message_window.cc ('k') | chrome/common/ipc_fuzzing_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // Tests the MetricsService stat recording to make sure that the numbers are 5 // Tests the MetricsService stat recording to make sure that the numbers are
6 // what we expect. 6 // what we expect.
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return; 84 return;
85 85
86 OpenTabs(); 86 OpenTabs();
87 87
88 // kill the process for one of the tabs 88 // kill the process for one of the tabs
89 scoped_ptr<TabProxy> tab(window_->GetTab(1)); 89 scoped_ptr<TabProxy> tab(window_->GetTab(1));
90 ASSERT_TRUE(tab.get()); 90 ASSERT_TRUE(tab.get());
91 int process_id = 0; 91 int process_id = 0;
92 ASSERT_TRUE(tab->GetProcessID(&process_id)); 92 ASSERT_TRUE(tab->GetProcessID(&process_id));
93 ASSERT_NE(0, process_id); 93 ASSERT_NE(0, process_id);
94 base::KillProcess(process_id, 0xc0000005, true); // Fake Access Violation. 94 // Fake Access Violation.
95 base::KillProcessById(process_id, 0xc0000005, true);
95 96
96 // Give the browser a chance to notice the crashed tab. 97 // Give the browser a chance to notice the crashed tab.
97 Sleep(1000); 98 Sleep(1000);
98 99
99 QuitBrowser(); 100 QuitBrowser();
100 101
101 scoped_ptr<PrefService> local_state(GetLocalState()); 102 scoped_ptr<PrefService> local_state(GetLocalState());
102 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); 103 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true);
103 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); 104 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0);
104 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); 105 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0);
105 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); 106 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
106 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); 107 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly));
107 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); 108 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount));
108 EXPECT_EQ(3, local_state->GetInteger(prefs::kStabilityPageLoadCount)); 109 EXPECT_EQ(3, local_state->GetInteger(prefs::kStabilityPageLoadCount));
109 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); 110 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount));
110 } 111 }
111 112
OLDNEW
« no previous file with comments | « chrome/browser/message_window.cc ('k') | chrome/common/ipc_fuzzing_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698