chromium/third_party/blink/renderer/core/html/parser/html_document_parser_test.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/html/parser/html_document_parser.h"

#include <memory>
#include <optional>

#include "base/test/scoped_feature_list.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/html/html_document.h"
#include "third_party/blink/renderer/core/html/html_iframe_element.h"
#include "third_party/blink/renderer/core/html/parser/text_resource_decoder.h"
#include "third_party/blink/renderer/core/html/parser/text_resource_decoder_builder.h"
#include "third_party/blink/renderer/core/loader/no_state_prefetch_client.h"
#include "third_party/blink/renderer/core/testing/null_execution_context.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/core/testing/sim/sim_request.h"
#include "third_party/blink/renderer/core/testing/sim/sim_test.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/url_test_helpers.h"

namespace blink {

namespace {

class MockNoStatePrefetchClient : public NoStatePrefetchClient {};

class HTMLDocumentParserTest
    : public PageTestBase,
      public testing::WithParamInterface<ParserSynchronizationPolicy> {};

// Calls DocumentParser::Detach() in the destructor. Used to ensure detach is
// called, as otherwise some assertions may be triggered.
class ScopedParserDetacher {};

}  // namespace

INSTANTIATE_TEST_SUITE_P();

TEST_P(HTMLDocumentParserTest, StopThenPrepareToStopShouldNotCrash) {}

TEST_P(HTMLDocumentParserTest, HasNoPendingWorkAfterStopParsing) {}

TEST_P(HTMLDocumentParserTest, HasNoPendingWorkAfterStopParsingThenAppend) {}

TEST_P(HTMLDocumentParserTest, HasNoPendingWorkAfterDetach) {}

TEST_P(HTMLDocumentParserTest, AppendPrefetch) {}

TEST_P(HTMLDocumentParserTest, AppendNoPrefetch) {}

class HTMLDocumentParserThreadedPreloadScannerTest : public PageTestBase {};

TEST_F(HTMLDocumentParserThreadedPreloadScannerTest,
       TakeBackgroundScanCallback) {}

class HTMLDocumentParserProcessImmediatelyTest : public PageTestBase {};

TEST_F(HTMLDocumentParserProcessImmediatelyTest, FirstChunk) {}

TEST_F(HTMLDocumentParserProcessImmediatelyTest, SecondChunk) {}

TEST_F(HTMLDocumentParserProcessImmediatelyTest, FirstChunkChildFrame) {}

TEST_F(HTMLDocumentParserProcessImmediatelyTest, FirstChunkDelayedChildFrame) {}

}  // namespace blink