| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "platform/LayoutLocale.h" | 5 #include "platform/LayoutLocale.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 {"ja@lb=loose", "ja", LineBreakIteratorMode::Loose}, | 128 {"ja@lb=loose", "ja", LineBreakIteratorMode::Loose}, |
| 129 }; | 129 }; |
| 130 for (const auto& test : tests) { | 130 for (const auto& test : tests) { |
| 131 RefPtr<LayoutLocale> locale = LayoutLocale::createForTesting(test.locale); | 131 RefPtr<LayoutLocale> locale = LayoutLocale::createForTesting(test.locale); |
| 132 EXPECT_EQ(test.expected, locale->localeWithBreakKeyword(test.mode)) | 132 EXPECT_EQ(test.expected, locale->localeWithBreakKeyword(test.mode)) |
| 133 << String::format("'%s' with line-break %d should be '%s'", test.locale, | 133 << String::format("'%s' with line-break %d should be '%s'", test.locale, |
| 134 static_cast<int>(test.mode), test.expected); | 134 static_cast<int>(test.mode), test.expected); |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 | 137 |
| 138 TEST(LayoutLocaleTest, ExistingKeywordName) { |
| 139 const char* tests[] = { |
| 140 "en@x=", "en@lb=xyz", "en@ =", |
| 141 }; |
| 142 for (const auto& test : tests) { |
| 143 RefPtr<LayoutLocale> locale = LayoutLocale::createForTesting(test); |
| 144 EXPECT_EQ(test, |
| 145 locale->localeWithBreakKeyword(LineBreakIteratorMode::Normal)); |
| 146 } |
| 147 } |
| 148 |
| 138 } // namespace blink | 149 } // namespace blink |
| OLD | NEW |