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 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 #if !defined(OS_MACOSX) | 223 #if !defined(OS_MACOSX) |
224 #include "base/compiler_specific.h" | 224 #include "base/compiler_specific.h" |
225 #include "chrome/browser/ui/extensions/app_launch_params.h" | 225 #include "chrome/browser/ui/extensions/app_launch_params.h" |
226 #include "chrome/browser/ui/extensions/application_launch.h" | 226 #include "chrome/browser/ui/extensions/application_launch.h" |
227 #include "extensions/browser/app_window/app_window.h" | 227 #include "extensions/browser/app_window/app_window.h" |
228 #include "extensions/browser/app_window/app_window_registry.h" | 228 #include "extensions/browser/app_window/app_window_registry.h" |
229 #include "extensions/browser/app_window/native_app_window.h" | 229 #include "extensions/browser/app_window/native_app_window.h" |
230 #include "ui/base/window_open_disposition.h" | 230 #include "ui/base/window_open_disposition.h" |
231 #endif | 231 #endif |
232 | 232 |
233 #if defined(ENABLE_MEDIA_ROUTER) && !defined(OS_ANDROID) | 233 #if !defined(OS_ANDROID) |
234 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" | 234 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" |
235 #include "chrome/browser/ui/toolbar/media_router_action_controller.h" | 235 #include "chrome/browser/ui/toolbar/media_router_action_controller.h" |
236 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" | 236 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" |
237 #endif // defined(ENABLE_MEDIA_ROUTER) && !defined(OS_ANDROID) | 237 #endif // !defined(OS_ANDROID) |
238 | 238 |
239 using content::BrowserThread; | 239 using content::BrowserThread; |
240 using net::URLRequestMockHTTPJob; | 240 using net::URLRequestMockHTTPJob; |
241 using testing::Mock; | 241 using testing::Mock; |
242 using testing::Return; | 242 using testing::Return; |
243 using testing::_; | 243 using testing::_; |
244 | 244 |
245 namespace policy { | 245 namespace policy { |
246 | 246 |
247 namespace { | 247 namespace { |
(...skipping 3377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3625 PolicyMap policies2; | 3625 PolicyMap policies2; |
3626 policies2.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, | 3626 policies2.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, |
3627 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | 3627 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, |
3628 base::WrapUnique(new base::Value(true)), nullptr); | 3628 base::WrapUnique(new base::Value(true)), nullptr); |
3629 UpdateProviderPolicy(policies2); | 3629 UpdateProviderPolicy(policies2); |
3630 | 3630 |
3631 // Policy should allow ending tasks again. | 3631 // Policy should allow ending tasks again. |
3632 EXPECT_TRUE(task_manager::TaskManagerInterface::IsEndProcessEnabled()); | 3632 EXPECT_TRUE(task_manager::TaskManagerInterface::IsEndProcessEnabled()); |
3633 } | 3633 } |
3634 | 3634 |
3635 #if defined(ENABLE_MEDIA_ROUTER) | |
3636 // Sets the proper policy before the browser is started. | 3635 // Sets the proper policy before the browser is started. |
3637 template<bool enable> | 3636 template<bool enable> |
3638 class MediaRouterPolicyTest : public PolicyTest { | 3637 class MediaRouterPolicyTest : public PolicyTest { |
3639 public: | 3638 public: |
3640 void SetUpInProcessBrowserTestFixture() override { | 3639 void SetUpInProcessBrowserTestFixture() override { |
3641 PolicyTest::SetUpInProcessBrowserTestFixture(); | 3640 PolicyTest::SetUpInProcessBrowserTestFixture(); |
3642 PolicyMap policies; | 3641 PolicyMap policies; |
3643 policies.Set(key::kEnableMediaRouter, POLICY_LEVEL_MANDATORY, | 3642 policies.Set(key::kEnableMediaRouter, POLICY_LEVEL_MANDATORY, |
3644 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, | 3643 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
3645 base::MakeUnique<base::Value>(enable), nullptr); | 3644 base::MakeUnique<base::Value>(enable), nullptr); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3693 EXPECT_TRUE(HasMediaRouterActionAtInit()); | 3692 EXPECT_TRUE(HasMediaRouterActionAtInit()); |
3694 } | 3693 } |
3695 | 3694 |
3696 IN_PROC_BROWSER_TEST_F(MediaRouterActionDisabledPolicyTest, | 3695 IN_PROC_BROWSER_TEST_F(MediaRouterActionDisabledPolicyTest, |
3697 MediaRouterActionDisabled) { | 3696 MediaRouterActionDisabled) { |
3698 EXPECT_FALSE( | 3697 EXPECT_FALSE( |
3699 MediaRouterActionController::IsActionShownByPolicy(browser()->profile())); | 3698 MediaRouterActionController::IsActionShownByPolicy(browser()->profile())); |
3700 EXPECT_FALSE(HasMediaRouterActionAtInit()); | 3699 EXPECT_FALSE(HasMediaRouterActionAtInit()); |
3701 } | 3700 } |
3702 #endif // !defined(OS_ANDROID) | 3701 #endif // !defined(OS_ANDROID) |
3703 #endif // defined(ENABLE_MEDIA_ROUTER) | |
3704 | 3702 |
3705 #if BUILDFLAG(ENABLE_WEBRTC) | 3703 #if BUILDFLAG(ENABLE_WEBRTC) |
3706 // Sets the proper policy before the browser is started. | 3704 // Sets the proper policy before the browser is started. |
3707 template <bool enable> | 3705 template <bool enable> |
3708 class WebRtcUdpPortRangePolicyTest : public PolicyTest { | 3706 class WebRtcUdpPortRangePolicyTest : public PolicyTest { |
3709 public: | 3707 public: |
3710 WebRtcUdpPortRangePolicyTest() = default; | 3708 WebRtcUdpPortRangePolicyTest() = default; |
3711 void SetUpInProcessBrowserTestFixture() override { | 3709 void SetUpInProcessBrowserTestFixture() override { |
3712 PolicyTest::SetUpInProcessBrowserTestFixture(); | 3710 PolicyTest::SetUpInProcessBrowserTestFixture(); |
3713 PolicyMap policies; | 3711 PolicyMap policies; |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4470 | 4468 |
4471 SetEmptyPolicy(); | 4469 SetEmptyPolicy(); |
4472 // Policy not set. | 4470 // Policy not set. |
4473 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4471 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
4474 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4472 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
4475 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4473 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
4476 } | 4474 } |
4477 #endif // defined(OS_CHROMEOS) | 4475 #endif // defined(OS_CHROMEOS) |
4478 | 4476 |
4479 } // namespace policy | 4477 } // namespace policy |
OLD | NEW |