| OLD | NEW |
| 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/fonts/Character.h" | 5 #include "platform/fonts/Character.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 #include "wtf/text/CharacterNames.h" | 9 #include "wtf/text/CharacterNames.h" |
| 10 | 10 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 EXPECT_FALSE(Character::isEmojiModifierBase('A')); | 379 EXPECT_FALSE(Character::isEmojiModifierBase('A')); |
| 380 EXPECT_FALSE(Character::isEmojiModifierBase(0x1F47D)); | 380 EXPECT_FALSE(Character::isEmojiModifierBase(0x1F47D)); |
| 381 } | 381 } |
| 382 | 382 |
| 383 TEST(CharacterTest, LineBreakAndQuoteNotEmoji) | 383 TEST(CharacterTest, LineBreakAndQuoteNotEmoji) |
| 384 { | 384 { |
| 385 EXPECT_FALSE(Character::isEmojiTextPresentation('\n')); | 385 EXPECT_FALSE(Character::isEmojiTextPresentation('\n')); |
| 386 EXPECT_FALSE(Character::isEmojiTextPresentation('"')); | 386 EXPECT_FALSE(Character::isEmojiTextPresentation('"')); |
| 387 } | 387 } |
| 388 | 388 |
| 389 TEST(CharacterTest, Truncation) |
| 390 { |
| 391 const UChar32 base = 0x90000; |
| 392 UChar32 testChar = 0; |
| 393 |
| 394 testChar = base + spaceCharacter; |
| 395 EXPECT_FALSE(Character::treatAsSpace(testChar)); |
| 396 testChar = base + noBreakSpaceCharacter; |
| 397 EXPECT_FALSE(Character::treatAsSpace(testChar)); |
| 398 |
| 399 testChar = base + zeroWidthNonJoinerCharacter; |
| 400 EXPECT_FALSE(Character::treatAsZeroWidthSpace(testChar)); |
| 401 testChar = base + zeroWidthJoinerCharacter; |
| 402 EXPECT_FALSE(Character::treatAsZeroWidthSpace(testChar)); |
| 403 |
| 404 testChar = base + 0x12; |
| 405 EXPECT_FALSE(Character::treatAsZeroWidthSpaceInComplexScript(testChar)); |
| 406 EXPECT_FALSE(Character::treatAsZeroWidthSpaceInComplexScript(testChar)); |
| 407 testChar = base + objectReplacementCharacter; |
| 408 EXPECT_FALSE(Character::treatAsZeroWidthSpaceInComplexScript(testChar)); |
| 409 |
| 410 testChar = base + 0xA; |
| 411 EXPECT_FALSE(Character::isNormalizedCanvasSpaceCharacter(testChar)); |
| 412 testChar = base + 0x9; |
| 413 EXPECT_FALSE(Character::isNormalizedCanvasSpaceCharacter(testChar)); |
| 414 |
| 415 } |
| 416 |
| 389 } // namespace blink | 417 } // namespace blink |
| OLD | NEW |