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

Side by Side Diff: ui/gfx/render_text_unittest.cc

Issue 326123003: RenderTextHarfBuzz: Decide run direction by BiDi embedding level (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gcc pls Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/render_text_harfbuzz.cc ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/gfx/render_text.h" 5 #include "ui/gfx/render_text.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 1959 matching lines...) Expand 10 before | Expand all | Expand 10 after
1970 for (size_t j = 0; j < 4; ++j) { 1970 for (size_t j = 0; j < 4; ++j) {
1971 SCOPED_TRACE(base::StringPrintf("Case %" PRIuS ", char %" PRIuS, i, j)); 1971 SCOPED_TRACE(base::StringPrintf("Case %" PRIuS ", char %" PRIuS, i, j));
1972 EXPECT_EQ(cases[i].char_to_glyph_expected[j], run.CharToGlyph(j)); 1972 EXPECT_EQ(cases[i].char_to_glyph_expected[j], run.CharToGlyph(j));
1973 EXPECT_EQ(cases[i].char_range_to_glyph_range_expected[j], 1973 EXPECT_EQ(cases[i].char_range_to_glyph_range_expected[j],
1974 run.CharRangeToGlyphRange(Range(j, j + 1))); 1974 run.CharRangeToGlyphRange(Range(j, j + 1)));
1975 } 1975 }
1976 } 1976 }
1977 1977
1978 } 1978 }
1979 1979
1980 TEST_F(RenderTextTest, HarfBuzz_RunDirection) {
1981 RenderTextHarfBuzz render_text;
1982 const base::string16 mixed =
1983 WideToUTF16(L"\x05D0\x05D1" L"1234" L"\x05D2\x05D3");
1984 render_text.SetText(mixed);
1985 render_text.EnsureLayout();
1986 ASSERT_EQ(3U, render_text.runs_.size());
1987 EXPECT_TRUE(render_text.runs_[0]->is_rtl);
1988 EXPECT_FALSE(render_text.runs_[1]->is_rtl);
1989 EXPECT_TRUE(render_text.runs_[2]->is_rtl);
1990 }
1991
1980 } // namespace gfx 1992 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/render_text_harfbuzz.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698