| OLD | NEW |
| 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 "config.h" | 5 #include "config.h" |
| 6 #include "platform/fonts/ScriptRunIterator.h" | 6 #include "platform/fonts/ScriptRunIterator.h" |
| 7 | 7 |
| 8 #include "platform/Logging.h" | 8 #include "platform/Logging.h" |
| 9 #include "wtf/Assertions.h" | 9 #include "wtf/Assertions.h" |
| 10 #include "wtf/Threading.h" | 10 #include "wtf/Threading.h" |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 // DEVANAGARI STRESS SIGN UDATTA \xE0\xA5\x91 | 721 // DEVANAGARI STRESS SIGN UDATTA \xE0\xA5\x91 |
| 722 // ARABIC FATHATAN \xD9\x8B | 722 // ARABIC FATHATAN \xD9\x8B |
| 723 CHECK_RUNS({ { "\xE0\xA5\x91\xD9\x8B萬國碼", USCRIPT_HAN } }); | 723 CHECK_RUNS({ { "\xE0\xA5\x91\xD9\x8B萬國碼", USCRIPT_HAN } }); |
| 724 } | 724 } |
| 725 | 725 |
| 726 TEST_F(ScriptRunIteratorTest, OddLatinString) | 726 TEST_F(ScriptRunIteratorTest, OddLatinString) |
| 727 { | 727 { |
| 728 CHECK_RUNS({ { "ç̈", USCRIPT_LATIN } }); | 728 CHECK_RUNS({ { "ç̈", USCRIPT_LATIN } }); |
| 729 } | 729 } |
| 730 | 730 |
| 731 TEST_F(ScriptRunIteratorTest, CommonMalayalam) |
| 732 { |
| 733 CHECK_RUNS({ { "100-ാം", USCRIPT_MALAYALAM } }); |
| 734 } |
| 735 |
| 736 |
| 731 class ScriptRunIteratorICUDataTest : public testing::Test { | 737 class ScriptRunIteratorICUDataTest : public testing::Test { |
| 738 |
| 732 public: | 739 public: |
| 733 ScriptRunIteratorICUDataTest() | 740 ScriptRunIteratorICUDataTest() |
| 734 : m_maxExtensions(0) | 741 : m_maxExtensions(0) |
| 735 , m_maxExtensionsCodepoint(0xffff) | 742 , m_maxExtensionsCodepoint(0xffff) |
| 736 { | 743 { |
| 737 int maxExtensions = 0; | 744 int maxExtensions = 0; |
| 738 UChar32 m_maxExtensionscp = 0; | 745 UChar32 m_maxExtensionscp = 0; |
| 739 for (UChar32 cp = 0; cp < 0x11000; ++cp) { | 746 for (UChar32 cp = 0; cp < 0x11000; ++cp) { |
| 740 UErrorCode status = U_ZERO_ERROR; | 747 UErrorCode status = U_ZERO_ERROR; |
| 741 int count = uscript_getScriptExtensions(cp, 0, 0, &status); | 748 int count = uscript_getScriptExtensions(cp, 0, 0, &status); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 } | 806 } |
| 800 } | 807 } |
| 801 } | 808 } |
| 802 | 809 |
| 803 // ZWJ is \u200D Cf (Format, other) and its script is inherited. I'm going to | 810 // ZWJ is \u200D Cf (Format, other) and its script is inherited. I'm going to |
| 804 // ignore this for now, as I think it shouldn't matter which run it ends up | 811 // ignore this for now, as I think it shouldn't matter which run it ends up |
| 805 // in. HarfBuzz needs to be able to use it as context and shape each | 812 // in. HarfBuzz needs to be able to use it as context and shape each |
| 806 // neighboring character appropriately no matter what run it got assigned to. | 813 // neighboring character appropriately no matter what run it got assigned to. |
| 807 | 814 |
| 808 } // namespace blink | 815 } // namespace blink |
| OLD | NEW |