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 // Flaky failing DCHECK on Windows, see crbug.com/635770 | 80 #if defined(OS_LINUX) || defined(ADDRESS_SANITIZER) |
81 #if defined(OS_LINUX) || defined(ADDRESS_SANITIZER) || defined(OS_WIN) | |
82 #define MAYBE_CrashRenderers DISABLED_CrashRenderers | 81 #define MAYBE_CrashRenderers DISABLED_CrashRenderers |
83 #else | 82 #else |
84 #define MAYBE_CrashRenderers CrashRenderers | 83 #define MAYBE_CrashRenderers CrashRenderers |
85 #endif | 84 #endif |
86 IN_PROC_BROWSER_TEST_F(MetricsServiceBrowserTest, MAYBE_CrashRenderers) { | 85 IN_PROC_BROWSER_TEST_F(MetricsServiceBrowserTest, MAYBE_CrashRenderers) { |
87 OpenTabs(); | 86 OpenTabs(); |
88 | 87 |
89 // Kill the process for one of the tabs. | 88 // Kill the process for one of the tabs. |
90 content::RenderProcessHostWatcher observer( | 89 content::RenderProcessHostWatcher observer( |
91 browser()->tab_strip_model()->GetActiveWebContents(), | 90 browser()->tab_strip_model()->GetActiveWebContents(), |
(...skipping 14 matching lines...) Expand all Loading... |
106 | 105 |
107 // Verify that the expected stability metrics were recorded. | 106 // Verify that the expected stability metrics were recorded. |
108 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityLaunchCount)); | 107 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityLaunchCount)); |
109 EXPECT_EQ(4, prefs->GetInteger(metrics::prefs::kStabilityPageLoadCount)); | 108 EXPECT_EQ(4, prefs->GetInteger(metrics::prefs::kStabilityPageLoadCount)); |
110 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityRendererCrashCount)); | 109 EXPECT_EQ(1, prefs->GetInteger(metrics::prefs::kStabilityRendererCrashCount)); |
111 // TODO(isherman): We should also verify that | 110 // TODO(isherman): We should also verify that |
112 // metrics::prefs::kStabilityExitedCleanly | 111 // metrics::prefs::kStabilityExitedCleanly |
113 // is set to true, but this preference isn't set until the browser | 112 // is set to true, but this preference isn't set until the browser |
114 // exits... it's not clear to me how to test that. | 113 // exits... it's not clear to me how to test that. |
115 } | 114 } |
| 115 |
OLD | NEW |