chromium/third_party/blink/renderer/core/dom/live_node_list_registry_test.cc

// Copyright 2017 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/dom/live_node_list_registry.h"

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/name_node_list.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/heap/thread_state.h"

namespace blink {
namespace {

class LiveNodeListRegistryTest : public PageTestBase {};

TEST_F(LiveNodeListRegistryTest, InitialState) {}

// The invalidation types which match should be updated as elements are added.
TEST_F(LiveNodeListRegistryTest, Add) {}

// The set of types which match should be updated as elements are removed.
TEST_F(LiveNodeListRegistryTest, ExplicitRemove) {}

// This is a hack for test purposes. The test below forces a GC to happen and
// claims that there are no GC pointers on the stack. For this to be valid, the
// tracker itself must live on the heap, not on the stack.
struct LiveNodeListRegistryWrapper final
    : public GarbageCollected<LiveNodeListRegistryWrapper> {};

// The set of types which match should be updated as elements are removed due to
// the garbage collected. Similar to the previous case, except all references to
// |a| are removed together by the GC.
TEST_F(LiveNodeListRegistryTest, ImplicitRemove) {}

}  // namespace
}  // namespace blink