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

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

Issue 2241073002: Revert of Disable flaky MetricsServiceBrowserTest#CloseRenderersNormally. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | 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) 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 "components/metrics/metrics_service.h" 8 #include "components/metrics/metrics_service.h"
9 9
10 #include <string> 10 #include <string>
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 base::FilePath page2_path = test_directory.AppendASCII("iframe.html"); 54 base::FilePath page2_path = test_directory.AppendASCII("iframe.html");
55 ui_test_utils::NavigateToURLWithDisposition( 55 ui_test_utils::NavigateToURLWithDisposition(
56 browser(), 56 browser(),
57 net::FilePathToFileURL(page2_path), 57 net::FilePathToFileURL(page2_path),
58 NEW_FOREGROUND_TAB, 58 NEW_FOREGROUND_TAB,
59 kBrowserTestFlags); 59 kBrowserTestFlags);
60 } 60 }
61 }; 61 };
62 62
63 // Flaky failing DCHECK on Windows, see crbug.com/636052 63 IN_PROC_BROWSER_TEST_F(MetricsServiceBrowserTest, CloseRenderersNormally) {
64 #if defined(OS_WIN)
65 #define MAYBE_CloseRenderersNormally DISABLED_CloseRenderersNormally
66 #else
67 #define MAYBE_CloseRenderersNormally CloseRenderersNormally
68 #endif
69 IN_PROC_BROWSER_TEST_F(MetricsServiceBrowserTest,
70 MAYBE_CloseRenderersNormally) {
71 OpenTabs(); 64 OpenTabs();
72 65
73 // Verify that the expected stability metrics were recorded. 66 // Verify that the expected stability metrics were recorded.
74 const PrefService* prefs = g_browser_process->local_state(); 67 const PrefService* prefs = g_browser_process->local_state();
75 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityLaunchCount)); 68 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityLaunchCount));
76 EXPECT_EQ(3, prefs->GetInteger(metrics::prefs::kStabilityPageLoadCount)); 69 EXPECT_EQ(3, prefs->GetInteger(metrics::prefs::kStabilityPageLoadCount));
77 EXPECT_EQ(0, prefs->GetInteger(metrics::prefs::kStabilityRendererCrashCount)); 70 EXPECT_EQ(0, prefs->GetInteger(metrics::prefs::kStabilityRendererCrashCount));
78 // TODO(isherman): We should also verify that 71 // TODO(isherman): We should also verify that
79 // metrics::prefs::kStabilityExitedCleanly 72 // metrics::prefs::kStabilityExitedCleanly
80 // is set to true, but this preference isn't set until the browser 73 // is set to true, but this preference isn't set until the browser
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 106
114 // Verify that the expected stability metrics were recorded. 107 // Verify that the expected stability metrics were recorded.
115 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityLaunchCount)); 108 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityLaunchCount));
116 EXPECT_EQ(4, prefs->GetInteger(metrics::prefs::kStabilityPageLoadCount)); 109 EXPECT_EQ(4, prefs->GetInteger(metrics::prefs::kStabilityPageLoadCount));
117 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityRendererCrashCount)); 110 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityRendererCrashCount));
118 // TODO(isherman): We should also verify that 111 // TODO(isherman): We should also verify that
119 // metrics::prefs::kStabilityExitedCleanly 112 // metrics::prefs::kStabilityExitedCleanly
120 // is set to true, but this preference isn't set until the browser 113 // is set to true, but this preference isn't set until the browser
121 // exits... it's not clear to me how to test that. 114 // exits... it's not clear to me how to test that.
122 } 115 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698