Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLTokenizerTest.cpp

Issue 2121703002: Change HTMLTokenizer::Attribute::Range.start initial invalid value from 0 -> -1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update check Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698