| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/html/parser/HTMLTokenizer.h" |
| 6 |
| 7 #include "core/html/parser/HTMLParserOptions.h" |
| 8 #include "core/html/parser/HTMLToken.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 |
| 11 #include <memory> |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 // This is a regression test for crbug.com/619141 |
| 16 TEST(HTMLTokenizerTest, ZeroOffsetAttributeNameRange) |
| 17 { |
| 18 HTMLParserOptions options; |
| 19 std::unique_ptr<HTMLTokenizer> tokenizer = HTMLTokenizer::create(options); |
| 20 HTMLToken token; |
| 21 |
| 22 SegmentedString input("<script "); |
| 23 EXPECT_FALSE(tokenizer->nextToken(input, token)); |
| 24 |
| 25 EXPECT_EQ(HTMLToken::StartTag, token.type()); |
| 26 |
| 27 SegmentedString input2("type='javascript'"); |
| 28 // Below should not fail ASSERT |
| 29 EXPECT_FALSE(tokenizer->nextToken(input2, token)); |
| 30 } |
| 31 |
| 32 } // namespace blink |
| OLD | NEW |