Backed out changeset 6a6f56d7cd12 (bug 1947875) for causing gtest failures @AppDateTimeFormat.
This commit is contained in:
@@ -73,6 +73,7 @@ nsresult AppDateTimeFormat::Format(const DateTimeFormat::ComponentsBag& aBag,
|
||||
|
||||
aStringOut.Truncate();
|
||||
|
||||
nsAutoCString str;
|
||||
nsAutoString timeZoneID;
|
||||
BuildTimeZoneString(aExplodedTime->tm_params, timeZoneID);
|
||||
|
||||
@@ -81,8 +82,7 @@ nsresult AppDateTimeFormat::Format(const DateTimeFormat::ComponentsBag& aBag,
|
||||
auto dateTimePatternGenerator = genResult.unwrap();
|
||||
|
||||
auto result = DateTimeFormat::TryCreateFromComponents(
|
||||
*sLocale, aBag, dateTimePatternGenerator.get(),
|
||||
Some(Span<const char16_t>(timeZoneID.Data(), timeZoneID.Length())));
|
||||
*sLocale, aBag, dateTimePatternGenerator.get(), Some(timeZoneID));
|
||||
NS_ENSURE_TRUE(result.isOk(), NS_ERROR_FAILURE);
|
||||
auto dateTimeFormat = result.unwrap();
|
||||
|
||||
|
||||
@@ -99,15 +99,6 @@ TEST(AppDateTimeFormat, FormatPRExplodedTime)
|
||||
ASSERT_TRUE(formattedTime.Find(u"2:47:00 PM") != kNotFound ||
|
||||
formattedTime.Find(u"2:47:00\u202FPM") != kNotFound ||
|
||||
formattedTime.Find(u"14:47:00") != kNotFound);
|
||||
|
||||
ComponentsBag components{};
|
||||
components.weekday = mozilla::Some(DateTimeFormat::Text::Short);
|
||||
components.timeZoneName = mozilla::Some(DateTimeFormat::TimeZoneName::Short);
|
||||
// From above: Wed, 31 Dec 1969 14:47:00 -09:13
|
||||
rv = AppDateTimeFormat::Format(components, &prExplodedTime, formattedTime);
|
||||
ASSERT_NS_SUCCEEDED(rv);
|
||||
ASSERT_TRUE(formattedTime.Find(u"Wed") != kNotFound);
|
||||
ASSERT_TRUE(formattedTime.Find(u"-09:13") != kNotFound);
|
||||
}
|
||||
|
||||
TEST(AppDateTimeFormat, DateFormatSelectors)
|
||||
|
||||
Reference in New Issue
Block a user