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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/shared_options_browsertest.cc

Issue 944593002: ChromeOS: Update browser option UI for automatic timezone detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed SharedOptionsTest. Created 5 years, 9 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
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/date_time_options_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/chromeos/login/login_manager_test.h" 9 #include "chrome/browser/chromeos/login/login_manager_test.h"
10 #include "chrome/browser/chromeos/login/startup_utils.h" 10 #include "chrome/browser/chromeos/login/startup_utils.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 protected: 112 protected:
113 void CheckOptionsUI(const user_manager::User* user, 113 void CheckOptionsUI(const user_manager::User* user,
114 bool is_owner, 114 bool is_owner,
115 bool is_primary) { 115 bool is_primary) {
116 Browser* browser = CreateBrowserForUser(user); 116 Browser* browser = CreateBrowserForUser(user);
117 content::WebContents* contents = 117 content::WebContents* contents =
118 browser->tab_strip_model()->GetActiveWebContents(); 118 browser->tab_strip_model()->GetActiveWebContents();
119 119
120 for (size_t i = 0; i < sizeof(kPrefTests) / sizeof(kPrefTests[0]); i++) { 120 for (size_t i = 0; i < sizeof(kPrefTests) / sizeof(kPrefTests[0]); i++) {
121 CheckPreference(contents, 121 bool disabled = !is_owner && kPrefTests[i].owner_only;
122 kPrefTests[i].pref_name, 122 if (strcmp(kPrefTests[i].pref_name, kSystemTimezone) == 0) {
123 !is_owner && kPrefTests[i].owner_only, 123 disabled = ProfileHelper::Get()
124 !is_owner && kPrefTests[i].indicator ? "owner" : 124 ->GetProfileByUserUnsafe(user)
125 std::string()); 125 ->GetPrefs()
126 ->GetBoolean(prefs::kResolveTimezoneByGeolocation);
127 }
128
129 CheckPreference(
130 contents, kPrefTests[i].pref_name, disabled,
131 !is_owner && kPrefTests[i].indicator ? "owner" : std::string());
126 } 132 }
127 CheckBanner(contents, is_primary); 133 CheckBanner(contents, is_primary);
128 CheckSharedSections(contents, is_primary); 134 CheckSharedSections(contents, is_primary);
129 CheckAccountsOverlay(contents, is_owner); 135 CheckAccountsOverlay(contents, is_owner);
130 } 136 }
131 137
132 // Creates a browser and navigates to the Settings page. 138 // Creates a browser and navigates to the Settings page.
133 Browser* CreateBrowserForUser(const user_manager::User* user) { 139 Browser* CreateBrowserForUser(const user_manager::User* user) {
134 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); 140 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user);
135 SigninManagerFactory::GetForProfile(profile)-> 141 SigninManagerFactory::GetForProfile(profile)->
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 content::WaitForLoadStop(contents); 428 content::WaitForLoadStop(contents);
423 { 429 {
424 SCOPED_TRACE("Screen lock false for both users"); 430 SCOPED_TRACE("Screen lock false for both users");
425 expected_value = false; 431 expected_value = false;
426 CheckBooleanPreference(contents, prefs::kEnableAutoScreenLock, disabled, 432 CheckBooleanPreference(contents, prefs::kEnableAutoScreenLock, disabled,
427 empty_controlled, expected_value); 433 empty_controlled, expected_value);
428 } 434 }
429 } 435 }
430 436
431 } // namespace chromeos 437 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/date_time_options_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698