Chromium Code Reviews| 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..118a37624f9ddb3c4e11b6b03538585cb77e8bca 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,13 @@ |
| if (policy) { |
| assertTrue(!!indicator); |
| - assertGT(indicator.clientHeight, 0); |
|
michaelpg
2017/02/08 00:07:12
would indicator.$$('iron-icon').clientHeight be su
dpapad
2017/02/08 01:53:50
Actually it is not at all robust. Here is why:
Th
michaelpg
2017/02/08 02:24:25
Jeez. Can't wait to get rid of those iron-flex glo
dpapad
2017/02/08 22:03:40
> Can you add a TODO to replace these checks with
michaelpg
2017/02/09 22:09:02
SGTM.
|
| + assertNotEquals('none', indicator.style.display); |
|
michaelpg
2017/02/08 00:07:12
generally we should check getComputedStyle, becaus
dpapad
2017/02/08 01:53:50
Tried getComputedStyle() and it throws
TypeError
michaelpg
2017/02/08 02:24:25
Yeah I'm at a loss there.
|
| + assertTrue(!!indicator.$$('iron-icon')); |
|
Dan Beam
2017/02/08 02:14:23
why are we looking into indicator itself?
dpapad
2017/02/08 02:26:35
In lack of a better way to verify if the on/off st
dpapad
2017/02/08 19:18:34
@dbeam PTAL: I added an isActive() method on cr-po
|
| + assertFalse(indicator.$$('iron-icon').hidden); |
| } else { |
| // Indicator should be missing or hidden. |
| if (indicator) |
| - assertEquals(0, indicator.clientHeight); |
| + assertEquals('none', indicator.style.display); |
| } |
| assertEquals(policy, dateTime.$.timeZoneAutoDetect.disabled); |
| @@ -165,6 +167,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 +189,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 +218,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 +243,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() { |