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

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

Issue 9349010: Move handling of debug urls like chrome://crash, chrome://gpuclean to content. These are for test... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 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 // 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // Kill the process for one of the tabs. 91 // Kill the process for one of the tabs.
92 scoped_refptr<TabProxy> tab(window->GetTab(1)); 92 scoped_refptr<TabProxy> tab(window->GetTab(1));
93 ASSERT_TRUE(tab.get()); 93 ASSERT_TRUE(tab.get());
94 94
95 // We can get crash dumps on Windows always, Linux when breakpad is 95 // We can get crash dumps on Windows always, Linux when breakpad is
96 // enabled, and all platforms for official Google Chrome builds. 96 // enabled, and all platforms for official Google Chrome builds.
97 #if defined(OS_WIN) || defined(USE_LINUX_BREAKPAD) || \ 97 #if defined(OS_WIN) || defined(USE_LINUX_BREAKPAD) || \
98 defined(GOOGLE_CHROME_BUILD) 98 defined(GOOGLE_CHROME_BUILD)
99 expected_crashes_ = 1; 99 expected_crashes_ = 1;
100 #endif 100 #endif
101 ASSERT_TRUE(tab->NavigateToURLAsync(GURL(chrome::kAboutCrashURL))); 101 ASSERT_TRUE(tab->NavigateToURLAsync(GURL(chrome::kChromeUICrashURL)));
102 } 102 }
103 103
104 // Give the browser a chance to notice the crashed tab. 104 // Give the browser a chance to notice the crashed tab.
105 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); 105 base::PlatformThread::Sleep(TestTimeouts::action_timeout());
106 106
107 QuitBrowser(); 107 QuitBrowser();
108 108
109 scoped_ptr<PrefService> local_state(GetLocalState()); 109 scoped_ptr<PrefService> local_state(GetLocalState());
110 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); 110 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true);
111 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); 111 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0);
112 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); 112 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0);
113 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); 113 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
114 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); 114 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly));
115 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); 115 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount));
116 #if defined(USE_VIRTUAL_KEYBOARD) 116 #if defined(USE_VIRTUAL_KEYBOARD)
117 // The keyboard page loads. 117 // The keyboard page loads.
118 EXPECT_EQ(5, local_state->GetInteger(prefs::kStabilityPageLoadCount)); 118 EXPECT_EQ(5, local_state->GetInteger(prefs::kStabilityPageLoadCount));
119 #else 119 #else
120 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); 120 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount));
121 #endif 121 #endif
122 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); 122 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount));
123 } 123 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698