Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/parser/HTMLViewSourceParserTest.cpp |
| diff --git a/third_party/WebKit/Source/core/html/parser/HTMLViewSourceParserTest.cpp b/third_party/WebKit/Source/core/html/parser/HTMLViewSourceParserTest.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8fd023eeb3f87aecd0bc7154b5bd971ffc3c2bf2 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLViewSourceParserTest.cpp |
| @@ -0,0 +1,28 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "core/html/parser/HTMLViewSourceParser.h" |
| + |
| +#include "core/dom/DocumentInit.h" |
| +#include "core/dom/DocumentParser.h" |
| +#include "core/html/HTMLViewSourceDocument.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| +#include "wtf/text/WTFString.h" |
| + |
| +namespace blink { |
| + |
| +// This is a regression test for https://crbug.com/664915 |
| +TEST(HTMLViewSourceParserTest, DetachThenFinish) { |
| + String mimeType("text/html"); |
| + HTMLViewSourceDocument* document = |
| + HTMLViewSourceDocument::create(DocumentInit(), mimeType); |
| + HTMLViewSourceParser* parser = |
| + HTMLViewSourceParser::create(*document, mimeType); |
| + // A client may detach the parser from the document. |
| + parser->detach(); |
| + // A DocumentWriter may call finish() after detach(). |
| + static_cast<DocumentParser*>(parser)->finish(); |
| +} |
|
tkent
2016/11/29 07:07:37
Because there are no EXPECT_op()s in the test, ple
|
| + |
| +} // namespace blink |