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

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

Issue 2537043002: After detach, there's no document to notify parsing is finished. (Closed)
Patch Set: Feedback. Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/HTMLViewSourceParser.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/HTMLViewSourceParser.h"
6
7 #include "core/dom/DocumentInit.h"
8 #include "core/dom/DocumentParser.h"
9 #include "core/html/HTMLViewSourceDocument.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "wtf/text/WTFString.h"
12
13 namespace blink {
14
15 // This is a regression test for https://crbug.com/664915
16 TEST(HTMLViewSourceParserTest, DetachThenFinish_ShouldNotCrash) {
17 String mimeType("text/html");
18 HTMLViewSourceDocument* document =
19 HTMLViewSourceDocument::create(DocumentInit(), mimeType);
20 HTMLViewSourceParser* parser =
21 HTMLViewSourceParser::create(*document, mimeType);
22 // A client may detach the parser from the document.
23 parser->detach();
24 // A DocumentWriter may call finish() after detach().
25 static_cast<DocumentParser*>(parser)->finish();
26 // The test passed if finish did not crash.
27 }
28
29 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/HTMLViewSourceParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698