#include "third_party/blink/renderer/modules/document_metadata/document_metadata_extractor.h"
#include <memory>
#include <utility>
#include "components/schema_org/common/metadata.mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/document_metadata/document_metadata.mojom-blink.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/platform/heap/thread_state.h"
#include "third_party/blink/renderer/platform/json/json_values.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
namespace blink {
namespace {
WebPage;
WebPagePtr;
Entity;
EntityPtr;
Property;
PropertyPtr;
Values;
ValuesPtr;
class DocumentMetadataExtractorTest : public PageTestBase { … };
void DocumentMetadataExtractorTest::SetHTMLInnerHTML(
const String& html_content) { … }
void DocumentMetadataExtractorTest::SetURL(const String& url) { … }
void DocumentMetadataExtractorTest::SetTitle(const String& title) { … }
PropertyPtr DocumentMetadataExtractorTest::CreateStringProperty(
const String& name,
const String& value) { … }
PropertyPtr DocumentMetadataExtractorTest::CreateBooleanProperty(
const String& name,
const bool& value) { … }
PropertyPtr DocumentMetadataExtractorTest::CreateLongProperty(
const String& name,
const int64_t& value) { … }
PropertyPtr DocumentMetadataExtractorTest::CreateEntityProperty(
const String& name,
EntityPtr value) { … }
WebPagePtr DocumentMetadataExtractorTest::CreateWebPage(const String& url,
const String& title) { … }
TEST_F(DocumentMetadataExtractorTest, empty) { … }
TEST_F(DocumentMetadataExtractorTest, basic) { … }
TEST_F(DocumentMetadataExtractorTest, header) { … }
TEST_F(DocumentMetadataExtractorTest, booleanValue) { … }
TEST_F(DocumentMetadataExtractorTest, longValue) { … }
TEST_F(DocumentMetadataExtractorTest, doubleValue) { … }
TEST_F(DocumentMetadataExtractorTest, multiple) { … }
TEST_F(DocumentMetadataExtractorTest, nested) { … }
TEST_F(DocumentMetadataExtractorTest, repeated) { … }
TEST_F(DocumentMetadataExtractorTest, repeatedObject) { … }
TEST_F(DocumentMetadataExtractorTest, truncateLongString) { … }
TEST_F(DocumentMetadataExtractorTest, enforceTypeExists) { … }
TEST_F(DocumentMetadataExtractorTest, UnhandledTypeIgnored) { … }
TEST_F(DocumentMetadataExtractorTest, truncateTooManyValuesInField) { … }
TEST_F(DocumentMetadataExtractorTest, truncateTooManyFields) { … }
TEST_F(DocumentMetadataExtractorTest, ignorePropertyWithEmptyArray) { … }
TEST_F(DocumentMetadataExtractorTest, ignorePropertyWithMixedTypes) { … }
TEST_F(DocumentMetadataExtractorTest, ignorePropertyWithNestedArray) { … }
TEST_F(DocumentMetadataExtractorTest, enforceMaxNestingDepth) { … }
TEST_F(DocumentMetadataExtractorTest, maxNestingDepthWithTerminalProperty) { … }
}
}