| 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 3771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3855 EXPECT_TRUE(browser() | 3855 EXPECT_TRUE(browser() |
| 3856 ->tab_strip_model() | 3856 ->tab_strip_model() |
| 3857 ->GetActiveWebContents() | 3857 ->GetActiveWebContents() |
| 3858 ->ShowingInterstitialPage()); | 3858 ->ShowingInterstitialPage()); |
| 3859 } | 3859 } |
| 3860 | 3860 |
| 3861 // Test that TaskManager::IsEndProcessEnabled is controlled by | 3861 // Test that TaskManager::IsEndProcessEnabled is controlled by |
| 3862 // TaskManagerEndProcessEnabled policy | 3862 // TaskManagerEndProcessEnabled policy |
| 3863 IN_PROC_BROWSER_TEST_F(PolicyTest, TaskManagerEndProcessEnabled) { | 3863 IN_PROC_BROWSER_TEST_F(PolicyTest, TaskManagerEndProcessEnabled) { |
| 3864 // By default it's allowed to end tasks. | 3864 // By default it's allowed to end tasks. |
| 3865 EXPECT_TRUE(TaskManager::IsEndProcessEnabled()); | 3865 EXPECT_TRUE(task_management::TaskManagerInterface::IsEndProcessEnabled()); |
| 3866 | 3866 |
| 3867 // Disabling ending tasks in task manager by policy | 3867 // Disabling ending tasks in task manager by policy |
| 3868 PolicyMap policies1; | 3868 PolicyMap policies1; |
| 3869 policies1.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, | 3869 policies1.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, |
| 3870 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | 3870 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, |
| 3871 new base::FundamentalValue(false), nullptr); | 3871 new base::FundamentalValue(false), nullptr); |
| 3872 UpdateProviderPolicy(policies1); | 3872 UpdateProviderPolicy(policies1); |
| 3873 | 3873 |
| 3874 // Policy should not allow ending tasks anymore. | 3874 // Policy should not allow ending tasks anymore. |
| 3875 EXPECT_FALSE(TaskManager::IsEndProcessEnabled()); | 3875 EXPECT_FALSE(task_management::TaskManagerInterface::IsEndProcessEnabled()); |
| 3876 | 3876 |
| 3877 // Enabling ending tasks in task manager by policy | 3877 // Enabling ending tasks in task manager by policy |
| 3878 PolicyMap policies2; | 3878 PolicyMap policies2; |
| 3879 policies2.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, | 3879 policies2.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, |
| 3880 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | 3880 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, |
| 3881 new base::FundamentalValue(true), nullptr); | 3881 new base::FundamentalValue(true), nullptr); |
| 3882 UpdateProviderPolicy(policies2); | 3882 UpdateProviderPolicy(policies2); |
| 3883 | 3883 |
| 3884 // Policy should allow ending tasks again. | 3884 // Policy should allow ending tasks again. |
| 3885 EXPECT_TRUE(TaskManager::IsEndProcessEnabled()); | 3885 EXPECT_TRUE(task_management::TaskManagerInterface::IsEndProcessEnabled()); |
| 3886 } | 3886 } |
| 3887 | 3887 |
| 3888 #if !defined(OS_CHROMEOS) | 3888 #if !defined(OS_CHROMEOS) |
| 3889 // Similar to PolicyTest but sets the proper policy before the browser is | 3889 // Similar to PolicyTest but sets the proper policy before the browser is |
| 3890 // started. | 3890 // started. |
| 3891 class PolicyVariationsServiceTest : public PolicyTest { | 3891 class PolicyVariationsServiceTest : public PolicyTest { |
| 3892 public: | 3892 public: |
| 3893 void SetUpInProcessBrowserTestFixture() override { | 3893 void SetUpInProcessBrowserTestFixture() override { |
| 3894 PolicyTest::SetUpInProcessBrowserTestFixture(); | 3894 PolicyTest::SetUpInProcessBrowserTestFixture(); |
| 3895 PolicyMap policies; | 3895 PolicyMap policies; |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4257 | 4257 |
| 4258 SetEmptyPolicy(); | 4258 SetEmptyPolicy(); |
| 4259 // Policy not set. | 4259 // Policy not set. |
| 4260 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4260 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
| 4261 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4261 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
| 4262 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4262 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
| 4263 } | 4263 } |
| 4264 #endif // defined(OS_CHROMEOS) | 4264 #endif // defined(OS_CHROMEOS) |
| 4265 | 4265 |
| 4266 } // namespace policy | 4266 } // namespace policy |
| OLD | NEW |