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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/date_time_page_tests.js
diff --git a/chrome/test/data/webui/settings/date_time_page_tests.js b/chrome/test/data/webui/settings/date_time_page_tests.js
index c1eb83cf319886d51e104ec701eb4962990e4cb1..c88bc51e0b9b6479dfa7c30f34be4fbb896590b2 100644
--- a/chrome/test/data/webui/settings/date_time_page_tests.js
+++ b/chrome/test/data/webui/settings/date_time_page_tests.js
@@ -235,5 +235,30 @@
done();
});
});
+
+ test('set date and time button', function() {
+ dateTime = initializeDateTime(getFakePrefs(), false);
+
+ var showSetDateTimeUICalled = false;
+ registerMessageCallback('showSetDateTimeUI', null, function() {
+ assertFalse(showSetDateTimeUICalled);
+ showSetDateTimeUICalled = true;
+ });
+
+ var setDateTimeButton = dateTime.$.setDateTime;
+ assertEquals(0, setDateTimeButton.offsetHeight);
+
+ // Make the date and time editable.
+ cr.webUIListenerCallback('can-set-date-time-changed', true);
+ assertGT(setDateTimeButton.offsetHeight, 0);
+
+ assertFalse(showSetDateTimeUICalled);
+ MockInteractions.tap(setDateTimeButton);
+ assertTrue(showSetDateTimeUICalled);
+
+ // Make the date and time not editable.
+ cr.webUIListenerCallback('can-set-date-time-changed', false);
+ assertEquals(setDateTimeButton.offsetHeight, 0);
+ });
});
})();
« 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