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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/RunSegmenterTest.cpp

Issue 2807913002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/fonts (Closed)
Patch Set: rebase Created 3 years, 8 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
OLDNEW
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 "platform/fonts/shaping/RunSegmenter.h" 5 #include "platform/fonts/shaping/RunSegmenter.h"
6 6
7 #include <string> 7 #include <string>
8 #include "platform/fonts/OrientationIterator.h" 8 #include "platform/fonts/OrientationIterator.h"
9 #include "platform/wtf/Assertions.h" 9 #include "platform/wtf/Assertions.h"
10 #include "platform/wtf/Vector.h" 10 #include "platform/wtf/Vector.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 #define CHECK_RUNS_HORIZONTAL(...) \ 89 #define CHECK_RUNS_HORIZONTAL(...) \
90 DECLARE_RUNSVECTOR(__VA_ARGS__); \ 90 DECLARE_RUNSVECTOR(__VA_ARGS__); \
91 CheckRuns(runs, FontOrientation::kHorizontal); 91 CheckRuns(runs, FontOrientation::kHorizontal);
92 92
93 TEST_F(RunSegmenterTest, Empty) { 93 TEST_F(RunSegmenterTest, Empty) {
94 String empty(g_empty_string16_bit); 94 String empty(g_empty_string16_bit);
95 RunSegmenter::RunSegmenterRange segmenter_range = { 95 RunSegmenter::RunSegmenterRange segmenter_range = {
96 0, 0, USCRIPT_INVALID_CODE, OrientationIterator::kOrientationKeep}; 96 0, 0, USCRIPT_INVALID_CODE, OrientationIterator::kOrientationKeep};
97 RunSegmenter run_segmenter(empty.Characters16(), empty.length(), 97 RunSegmenter run_segmenter(empty.Characters16(), empty.length(),
98 FontOrientation::kVerticalMixed); 98 FontOrientation::kVerticalMixed);
99 ASSERT(!run_segmenter.Consume(&segmenter_range)); 99 DCHECK(!run_segmenter.Consume(&segmenter_range));
100 ASSERT_EQ(segmenter_range.start, 0u); 100 ASSERT_EQ(segmenter_range.start, 0u);
101 ASSERT_EQ(segmenter_range.end, 0u); 101 ASSERT_EQ(segmenter_range.end, 0u);
102 ASSERT_EQ(segmenter_range.script, USCRIPT_INVALID_CODE); 102 ASSERT_EQ(segmenter_range.script, USCRIPT_INVALID_CODE);
103 ASSERT_EQ(segmenter_range.render_orientation, 103 ASSERT_EQ(segmenter_range.render_orientation,
104 OrientationIterator::kOrientationKeep); 104 OrientationIterator::kOrientationKeep);
105 ASSERT_EQ(segmenter_range.font_fallback_priority, 105 ASSERT_EQ(segmenter_range.font_fallback_priority,
106 FontFallbackPriority::kText); 106 FontFallbackPriority::kText);
107 } 107 }
108 108
109 TEST_F(RunSegmenterTest, LatinPunctuationSideways) { 109 TEST_F(RunSegmenterTest, LatinPunctuationSideways) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 CHECK_RUNS_HORIZONTAL( 234 CHECK_RUNS_HORIZONTAL(
235 {{"աբգ", USCRIPT_ARMENIAN, OrientationIterator::kOrientationKeep, 235 {{"աբգ", USCRIPT_ARMENIAN, OrientationIterator::kOrientationKeep,
236 FontFallbackPriority::kText}, 236 FontFallbackPriority::kText},
237 {"αβγ", USCRIPT_GREEK, OrientationIterator::kOrientationKeep, 237 {"αβγ", USCRIPT_GREEK, OrientationIterator::kOrientationKeep,
238 FontFallbackPriority::kText}, 238 FontFallbackPriority::kText},
239 {"ԱԲԳ", USCRIPT_ARMENIAN, OrientationIterator::kOrientationKeep, 239 {"ԱԲԳ", USCRIPT_ARMENIAN, OrientationIterator::kOrientationKeep,
240 FontFallbackPriority::kText}}); 240 FontFallbackPriority::kText}});
241 } 241 }
242 242
243 } // namespace blink 243 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698