| 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> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/process/memory.h" | 15 #include "base/process/memory.h" |
| 16 #include "base/test/histogram_tester.h" | 16 #include "base/test/histogram_tester.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 21 #include "chrome/common/chrome_paths.h" | 21 #include "chrome/common/chrome_paths.h" |
| 22 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
| 23 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
| 24 #include "chrome/test/base/in_process_browser_test.h" | 24 #include "chrome/test/base/in_process_browser_test.h" |
| 25 #include "chrome/test/base/ui_test_utils.h" | 25 #include "chrome/test/base/ui_test_utils.h" |
| 26 #include "components/metrics/metrics_pref_names.h" | 26 #include "components/metrics/stability_pref_names.h" |
| 27 #include "components/prefs/pref_service.h" | 27 #include "components/prefs/pref_service.h" |
| 28 #include "content/public/test/browser_test_utils.h" | 28 #include "content/public/test/browser_test_utils.h" |
| 29 #include "net/base/filename_util.h" | 29 #include "net/base/filename_util.h" |
| 30 #include "ui/base/window_open_disposition.h" | 30 #include "ui/base/window_open_disposition.h" |
| 31 #include "url/gurl.h" | 31 #include "url/gurl.h" |
| 32 | 32 |
| 33 #if defined(OS_POSIX) | 33 #if defined(OS_POSIX) |
| 34 #include <sys/wait.h> | 34 #include <sys/wait.h> |
| 35 #endif | 35 #endif |
| 36 | 36 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 #endif | 192 #endif |
| 193 | 193 |
| 194 // Exit codes are recorded after being passed through std::abs see | 194 // Exit codes are recorded after being passed through std::abs see |
| 195 // MapCrashExitCodeForHistogram. | 195 // MapCrashExitCodeForHistogram. |
| 196 histogram_tester.ExpectUniqueSample("CrashExitCodes.Renderer", | 196 histogram_tester.ExpectUniqueSample("CrashExitCodes.Renderer", |
| 197 std::abs(expected_exit_code), 1); | 197 std::abs(expected_exit_code), 1); |
| 198 | 198 |
| 199 histogram_tester.ExpectUniqueSample("Tabs.SadTab.OomCreated", 1, 1); | 199 histogram_tester.ExpectUniqueSample("Tabs.SadTab.OomCreated", 1, 1); |
| 200 } | 200 } |
| 201 #endif // OS_WIN && !ADDRESS_SANITIZER | 201 #endif // OS_WIN && !ADDRESS_SANITIZER |
| OLD | NEW |