OLD | NEW |
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 EXPECT_EQ(0, prefs->GetInteger(metrics::prefs::kStabilityRendererCrashCount)); | 70 EXPECT_EQ(0, prefs->GetInteger(metrics::prefs::kStabilityRendererCrashCount)); |
71 // TODO(isherman): We should also verify that | 71 // TODO(isherman): We should also verify that |
72 // metrics::prefs::kStabilityExitedCleanly | 72 // metrics::prefs::kStabilityExitedCleanly |
73 // 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 |
74 // exits... it's not clear to me how to test that. | 74 // exits... it's not clear to me how to test that. |
75 } | 75 } |
76 | 76 |
77 // Flaky on Linux. See http://crbug.com/131094 | 77 // Flaky on Linux. See http://crbug.com/131094 |
78 // Child crashes fail the process on ASan (see crbug.com/411251, | 78 // Child crashes fail the process on ASan (see crbug.com/411251, |
79 // crbug.com/368525). | 79 // crbug.com/368525). |
80 #if defined(OS_LINUX) || defined(ADDRESS_SANITIZER) | 80 // Flaky failing DCHECK on Windows, see crbug.com/635770 |
| 81 #if defined(OS_LINUX) || defined(ADDRESS_SANITIZER) || defined(OS_WIN) |
81 #define MAYBE_CrashRenderers DISABLED_CrashRenderers | 82 #define MAYBE_CrashRenderers DISABLED_CrashRenderers |
82 #else | 83 #else |
83 #define MAYBE_CrashRenderers CrashRenderers | 84 #define MAYBE_CrashRenderers CrashRenderers |
84 #endif | 85 #endif |
85 IN_PROC_BROWSER_TEST_F(MetricsServiceBrowserTest, MAYBE_CrashRenderers) { | 86 IN_PROC_BROWSER_TEST_F(MetricsServiceBrowserTest, MAYBE_CrashRenderers) { |
86 OpenTabs(); | 87 OpenTabs(); |
87 | 88 |
88 // Kill the process for one of the tabs. | 89 // Kill the process for one of the tabs. |
89 content::RenderProcessHostWatcher observer( | 90 content::RenderProcessHostWatcher observer( |
90 browser()->tab_strip_model()->GetActiveWebContents(), | 91 browser()->tab_strip_model()->GetActiveWebContents(), |
(...skipping 14 matching lines...) Expand all Loading... |
105 | 106 |
106 // Verify that the expected stability metrics were recorded. | 107 // Verify that the expected stability metrics were recorded. |
107 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityLaunchCount)); | 108 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityLaunchCount)); |
108 EXPECT_EQ(4, prefs->GetInteger(metrics::prefs::kStabilityPageLoadCount)); | 109 EXPECT_EQ(4, prefs->GetInteger(metrics::prefs::kStabilityPageLoadCount)); |
109 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityRendererCrashCount)); | 110 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityRendererCrashCount)); |
110 // TODO(isherman): We should also verify that | 111 // TODO(isherman): We should also verify that |
111 // metrics::prefs::kStabilityExitedCleanly | 112 // metrics::prefs::kStabilityExitedCleanly |
112 // 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 |
113 // exits... it's not clear to me how to test that. | 114 // exits... it's not clear to me how to test that. |
114 } | 115 } |
115 | |
OLD | NEW |