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

Side by Side Diff: third_party/WebKit/Source/platform/LayoutLocaleTest.cpp

Issue 2753493002: Merge 3029: Avoid uloc_setKeywordValue if the locale contains "@" (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/LayoutLocale.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« 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