Bug 1577371 - Fix timezone range check in TelemetrySession unit test. r=chutten

Differential Revision: https://phabricator.services.mozilla.com/D51032

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ben Campbell 2019-10-30 16:04:09 +00:00
Родитель 733a6ca66b
Коммит 4971fdeb88
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -266,12 +266,17 @@ function checkPayloadInfo(data, reason) {
Date.parse(data.subsessionStartDate) >= Date.parse(data.sessionStartDate)
);
Assert.ok(data.profileSubsessionCounter >= data.subsessionCounter);
// According to https://en.wikipedia.org/wiki/List_of_UTC_time_offsets,
// UTC offsets range from -12 to +14 hours.
// Don't think the extremes of the range are affected by further
// daylight-savings adjustments, but it is possible.
Assert.ok(
data.timezoneOffset >= -12 * 60,
"The timezone must be in a valid range."
);
Assert.ok(
data.timezoneOffset <= 12 * 60,
data.timezoneOffset <= 14 * 60,
"The timezone must be in a valid range."
);
}