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

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

Issue 342068: Third patch in getting rid of caching MessageLoop pointers and always using C... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/memory_details_win.cc ('k') | chrome/browser/net/chrome_url_request_context.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_path.h" 10 #include "base/file_path.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ASSERT_TRUE(window->AppendTab(net::FilePathToFileURL(page2_path))); 45 ASSERT_TRUE(window->AppendTab(net::FilePathToFileURL(page2_path)));
46 } 46 }
47 47
48 // Get a PrefService whose contents correspond to the Local State file 48 // Get a PrefService whose contents correspond to the Local State file
49 // that was saved by the app as it closed. The caller takes ownership of the 49 // that was saved by the app as it closed. The caller takes ownership of the
50 // returned PrefService object. 50 // returned PrefService object.
51 PrefService* GetLocalState() { 51 PrefService* GetLocalState() {
52 FilePath local_state_path = user_data_dir() 52 FilePath local_state_path = user_data_dir()
53 .Append(chrome::kLocalStateFilename); 53 .Append(chrome::kLocalStateFilename);
54 54
55 PrefService* local_state(new PrefService(local_state_path, NULL)); 55 return new PrefService(local_state_path);
56 return local_state;
57 } 56 }
58 }; 57 };
59 58
60 TEST_F(MetricsServiceTest, CloseRenderersNormally) { 59 TEST_F(MetricsServiceTest, CloseRenderersNormally) {
61 OpenTabs(); 60 OpenTabs();
62 QuitBrowser(); 61 QuitBrowser();
63 62
64 scoped_ptr<PrefService> local_state(GetLocalState()); 63 scoped_ptr<PrefService> local_state(GetLocalState());
65 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); 64 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true);
66 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); 65 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 scoped_ptr<PrefService> local_state(GetLocalState()); 104 scoped_ptr<PrefService> local_state(GetLocalState());
106 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); 105 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true);
107 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); 106 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0);
108 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); 107 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0);
109 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); 108 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
110 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); 109 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly));
111 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); 110 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount));
112 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); 111 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount));
113 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); 112 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount));
114 } 113 }
OLDNEW
« no previous file with comments | « chrome/browser/memory_details_win.cc ('k') | chrome/browser/net/chrome_url_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698