| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 #include "chrome/browser/policy/cloud/test_request_interceptor.h" | 63 #include "chrome/browser/policy/cloud/test_request_interceptor.h" |
| 64 #include "chrome/browser/policy/profile_policy_connector.h" | 64 #include "chrome/browser/policy/profile_policy_connector.h" |
| 65 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 65 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 66 #include "chrome/browser/prefs/session_startup_pref.h" | 66 #include "chrome/browser/prefs/session_startup_pref.h" |
| 67 #include "chrome/browser/profiles/profile.h" | 67 #include "chrome/browser/profiles/profile.h" |
| 68 #include "chrome/browser/search/instant_service.h" | 68 #include "chrome/browser/search/instant_service.h" |
| 69 #include "chrome/browser/search/instant_service_factory.h" | 69 #include "chrome/browser/search/instant_service_factory.h" |
| 70 #include "chrome/browser/search/search.h" | 70 #include "chrome/browser/search/search.h" |
| 71 #include "chrome/browser/search_engines/template_url_service_factory.h" | 71 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 72 #include "chrome/browser/ssl/ssl_blocking_page.h" | 72 #include "chrome/browser/ssl/ssl_blocking_page.h" |
| 73 #include "chrome/browser/task_manager/task_manager.h" | 73 #include "chrome/browser/task_management/task_manager_interface.h" |
| 74 #include "chrome/browser/translate/chrome_translate_client.h" | 74 #include "chrome/browser/translate/chrome_translate_client.h" |
| 75 #include "chrome/browser/translate/cld_data_harness.h" | 75 #include "chrome/browser/translate/cld_data_harness.h" |
| 76 #include "chrome/browser/translate/cld_data_harness_factory.h" | 76 #include "chrome/browser/translate/cld_data_harness_factory.h" |
| 77 #include "chrome/browser/translate/translate_service.h" | 77 #include "chrome/browser/translate/translate_service.h" |
| 78 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 78 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
| 79 #include "chrome/browser/ui/browser.h" | 79 #include "chrome/browser/ui/browser.h" |
| 80 #include "chrome/browser/ui/browser_commands.h" | 80 #include "chrome/browser/ui/browser_commands.h" |
| 81 #include "chrome/browser/ui/browser_list.h" | 81 #include "chrome/browser/ui/browser_list.h" |
| 82 #include "chrome/browser/ui/browser_tabstrip.h" | 82 #include "chrome/browser/ui/browser_tabstrip.h" |
| 83 #include "chrome/browser/ui/browser_window.h" | 83 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 3556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3640 static_cast<SSLBlockingPage*>(interstitial_delegate); | 3640 static_cast<SSLBlockingPage*>(interstitial_delegate); |
| 3641 ssl_delegate->CommandReceived( | 3641 ssl_delegate->CommandReceived( |
| 3642 base::IntToString(security_interstitials::CMD_PROCEED)); | 3642 base::IntToString(security_interstitials::CMD_PROCEED)); |
| 3643 EXPECT_TRUE(interstitial); | 3643 EXPECT_TRUE(interstitial); |
| 3644 EXPECT_TRUE(browser() | 3644 EXPECT_TRUE(browser() |
| 3645 ->tab_strip_model() | 3645 ->tab_strip_model() |
| 3646 ->GetActiveWebContents() | 3646 ->GetActiveWebContents() |
| 3647 ->ShowingInterstitialPage()); | 3647 ->ShowingInterstitialPage()); |
| 3648 } | 3648 } |
| 3649 | 3649 |
| 3650 // Test that TaskManager::IsEndProcessEnabled is controlled by | 3650 // Test that TaskManagerInterface::IsEndProcessEnabled is controlled by |
| 3651 // TaskManagerEndProcessEnabled policy | 3651 // TaskManagerEndProcessEnabled policy |
| 3652 IN_PROC_BROWSER_TEST_F(PolicyTest, TaskManagerEndProcessEnabled) { | 3652 IN_PROC_BROWSER_TEST_F(PolicyTest, TaskManagerEndProcessEnabled) { |
| 3653 // By default it's allowed to end tasks. | 3653 // By default it's allowed to end tasks. |
| 3654 EXPECT_TRUE(TaskManager::IsEndProcessEnabled()); | 3654 EXPECT_TRUE(task_management::TaskManagerInterface::IsEndProcessEnabled()); |
| 3655 | 3655 |
| 3656 // Disabling ending tasks in task manager by policy | 3656 // Disabling ending tasks in task manager by policy |
| 3657 PolicyMap policies1; | 3657 PolicyMap policies1; |
| 3658 policies1.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, | 3658 policies1.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, |
| 3659 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | 3659 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, |
| 3660 base::WrapUnique(new base::FundamentalValue(false)), nullptr); | 3660 base::WrapUnique(new base::FundamentalValue(false)), nullptr); |
| 3661 UpdateProviderPolicy(policies1); | 3661 UpdateProviderPolicy(policies1); |
| 3662 | 3662 |
| 3663 // Policy should not allow ending tasks anymore. | 3663 // Policy should not allow ending tasks anymore. |
| 3664 EXPECT_FALSE(TaskManager::IsEndProcessEnabled()); | 3664 EXPECT_FALSE(task_management::TaskManagerInterface::IsEndProcessEnabled()); |
| 3665 | 3665 |
| 3666 // Enabling ending tasks in task manager by policy | 3666 // Enabling ending tasks in task manager by policy |
| 3667 PolicyMap policies2; | 3667 PolicyMap policies2; |
| 3668 policies2.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, | 3668 policies2.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, |
| 3669 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | 3669 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, |
| 3670 base::WrapUnique(new base::FundamentalValue(true)), nullptr); | 3670 base::WrapUnique(new base::FundamentalValue(true)), nullptr); |
| 3671 UpdateProviderPolicy(policies2); | 3671 UpdateProviderPolicy(policies2); |
| 3672 | 3672 |
| 3673 // Policy should allow ending tasks again. | 3673 // Policy should allow ending tasks again. |
| 3674 EXPECT_TRUE(TaskManager::IsEndProcessEnabled()); | 3674 EXPECT_TRUE(task_management::TaskManagerInterface::IsEndProcessEnabled()); |
| 3675 } | 3675 } |
| 3676 | 3676 |
| 3677 #if !defined(OS_CHROMEOS) | 3677 #if !defined(OS_CHROMEOS) |
| 3678 // Similar to PolicyTest but sets the proper policy before the browser is | 3678 // Similar to PolicyTest but sets the proper policy before the browser is |
| 3679 // started. | 3679 // started. |
| 3680 class PolicyVariationsServiceTest : public PolicyTest { | 3680 class PolicyVariationsServiceTest : public PolicyTest { |
| 3681 public: | 3681 public: |
| 3682 void SetUpInProcessBrowserTestFixture() override { | 3682 void SetUpInProcessBrowserTestFixture() override { |
| 3683 PolicyTest::SetUpInProcessBrowserTestFixture(); | 3683 PolicyTest::SetUpInProcessBrowserTestFixture(); |
| 3684 PolicyMap policies; | 3684 PolicyMap policies; |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4031 | 4031 |
| 4032 SetEmptyPolicy(); | 4032 SetEmptyPolicy(); |
| 4033 // Policy not set. | 4033 // Policy not set. |
| 4034 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4034 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
| 4035 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4035 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
| 4036 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4036 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
| 4037 } | 4037 } |
| 4038 #endif // defined(OS_CHROMEOS) | 4038 #endif // defined(OS_CHROMEOS) |
| 4039 | 4039 |
| 4040 } // namespace policy | 4040 } // namespace policy |
| OLD | NEW |