Commit 24c35819 authored by Matt Giuca's avatar Matt Giuca Committed by Commit Bot

Revert "Handle empty timezone on in-session set date time dialog"

This reverts commit 4ccdb965.

Reason for revert: https://crbug.com/990203 (introduces a flaky test that fails at certain times of day)

Original change's description:
> Handle empty timezone on in-session set date time dialog
> 
> Bug: 988107
> Change-Id: Ia9c12a9342342bc080f73ddbe5ba86531b29997e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1724696
> Reviewed-by: Michael Giuffrida <michaelpg@chromium.org>
> Reviewed-by: Aga Wronska <agawronska@chromium.org>
> Commit-Queue: Henrique Grandinetti <hgrandinetti@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#683159}

TBR=michaelpg@chromium.org,agawronska@chromium.org,hgrandinetti@chromium.org

Change-Id: I73c1230760be4eda32238fe9cacf8255fa56f15e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 988107, 990203
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1732074Reviewed-by: default avatarMatt Giuca <mgiuca@chromium.org>
Commit-Queue: Matt Giuca <mgiuca@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683444}
parent df2a6219
......@@ -267,15 +267,11 @@ Polymer({
applyTime_: function() {
const now = this.getInputTime_();
if (this.isTimezoneVisible_) {
// Add timezone offset to get real time. This is only necessary when the
// timezone was updated, which is only possible when the dropdown is
// visible.
const timezoneDelta = getTimezoneDelta(
/** @type {string} */ (loadTimeData.getValue('currentTimezoneId')),
this.selectedTimezone_);
now.setMilliseconds(now.getMilliseconds() + timezoneDelta);
}
// Add timezone offset to get real time.
const timezoneDelta = getTimezoneDelta(
/** @type {string} */ (loadTimeData.getValue('currentTimezoneId')),
this.selectedTimezone_);
now.setMilliseconds(now.getMilliseconds() + timezoneDelta);
const seconds = Math.floor(now / 1000);
this.browserProxy_.setTimeInSeconds(seconds);
......
......@@ -187,38 +187,6 @@ TEST_F('SetTimeDialogBrowserTest', 'All', function() {
assertGT(timeInSeconds, todaySeconds);
});
});
suite('NullTimezone', () => {
suiteSetup(() => {
loadTimeData.overrideValues({
currentTimezoneId: '',
timezoneList: [],
});
});
test('SetDateNullTimezone', () => {
const dateInput = setTimeElement.$$('#dateInput');
assertTrue(!!dateInput);
assertEquals(null, setTimeElement.$$('#timezoneSelect'));
// Simulate the user changing the date picker backward by one hour.
const today = dateInput.valueAsDate;
const nextWeek = new Date(today.getTime() - 60 * 60 * 1000);
dateInput.focus();
dateInput.valueAsDate = nextWeek;
setTimeElement.$$('#doneButton').click();
// Verify the page sends a request to move time backward.
return testBrowserProxy.whenCalled('setTimeInSeconds')
.then(timeInSeconds => {
const todaySeconds = today.getTime() / 1000;
// The exact value isn't important (it depends on the current
// time).
assertGT(todaySeconds, timeInSeconds);
});
});
});
});
mocha.run();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment