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

Side by Side Diff: third_party/WebKit/Source/platform/text/HyphenationTest.cpp

Issue 1978683002: Enable hyphens: auto and none in BreakingContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments for heuristic, adjust widths of hyphens-auto-mock test Created 4 years, 7 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/text/Hyphenation.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/text/Hyphenation.h" 5 #include "platform/text/Hyphenation.h"
6 6
7 #include "platform/Logging.h" 7 #include "platform/Logging.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 class NoHyphenation : public Hyphenation { 12 class NoHyphenation : public Hyphenation {
13 public: 13 public:
14 size_t lastHyphenLocation(const StringView&, size_t beforeIndex, const Atomi cString& locale) const override 14 size_t lastHyphenLocation(const StringView&, size_t beforeIndex) const overr ide
15 { 15 {
16 return 0; 16 return 0;
17 } 17 }
18 }; 18 };
19 19
20 TEST(HyphenationTest, GetHyphenation) 20 TEST(HyphenationTest, GetHyphenation)
21 { 21 {
22 RefPtr<Hyphenation> hyphenation = adoptRef(new NoHyphenation); 22 RefPtr<Hyphenation> hyphenation = adoptRef(new NoHyphenation);
23 Hyphenation::setForTesting("en-US", hyphenation); 23 Hyphenation::setForTesting("en-US", hyphenation);
24 EXPECT_EQ(hyphenation.get(), Hyphenation::get("en-US")); 24 EXPECT_EQ(hyphenation.get(), Hyphenation::get("en-US"));
25 25
26 Hyphenation::setForTesting("en-UK", nullptr); 26 Hyphenation::setForTesting("en-UK", nullptr);
27 EXPECT_EQ(nullptr, Hyphenation::get("en-UK")); 27 EXPECT_EQ(nullptr, Hyphenation::get("en-UK"));
28 28
29 Hyphenation::clearForTesting(); 29 Hyphenation::clearForTesting();
30 } 30 }
31 31
32 TEST(HyphenationTest, GetHyphenationCaseFolding) 32 TEST(HyphenationTest, GetHyphenationCaseFolding)
33 { 33 {
34 RefPtr<Hyphenation> hyphenation = adoptRef(new NoHyphenation); 34 RefPtr<Hyphenation> hyphenation = adoptRef(new NoHyphenation);
35 Hyphenation::setForTesting("en-US", hyphenation); 35 Hyphenation::setForTesting("en-US", hyphenation);
36 EXPECT_EQ(hyphenation, Hyphenation::get("en-US")); 36 EXPECT_EQ(hyphenation, Hyphenation::get("en-US"));
37 EXPECT_EQ(hyphenation, Hyphenation::get("en-us")); 37 EXPECT_EQ(hyphenation, Hyphenation::get("en-us"));
38 38
39 Hyphenation::clearForTesting(); 39 Hyphenation::clearForTesting();
40 } 40 }
41 41
42 } // namespace blink 42 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/text/Hyphenation.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698