#include "third_party/blink/renderer/modules/content_extraction/inner_text_builder.h"
#include "base/test/metrics/histogram_tester.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/document_fragment.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/html/forms/form_controller.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/forms/html_text_area_element.h"
#include "third_party/blink/renderer/core/html/html_body_element.h"
#include "third_party/blink/renderer/core/html/html_div_element.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/html_construction_site.h"
#include "third_party/blink/renderer/core/testing/null_execution_context.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/url_test_helpers.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
namespace blink {
namespace {
TEST(InnerTextBuilderTest, Basic) { … }
TEST(InnerTextBuilderTest, MultiFrames) { … }
TEST(InnerTextBuilderTest, DifferentOrigin) { … }
void ExpectChunkerResult(int max_words_per_aggregate_passage,
bool greedily_aggregate_sibling_nodes,
int max_passages,
int min_words_per_passage,
const std::string& html,
const std::vector<String>& expected_passages) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesChunksSingleTextBlock) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesHandlesEscapeCodes) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesHandlesUnicodeCharacters) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesHandlesByteString) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesStripsWhitespaceAroundNodeText) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesHandlesEmptyDomElements) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesChunksMultipleHtmlBlocks) { … }
TEST(InnerTextBuilderTest,
InnerTextPassagesIncludesNodesOverMaxAggregateChunkSize) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesJoinsSplitTextNodesWithinPTag) { … }
TEST(InnerTextBuilderTest,
InnerTextPassagesDoesNotJoinSplitTextNodesWithinPTagWhenOverMax) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesExcludesTextFromSomeHtmlTags) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesGreedilyAggregatesSiblingNodes) { … }
TEST(InnerTextBuilderTest,
InnerTextPassagesDoesNotGreedilyAggregateAcrossSectionBreaks) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesTrimsExtraPassages) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesSkipsPassagesTooShort) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesDropsShortPassagesAtMaxPassage) { … }
TEST(InnerTextBuilderTest, InnerTextPassagesExcludesSvgElements) { … }
}
}