OLD | NEW |
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 Loading... |
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 |
OLD | NEW |