Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: third_party/WebKit/Source/platform/LayoutLocaleTest.cpp

Issue 2715153003: Implement 'normal', 'strict', and 'loose' of the 'line-break' property (Closed)
Patch Set: Rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/LayoutLocale.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/LayoutLocaleTest.cpp
diff --git a/third_party/WebKit/Source/platform/LayoutLocaleTest.cpp b/third_party/WebKit/Source/platform/LayoutLocaleTest.cpp
index 7c5039344242573ab254d288e1f1c6012712ab32..5ce656e556601349ad3531f4b1d0e8d8003745f7 100644
--- a/third_party/WebKit/Source/platform/LayoutLocaleTest.cpp
+++ b/third_party/WebKit/Source/platform/LayoutLocaleTest.cpp
@@ -112,4 +112,27 @@ TEST(LayoutLocaleTest, ScriptTest) {
}
}
+TEST(LayoutLocaleTest, BreakKeyword) {
+ struct {
+ const char* expected;
+ const char* locale;
+ LineBreakIteratorMode mode;
+ } tests[] = {
+ {nullptr, nullptr, LineBreakIteratorMode::Default},
+ {"", "", LineBreakIteratorMode::Default},
+ {nullptr, nullptr, LineBreakIteratorMode::Strict},
+ {"", "", LineBreakIteratorMode::Strict},
+ {"ja", "ja", LineBreakIteratorMode::Default},
+ {"ja@lb=normal", "ja", LineBreakIteratorMode::Normal},
+ {"ja@lb=strict", "ja", LineBreakIteratorMode::Strict},
+ {"ja@lb=loose", "ja", LineBreakIteratorMode::Loose},
+ };
+ for (const auto& test : tests) {
+ RefPtr<LayoutLocale> locale = LayoutLocale::createForTesting(test.locale);
+ EXPECT_EQ(test.expected, locale->localeWithBreakKeyword(test.mode))
+ << String::format("'%s' with line-break %d should be '%s'", test.locale,
+ static_cast<int>(test.mode), test.expected);
+ }
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/LayoutLocale.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698