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

Unified Diff: chrome/test/data/webui/settings/date_time_page_tests.js

Issue 2683613003: MD Settings: Fix timezone autodetect policy indicator. (Closed)
Patch Set: Use getter instead of private state. 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 side-by-side diff with in-line comments
Download patch
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 7cf96a7794abc390bd77fd2c29aab763c8481650..b5889bf59276aacf6d2aef98148ccbb2a1c10bd6 100644
--- a/chrome/test/data/webui/settings/date_time_page_tests.js
+++ b/chrome/test/data/webui/settings/date_time_page_tests.js
@@ -121,11 +121,10 @@
if (policy) {
assertTrue(!!indicator);
- assertGT(indicator.clientHeight, 0);
+ assertTrue(indicator.isActive());
} else {
- // Indicator should be missing or hidden.
- if (indicator)
- assertEquals(0, indicator.clientHeight);
+ // Indicator should be missing dom-ifed out.
+ assertFalse(!!indicator);
}
assertEquals(policy, dateTime.$.timeZoneAutoDetect.disabled);
@@ -165,6 +164,7 @@
var prefs = getFakePrefs();
prefs.settings.resolve_timezone_by_geolocation.value = false;
dateTime = initializeDateTime(prefs, false);
+ cr.webUIListenerCallback('time-zone-auto-detect-policy', false);
assertTrue(dateTimePageReadyCalled);
assertTrue(getTimeZonesCalled);
@@ -186,6 +186,7 @@
var prefs = getFakePrefs();
prefs.settings.resolve_timezone_by_geolocation.value = false;
dateTime = initializeDateTime(prefs, true, true);
+ cr.webUIListenerCallback('time-zone-auto-detect-policy', true, true);
assertTrue(dateTimePageReadyCalled);
assertFalse(getTimeZonesCalled);
@@ -214,6 +215,7 @@
test('auto-detect forced off', function(done) {
var prefs = getFakePrefs();
dateTime = initializeDateTime(prefs, true, false);
+ cr.webUIListenerCallback('time-zone-auto-detect-policy', true, false);
assertTrue(dateTimePageReadyCalled);
assertTrue(getTimeZonesCalled);
@@ -238,6 +240,7 @@
test('set date and time button', function() {
dateTime = initializeDateTime(getFakePrefs(), false);
+ cr.webUIListenerCallback('time-zone-auto-detect-policy', false);
var showSetDateTimeUICalled = false;
registerMessageCallback('showSetDateTimeUI', null, function() {

Powered by Google App Engine
This is Rietveld 408576698