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

Side by Side Diff: chrome/test/data/webui/settings/date_time_page_tests.js

Issue 2447343002: MD Settings: Show "Set date and time" button when relevant (Closed)
Patch Set: rebase Created 4 years, 1 month 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/settings/md_settings_localized_strings_provider.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 (function() { 5 (function() {
6 function getFakePrefs() { 6 function getFakePrefs() {
7 return { 7 return {
8 cros: { 8 cros: {
9 system: { 9 system: {
10 timezone: { 10 timezone: {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 cr.webUIListenerCallback('time-zone-auto-detect-policy', false); 228 cr.webUIListenerCallback('time-zone-auto-detect-policy', false);
229 verifyAutoDetectSetting(true); 229 verifyAutoDetectSetting(true);
230 verifyPolicy(false); 230 verifyPolicy(false);
231 231
232 // User can disable auto-detect. 232 // User can disable auto-detect.
233 MockInteractions.tap(dateTime.$.timeZoneAutoDetectCheckbox); 233 MockInteractions.tap(dateTime.$.timeZoneAutoDetectCheckbox);
234 verifyAutoDetectSetting(false); 234 verifyAutoDetectSetting(false);
235 done(); 235 done();
236 }); 236 });
237 }); 237 });
238
239 test('set date and time button', function() {
240 dateTime = initializeDateTime(getFakePrefs(), false);
241
242 var showSetDateTimeUICalled = false;
243 registerMessageCallback('showSetDateTimeUI', null, function() {
244 assertFalse(showSetDateTimeUICalled);
245 showSetDateTimeUICalled = true;
246 });
247
248 var setDateTimeButton = dateTime.$.setDateTime;
249 assertEquals(0, setDateTimeButton.offsetHeight);
250
251 // Make the date and time editable.
252 cr.webUIListenerCallback('can-set-date-time-changed', true);
253 assertGT(setDateTimeButton.offsetHeight, 0);
254
255 assertFalse(showSetDateTimeUICalled);
256 MockInteractions.tap(setDateTimeButton);
257 assertTrue(showSetDateTimeUICalled);
258
259 // Make the date and time not editable.
260 cr.webUIListenerCallback('can-set-date-time-changed', false);
261 assertEquals(setDateTimeButton.offsetHeight, 0);
262 });
238 }); 263 });
239 })(); 264 })();
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698