| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 5 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/macros.h" |
| 10 #include "build/build_config.h" |
| 9 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 10 #include "chrome/test/base/scoped_testing_local_state.h" | 12 #include "chrome/test/base/scoped_testing_local_state.h" |
| 11 #include "chrome/test/base/testing_browser_process.h" | 13 #include "chrome/test/base/testing_browser_process.h" |
| 12 #include "components/metrics/metrics_pref_names.h" | 14 #include "components/metrics/metrics_pref_names.h" |
| 13 #include "content/public/test/test_browser_thread_bundle.h" | 15 #include "content/public/test/test_browser_thread_bundle.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 17 |
| 16 class ChromeMetricsServiceAccessorTest : public testing::Test { | 18 class ChromeMetricsServiceAccessorTest : public testing::Test { |
| 17 public: | 19 public: |
| 18 ChromeMetricsServiceAccessorTest() | 20 ChromeMetricsServiceAccessorTest() |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 GetLocalState()->SetBoolean(pref, true); | 61 GetLocalState()->SetBoolean(pref, true); |
| 60 EXPECT_FALSE( | 62 EXPECT_FALSE( |
| 61 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()); | 63 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()); |
| 62 #endif // !defined(OS_CHROMEOS) | 64 #endif // !defined(OS_CHROMEOS) |
| 63 #else | 65 #else |
| 64 // Metrics Reporting is never enabled when GOOGLE_CHROME_BUILD is undefined. | 66 // Metrics Reporting is never enabled when GOOGLE_CHROME_BUILD is undefined. |
| 65 EXPECT_FALSE( | 67 EXPECT_FALSE( |
| 66 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()); | 68 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()); |
| 67 #endif | 69 #endif |
| 68 } | 70 } |
| OLD | NEW |