OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) | 5 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) |
6 | 6 |
7 #include "chrome/browser/ui/webui/settings/metrics_reporting_handler.h" | 7 #include "chrome/browser/ui/webui/settings/metrics_reporting_handler.h" |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/test/base/scoped_testing_local_state.h" | 11 #include "chrome/test/base/scoped_testing_local_state.h" |
12 #include "chrome/test/base/testing_browser_process.h" | 12 #include "chrome/test/base/testing_browser_process.h" |
13 #include "components/metrics/metrics_pref_names.h" | 13 #include "components/metrics/metrics_pref_names.h" |
14 #include "components/policy/core/browser/browser_policy_connector.h" | 14 #include "components/policy/core/browser/browser_policy_connector.h" |
15 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 15 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
16 #include "components/policy/core/common/policy_map.h" | 16 #include "components/policy/core/common/policy_map.h" |
17 #include "components/policy/core/common/policy_types.h" | 17 #include "components/policy/core/common/policy_types.h" |
| 18 #include "components/policy/policy_constants.h" |
18 #include "components/prefs/pref_service.h" | 19 #include "components/prefs/pref_service.h" |
19 #include "content/public/browser/web_ui.h" | 20 #include "content/public/browser/web_ui.h" |
20 #include "content/public/test/test_browser_thread_bundle.h" | 21 #include "content/public/test/test_browser_thread_bundle.h" |
21 #include "content/public/test/test_web_ui.h" | 22 #include "content/public/test/test_web_ui.h" |
22 #include "policy/policy_constants.h" | |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 | 24 |
25 namespace settings { | 25 namespace settings { |
26 | 26 |
27 class TestingMetricsReportingHandler : public MetricsReportingHandler { | 27 class TestingMetricsReportingHandler : public MetricsReportingHandler { |
28 public: | 28 public: |
29 using MetricsReportingHandler::set_web_ui; | 29 using MetricsReportingHandler::set_web_ui; |
30 using MetricsReportingHandler::HandleGetMetricsReporting; | 30 using MetricsReportingHandler::HandleGetMetricsReporting; |
31 }; | 31 }; |
32 | 32 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 policy::POLICY_SOURCE_CLOUD, | 118 policy::POLICY_SOURCE_CLOUD, |
119 base::WrapUnique(new base::FundamentalValue(false)), | 119 base::WrapUnique(new base::FundamentalValue(false)), |
120 nullptr); | 120 nullptr); |
121 provider()->UpdateChromePolicy(*map()); | 121 provider()->UpdateChromePolicy(*map()); |
122 EXPECT_TRUE(test_web_ui()->call_data().empty()); | 122 EXPECT_TRUE(test_web_ui()->call_data().empty()); |
123 } | 123 } |
124 | 124 |
125 } // namespace settings | 125 } // namespace settings |
126 | 126 |
127 #endif // defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) | 127 #endif // defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) |
OLD | NEW |