Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 2703283002: Revert of MD Settings: enable by default in client (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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"
35 #include "base/test/test_file_util.h" 34 #include "base/test/test_file_util.h"
36 #include "base/threading/sequenced_worker_pool.h" 35 #include "base/threading/sequenced_worker_pool.h"
37 #include "base/time/time.h" 36 #include "base/time/time.h"
38 #include "base/values.h" 37 #include "base/values.h"
39 #include "build/build_config.h" 38 #include "build/build_config.h"
40 #include "chrome/app/chrome_command_ids.h" 39 #include "chrome/app/chrome_command_ids.h"
41 #include "chrome/browser/background/background_contents_service.h" 40 #include "chrome/browser/background/background_contents_service.h"
42 #include "chrome/browser/browser_process.h" 41 #include "chrome/browser/browser_process.h"
43 #include "chrome/browser/chrome_notification_types.h" 42 #include "chrome/browser/chrome_notification_types.h"
44 #include "chrome/browser/component_updater/chrome_component_updater_configurator .h" 43 #include "chrome/browser/component_updater/chrome_component_updater_configurator .h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 #include "chrome/browser/translate/chrome_translate_client.h" 76 #include "chrome/browser/translate/chrome_translate_client.h"
78 #include "chrome/browser/translate/translate_service.h" 77 #include "chrome/browser/translate/translate_service.h"
79 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" 78 #include "chrome/browser/ui/bookmarks/bookmark_bar.h"
80 #include "chrome/browser/ui/browser.h" 79 #include "chrome/browser/ui/browser.h"
81 #include "chrome/browser/ui/browser_commands.h" 80 #include "chrome/browser/ui/browser_commands.h"
82 #include "chrome/browser/ui/browser_list.h" 81 #include "chrome/browser/ui/browser_list.h"
83 #include "chrome/browser/ui/browser_tabstrip.h" 82 #include "chrome/browser/ui/browser_tabstrip.h"
84 #include "chrome/browser/ui/browser_window.h" 83 #include "chrome/browser/ui/browser_window.h"
85 #include "chrome/browser/ui/location_bar/location_bar.h" 84 #include "chrome/browser/ui/location_bar/location_bar.h"
86 #include "chrome/browser/ui/tabs/tab_strip_model.h" 85 #include "chrome/browser/ui/tabs/tab_strip_model.h"
87 #include "chrome/common/chrome_features.h"
88 #include "chrome/common/chrome_paths.h" 86 #include "chrome/common/chrome_paths.h"
89 #include "chrome/common/chrome_switches.h" 87 #include "chrome/common/chrome_switches.h"
90 #include "chrome/common/extensions/extension_constants.h" 88 #include "chrome/common/extensions/extension_constants.h"
91 #include "chrome/common/pref_names.h" 89 #include "chrome/common/pref_names.h"
92 #include "chrome/common/url_constants.h" 90 #include "chrome/common/url_constants.h"
93 #include "chrome/grit/generated_resources.h" 91 #include "chrome/grit/generated_resources.h"
94 #include "chrome/test/base/in_process_browser_test.h" 92 #include "chrome/test/base/in_process_browser_test.h"
95 #include "chrome/test/base/search_test_utils.h" 93 #include "chrome/test/base/search_test_utils.h"
96 #include "chrome/test/base/ui_test_utils.h" 94 #include "chrome/test/base/ui_test_utils.h"
97 #include "components/bookmarks/common/bookmark_pref_names.h" 95 #include "components/bookmarks/common/bookmark_pref_names.h"
(...skipping 4249 matching lines...) Expand 10 before | Expand all | Expand 10 after
4347 return checker.GetBool(expression); 4345 return checker.GetBool(expression);
4348 } 4346 }
4349 4347
4350 private: 4348 private:
4351 chromeos::test::JSChecker checker; 4349 chromeos::test::JSChecker checker;
4352 4350
4353 DISALLOW_COPY_AND_ASSIGN(ChromeOSPolicyTest); 4351 DISALLOW_COPY_AND_ASSIGN(ChromeOSPolicyTest);
4354 }; 4352 };
4355 4353
4356 IN_PROC_BROWSER_TEST_F(ChromeOSPolicyTest, SystemTimezoneAutomaticDetection) { 4354 IN_PROC_BROWSER_TEST_F(ChromeOSPolicyTest, SystemTimezoneAutomaticDetection) {
4357 base::test::ScopedFeatureList disable_md_settings;
4358 disable_md_settings.InitAndDisableFeature(features::kMaterialDesignSettings);
4359
4360 ui_test_utils::NavigateToURL(browser(), GURL("chrome://settings")); 4355 ui_test_utils::NavigateToURL(browser(), GURL("chrome://settings"));
4361 chromeos::system::TimeZoneResolverManager* manager = 4356 chromeos::system::TimeZoneResolverManager* manager =
4362 g_browser_process->platform_part()->GetTimezoneResolverManager(); 4357 g_browser_process->platform_part()->GetTimezoneResolverManager();
4363 4358
4364 // Policy not set. 4359 // Policy not set.
4365 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4360 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4366 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4361 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4367 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4362 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4368 4363
4369 int policy_value = 0 /* USERS_DECIDE */; 4364 int policy_value = 0 /* USERS_DECIDE */;
(...skipping 28 matching lines...) Expand all
4398 4393
4399 SetEmptyPolicy(); 4394 SetEmptyPolicy();
4400 // Policy not set. 4395 // Policy not set.
4401 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4396 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4402 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4397 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4403 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4398 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4404 } 4399 }
4405 #endif // defined(OS_CHROMEOS) 4400 #endif // defined(OS_CHROMEOS)
4406 4401
4407 } // namespace policy 4402 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698