OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "config.h" |
| 6 #include "core/html/parser/HTMLEntityParser.h" |
| 7 |
| 8 #include <gtest/gtest.h> |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 TEST(HTMLEntityParserTest, ConsumeHTMLEntityIncomplete) |
| 13 { |
| 14 String original("am"); // Incomplete by purpose. |
| 15 SegmentedString src(original); |
| 16 |
| 17 DecodedHTMLEntity entity; |
| 18 bool notEnoughCharacters = false; |
| 19 bool success = consumeHTMLEntity(src, entity, notEnoughCharacters); |
| 20 EXPECT_TRUE(notEnoughCharacters); |
| 21 EXPECT_FALSE(success); |
| 22 |
| 23 // consumeHTMLEntity should recover the original SegmentedString state if fa
iled. |
| 24 EXPECT_EQ(original, src.toString()); |
| 25 } |
| 26 |
| 27 } // namespace blink |
OLD | NEW |