chromium/third_party/blink/renderer/core/html/custom/custom_element_registry_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/custom/custom_element_registry.h"

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/web/web_custom_element.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_css_style_sheet_init.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_element_definition_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_shadow_root_init.h"
#include "third_party/blink/renderer/core/css/style_sheet_contents.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/dom/shadow_root.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/html/custom/ce_reactions_scope.h"
#include "third_party/blink/renderer/core/html/custom/custom_element.h"
#include "third_party/blink/renderer/core/html/custom/custom_element_definition.h"
#include "third_party/blink/renderer/core/html/custom/custom_element_definition_builder.h"
#include "third_party/blink/renderer/core/html/custom/custom_element_descriptor.h"
#include "third_party/blink/renderer/core/html/custom/custom_element_test_helpers.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/testing/null_execution_context.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"

namespace blink {

class CustomElementRegistryTest : public ::testing::Test {};

TEST_F(CustomElementRegistryTest,
       collectCandidates_shouldNotIncludeElementsRemovedFromDocument) {}

TEST_F(CustomElementRegistryTest,
       collectCandidates_shouldNotIncludeElementsInDifferentDocument) {}

TEST_F(CustomElementRegistryTest,
       collectCandidates_shouldOnlyIncludeCandidatesMatchingDescriptor) {}

TEST_F(CustomElementRegistryTest, collectCandidates_oneCandidate) {}

TEST_F(CustomElementRegistryTest, collectCandidates_shouldBeInDocumentOrder) {}

// Classes which use trace macros cannot be local because of the
// traceImpl template.
class LogUpgradeDefinition : public TestCustomElementDefinition {};

class LogUpgradeBuilder final : public TestCustomElementDefinitionBuilder {};

TEST_F(CustomElementRegistryTest, define_upgradesInDocumentElements) {}

TEST_F(CustomElementRegistryTest, attributeChangedCallback) {}

TEST_F(CustomElementRegistryTest, disconnectedCallback) {}

TEST_F(CustomElementRegistryTest, adoptedCallback) {}

TEST_F(CustomElementRegistryTest, lookupCustomElementDefinition) {}

// The embedder may define its own elements via the CustomElementRegistry
// whose names are not valid custom element names. Ensure that such a definition
// may be done.
TEST_F(CustomElementRegistryTest, DefineEmbedderCustomElements) {}

// Ensure that even when the embedder has declared that an invalid name may
// be used for a custom element definition, the caller of |define| may disallow
// the use of the invalid name (so that we don't expose the ability to use such
// a name to the web).
TEST_F(CustomElementRegistryTest, DisallowedEmbedderCustomElements) {}

// TODO(dominicc): Add tests which adjust the "is" attribute when type
// extensions are implemented.

}  // namespace blink