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