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

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

Issue 5967003: Refactor UITestBase/ProxyLauncher. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Add POD struct to hold some launcher variables. Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_path.h" 10 #include "base/file_path.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); 66 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0);
67 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); 67 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
68 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); 68 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly));
69 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); 69 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount));
70 EXPECT_EQ(3, local_state->GetInteger(prefs::kStabilityPageLoadCount)); 70 EXPECT_EQ(3, local_state->GetInteger(prefs::kStabilityPageLoadCount));
71 EXPECT_EQ(0, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); 71 EXPECT_EQ(0, local_state->GetInteger(prefs::kStabilityRendererCrashCount));
72 } 72 }
73 73
74 TEST_F(MetricsServiceTest, CrashRenderers) { 74 TEST_F(MetricsServiceTest, CrashRenderers) {
75 // This doesn't make sense to test in single process mode. 75 // This doesn't make sense to test in single process mode.
76 if (in_process_renderer_) 76 if (ProxyLauncher::in_process_renderer())
77 return; 77 return;
78 78
79 OpenTabs(); 79 OpenTabs();
80 80
81 { 81 {
82 // Limit the lifetime of various automation proxies used here. We must 82 // Limit the lifetime of various automation proxies used here. We must
83 // destroy them before calling QuitBrowser. 83 // destroy them before calling QuitBrowser.
84 84
85 scoped_refptr<BrowserProxy> window = automation()->GetBrowserWindow(0); 85 scoped_refptr<BrowserProxy> window = automation()->GetBrowserWindow(0);
86 ASSERT_TRUE(window.get()); 86 ASSERT_TRUE(window.get());
(...skipping 19 matching lines...) Expand all
106 scoped_ptr<PrefService> local_state(GetLocalState()); 106 scoped_ptr<PrefService> local_state(GetLocalState());
107 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); 107 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true);
108 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); 108 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0);
109 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); 109 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0);
110 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); 110 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
111 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); 111 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly));
112 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); 112 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount));
113 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); 113 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount));
114 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); 114 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount));
115 } 115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698