| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "chromeos/settings/timezone_settings_helper.h" | 8 #include "chromeos/settings/timezone_settings_helper.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "third_party/icu/source/common/unicode/unistr.h" | 10 #include "third_party/icu/source/common/unicode/unistr.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 public: | 33 public: |
| 34 KnownTimeZoneTest() {} | 34 KnownTimeZoneTest() {} |
| 35 ~KnownTimeZoneTest() override {} | 35 ~KnownTimeZoneTest() override {} |
| 36 | 36 |
| 37 void SetUp() override { | 37 void SetUp() override { |
| 38 for (const char* id : kTimeZones) { | 38 for (const char* id : kTimeZones) { |
| 39 timezones_.push_back(TimeZone::createTimeZone(UnicodeString(id))); | 39 timezones_.push_back(TimeZone::createTimeZone(UnicodeString(id))); |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 | 42 |
| 43 void TearDown() override { STLDeleteElements(&timezones_); } | 43 void TearDown() override { base::STLDeleteElements(&timezones_); } |
| 44 | 44 |
| 45 protected: | 45 protected: |
| 46 std::vector<TimeZone*> timezones_; | 46 std::vector<TimeZone*> timezones_; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 TEST_F(KnownTimeZoneTest, IdMatch) { | 49 TEST_F(KnownTimeZoneTest, IdMatch) { |
| 50 static struct { | 50 static struct { |
| 51 const char* id; | 51 const char* id; |
| 52 const char* matched; | 52 const char* matched; |
| 53 } timezone_match_list[] = { | 53 } timezone_match_list[] = { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 for (const char* id : no_match_list) { | 97 for (const char* id : no_match_list) { |
| 98 std::unique_ptr<TimeZone> input( | 98 std::unique_ptr<TimeZone> input( |
| 99 TimeZone::createTimeZone(UnicodeString(id))); | 99 TimeZone::createTimeZone(UnicodeString(id))); |
| 100 EXPECT_EQ(NULL, GetKnownTimezoneOrNull(*input, timezones_)) | 100 EXPECT_EQ(NULL, GetKnownTimezoneOrNull(*input, timezones_)) |
| 101 << "input=" << id; | 101 << "input=" << id; |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace system | 105 } // namespace system |
| 106 } // namespace chromeos | 106 } // namespace chromeos |
| OLD | NEW |