chromium/third_party/blink/renderer/platform/heap/test/heap_compact_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 "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_deque.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/heap_test_utilities.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/deque.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/blink/renderer/platform/wtf/linked_hash_set.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"

#include <memory>

namespace {

class IntWrapper : public blink::GarbageCollected<IntWrapper> {};

static_assert;

}  // namespace

IntVector;
IntDeque;
IntMap;
// TODO(sof): decide if this ought to be a global trait specialization.
// (i.e., for HeapHash*<T>.)
WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS()

namespace blink {

class HeapCompactTest : public TestSupportingGC {};

TEST_F(HeapCompactTest, CompactVector) {}

TEST_F(HeapCompactTest, CompactHashMap) {}

TEST_F(HeapCompactTest, CompactVectorOfVector) {}

TEST_F(HeapCompactTest, CompactHashPartVector) {}

TEST_F(HeapCompactTest, CompactDeques) {}

TEST_F(HeapCompactTest, CompactLinkedHashSet) {}

TEST_F(HeapCompactTest, CompactLinkedHashSetVector) {}

TEST_F(HeapCompactTest, CompactLinkedHashSetMap) {}

TEST_F(HeapCompactTest, CompactLinkedHashSetNested) {}

TEST_F(HeapCompactTest, CompactInlinedBackingStore) {}

struct Dummy final {};

struct NestedType final {};

size_t NestedType::num_dtor_checks =;

}  // namespace blink

namespace WTF {
template <>
struct VectorTraits<blink::NestedType> : VectorTraitsBase<blink::NestedType> {};
}  // namespace WTF

namespace blink {

TEST_F(HeapCompactTest, AvoidCompactionWhenTraitsProhibitMemcpy) {}

}  // namespace blink