Flutter Engine
runner_unittest.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include <gtest/gtest.h>
6 
7 #include "runner.h"
8 #include "third_party/icu/source/i18n/unicode/timezone.h"
9 
10 namespace flutter_runner {
11 
12 TEST(RunnerTest, TZData) {
13  UErrorCode err = U_ZERO_ERROR;
14  const auto version_before = std::string(icu::TimeZone::getTZDataVersion(err));
15  ASSERT_EQ(U_ZERO_ERROR, err) << "unicode error: " << u_errorName(err);
16 
17  // This loads the tzdata. In Fuchsia, we force the data from this package
18  // to be version 2019a, so that we can test the resource load.
19  bool success = Runner::SetupICUInternal();
20  ASSERT_TRUE(success) << "failed to load timezone data";
21 
22  const auto version_after = std::string(icu::TimeZone::getTZDataVersion(err));
23  ASSERT_EQ(U_ZERO_ERROR, err) << "unicode error: " << u_errorName(err);
24 
25  EXPECT_EQ("2019a", version_after);
26 }
27 
28 } // namespace flutter_runner
TEST(RunnerTZDataTest, LoadsWithoutTZDataPresent)