| 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 13 matching lines...) Expand all Loading... |
| 24 #include "base/macros.h" | 24 #include "base/macros.h" |
| 25 #include "base/memory/ptr_util.h" | 25 #include "base/memory/ptr_util.h" |
| 26 #include "base/memory/ref_counted.h" | 26 #include "base/memory/ref_counted.h" |
| 27 #include "base/path_service.h" | 27 #include "base/path_service.h" |
| 28 #include "base/run_loop.h" | 28 #include "base/run_loop.h" |
| 29 #include "base/strings/string16.h" | 29 #include "base/strings/string16.h" |
| 30 #include "base/strings/string_number_conversions.h" | 30 #include "base/strings/string_number_conversions.h" |
| 31 #include "base/strings/string_util.h" | 31 #include "base/strings/string_util.h" |
| 32 #include "base/strings/stringprintf.h" | 32 #include "base/strings/stringprintf.h" |
| 33 #include "base/strings/utf_string_conversions.h" | 33 #include "base/strings/utf_string_conversions.h" |
| 34 #include "base/test/scoped_feature_list.h" |
| 34 #include "base/test/test_file_util.h" | 35 #include "base/test/test_file_util.h" |
| 35 #include "base/threading/sequenced_worker_pool.h" | 36 #include "base/threading/sequenced_worker_pool.h" |
| 36 #include "base/time/time.h" | 37 #include "base/time/time.h" |
| 37 #include "base/values.h" | 38 #include "base/values.h" |
| 38 #include "build/build_config.h" | 39 #include "build/build_config.h" |
| 39 #include "chrome/app/chrome_command_ids.h" | 40 #include "chrome/app/chrome_command_ids.h" |
| 40 #include "chrome/browser/background/background_contents_service.h" | 41 #include "chrome/browser/background/background_contents_service.h" |
| 41 #include "chrome/browser/browser_process.h" | 42 #include "chrome/browser/browser_process.h" |
| 42 #include "chrome/browser/chrome_notification_types.h" | 43 #include "chrome/browser/chrome_notification_types.h" |
| 43 #include "chrome/browser/component_updater/chrome_component_updater_configurator
.h" | 44 #include "chrome/browser/component_updater/chrome_component_updater_configurator
.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 #include "chrome/browser/translate/chrome_translate_client.h" | 77 #include "chrome/browser/translate/chrome_translate_client.h" |
| 77 #include "chrome/browser/translate/translate_service.h" | 78 #include "chrome/browser/translate/translate_service.h" |
| 78 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 79 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
| 79 #include "chrome/browser/ui/browser.h" | 80 #include "chrome/browser/ui/browser.h" |
| 80 #include "chrome/browser/ui/browser_commands.h" | 81 #include "chrome/browser/ui/browser_commands.h" |
| 81 #include "chrome/browser/ui/browser_list.h" | 82 #include "chrome/browser/ui/browser_list.h" |
| 82 #include "chrome/browser/ui/browser_tabstrip.h" | 83 #include "chrome/browser/ui/browser_tabstrip.h" |
| 83 #include "chrome/browser/ui/browser_window.h" | 84 #include "chrome/browser/ui/browser_window.h" |
| 84 #include "chrome/browser/ui/location_bar/location_bar.h" | 85 #include "chrome/browser/ui/location_bar/location_bar.h" |
| 85 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 86 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 87 #include "chrome/common/chrome_features.h" |
| 86 #include "chrome/common/chrome_paths.h" | 88 #include "chrome/common/chrome_paths.h" |
| 87 #include "chrome/common/chrome_switches.h" | 89 #include "chrome/common/chrome_switches.h" |
| 88 #include "chrome/common/extensions/extension_constants.h" | 90 #include "chrome/common/extensions/extension_constants.h" |
| 89 #include "chrome/common/pref_names.h" | 91 #include "chrome/common/pref_names.h" |
| 90 #include "chrome/common/url_constants.h" | 92 #include "chrome/common/url_constants.h" |
| 91 #include "chrome/grit/generated_resources.h" | 93 #include "chrome/grit/generated_resources.h" |
| 92 #include "chrome/test/base/in_process_browser_test.h" | 94 #include "chrome/test/base/in_process_browser_test.h" |
| 93 #include "chrome/test/base/search_test_utils.h" | 95 #include "chrome/test/base/search_test_utils.h" |
| 94 #include "chrome/test/base/ui_test_utils.h" | 96 #include "chrome/test/base/ui_test_utils.h" |
| 95 #include "components/bookmarks/common/bookmark_pref_names.h" | 97 #include "components/bookmarks/common/bookmark_pref_names.h" |
| (...skipping 4261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4357 return checker.GetBool(expression); | 4359 return checker.GetBool(expression); |
| 4358 } | 4360 } |
| 4359 | 4361 |
| 4360 private: | 4362 private: |
| 4361 chromeos::test::JSChecker checker; | 4363 chromeos::test::JSChecker checker; |
| 4362 | 4364 |
| 4363 DISALLOW_COPY_AND_ASSIGN(ChromeOSPolicyTest); | 4365 DISALLOW_COPY_AND_ASSIGN(ChromeOSPolicyTest); |
| 4364 }; | 4366 }; |
| 4365 | 4367 |
| 4366 IN_PROC_BROWSER_TEST_F(ChromeOSPolicyTest, SystemTimezoneAutomaticDetection) { | 4368 IN_PROC_BROWSER_TEST_F(ChromeOSPolicyTest, SystemTimezoneAutomaticDetection) { |
| 4369 base::test::ScopedFeatureList disable_md_settings; |
| 4370 disable_md_settings.InitAndDisableFeature(features::kMaterialDesignSettings); |
| 4371 |
| 4367 ui_test_utils::NavigateToURL(browser(), GURL("chrome://settings")); | 4372 ui_test_utils::NavigateToURL(browser(), GURL("chrome://settings")); |
| 4368 chromeos::system::TimeZoneResolverManager* manager = | 4373 chromeos::system::TimeZoneResolverManager* manager = |
| 4369 g_browser_process->platform_part()->GetTimezoneResolverManager(); | 4374 g_browser_process->platform_part()->GetTimezoneResolverManager(); |
| 4370 | 4375 |
| 4371 // Policy not set. | 4376 // Policy not set. |
| 4372 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4377 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
| 4373 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4378 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
| 4374 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4379 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
| 4375 | 4380 |
| 4376 int policy_value = 0 /* USERS_DECIDE */; | 4381 int policy_value = 0 /* USERS_DECIDE */; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 4405 | 4410 |
| 4406 SetEmptyPolicy(); | 4411 SetEmptyPolicy(); |
| 4407 // Policy not set. | 4412 // Policy not set. |
| 4408 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4413 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
| 4409 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4414 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
| 4410 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4415 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
| 4411 } | 4416 } |
| 4412 #endif // defined(OS_CHROMEOS) | 4417 #endif // defined(OS_CHROMEOS) |
| 4413 | 4418 |
| 4414 } // namespace policy | 4419 } // namespace policy |
| OLD | NEW |