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 3392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3640 PolicyMap policies2; | 3640 PolicyMap policies2; |
3641 policies2.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, | 3641 policies2.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, |
3642 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | 3642 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, |
3643 base::WrapUnique(new base::Value(true)), nullptr); | 3643 base::WrapUnique(new base::Value(true)), nullptr); |
3644 UpdateProviderPolicy(policies2); | 3644 UpdateProviderPolicy(policies2); |
3645 | 3645 |
3646 // Policy should allow ending tasks again. | 3646 // Policy should allow ending tasks again. |
3647 EXPECT_TRUE(task_manager::TaskManagerInterface::IsEndProcessEnabled()); | 3647 EXPECT_TRUE(task_manager::TaskManagerInterface::IsEndProcessEnabled()); |
3648 } | 3648 } |
3649 | 3649 |
3650 #if defined(ENABLE_MEDIA_ROUTER) | |
3651 // Sets the proper policy before the browser is started. | 3650 // Sets the proper policy before the browser is started. |
3652 template<bool enable> | 3651 template<bool enable> |
3653 class MediaRouterPolicyTest : public PolicyTest { | 3652 class MediaRouterPolicyTest : public PolicyTest { |
3654 public: | 3653 public: |
3655 void SetUpInProcessBrowserTestFixture() override { | 3654 void SetUpInProcessBrowserTestFixture() override { |
3656 PolicyTest::SetUpInProcessBrowserTestFixture(); | 3655 PolicyTest::SetUpInProcessBrowserTestFixture(); |
3657 PolicyMap policies; | 3656 PolicyMap policies; |
3658 policies.Set(key::kEnableMediaRouter, POLICY_LEVEL_MANDATORY, | 3657 policies.Set(key::kEnableMediaRouter, POLICY_LEVEL_MANDATORY, |
3659 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, | 3658 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
3660 base::MakeUnique<base::Value>(enable), nullptr); | 3659 base::MakeUnique<base::Value>(enable), nullptr); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3708 EXPECT_TRUE(HasMediaRouterActionAtInit()); | 3707 EXPECT_TRUE(HasMediaRouterActionAtInit()); |
3709 } | 3708 } |
3710 | 3709 |
3711 IN_PROC_BROWSER_TEST_F(MediaRouterActionDisabledPolicyTest, | 3710 IN_PROC_BROWSER_TEST_F(MediaRouterActionDisabledPolicyTest, |
3712 MediaRouterActionDisabled) { | 3711 MediaRouterActionDisabled) { |
3713 EXPECT_FALSE( | 3712 EXPECT_FALSE( |
3714 MediaRouterActionController::IsActionShownByPolicy(browser()->profile())); | 3713 MediaRouterActionController::IsActionShownByPolicy(browser()->profile())); |
3715 EXPECT_FALSE(HasMediaRouterActionAtInit()); | 3714 EXPECT_FALSE(HasMediaRouterActionAtInit()); |
3716 } | 3715 } |
3717 #endif // !defined(OS_ANDROID) | 3716 #endif // !defined(OS_ANDROID) |
3718 #endif // defined(ENABLE_MEDIA_ROUTER) | |
3719 | 3717 |
3720 #if BUILDFLAG(ENABLE_WEBRTC) | 3718 #if BUILDFLAG(ENABLE_WEBRTC) |
3721 // Sets the proper policy before the browser is started. | 3719 // Sets the proper policy before the browser is started. |
3722 template <bool enable> | 3720 template <bool enable> |
3723 class WebRtcUdpPortRangePolicyTest : public PolicyTest { | 3721 class WebRtcUdpPortRangePolicyTest : public PolicyTest { |
3724 public: | 3722 public: |
3725 WebRtcUdpPortRangePolicyTest() = default; | 3723 WebRtcUdpPortRangePolicyTest() = default; |
3726 void SetUpInProcessBrowserTestFixture() override { | 3724 void SetUpInProcessBrowserTestFixture() override { |
3727 PolicyTest::SetUpInProcessBrowserTestFixture(); | 3725 PolicyTest::SetUpInProcessBrowserTestFixture(); |
3728 PolicyMap policies; | 3726 PolicyMap policies; |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4485 | 4483 |
4486 SetEmptyPolicy(); | 4484 SetEmptyPolicy(); |
4487 // Policy not set. | 4485 // Policy not set. |
4488 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4486 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
4489 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4487 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
4490 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4488 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
4491 } | 4489 } |
4492 #endif // defined(OS_CHROMEOS) | 4490 #endif // defined(OS_CHROMEOS) |
4493 | 4491 |
4494 } // namespace policy | 4492 } // namespace policy |
OLD | NEW |