#include "third_party/blink/renderer/platform/mojo/heap_mojo_associated_receiver.h"
#include "base/memory/raw_ptr.h"
#include "base/test/null_task_runner.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/context_lifecycle_notifier.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/heap/prefinalizer.h"
#include "third_party/blink/renderer/platform/heap_observer_set.h"
#include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h"
#include "third_party/blink/renderer/platform/mojo/mojo_binding_context.h"
#include "third_party/blink/renderer/platform/testing/mock_context_lifecycle_notifier.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
namespace {
template <HeapMojoWrapperMode Mode>
class HeapMojoAssociatedReceiverGCBaseTest;
template <HeapMojoWrapperMode Mode>
class AssociatedReceiverOwner
: public GarbageCollected<AssociatedReceiverOwner<Mode>>,
public sample::blink::Service { … };
template <HeapMojoWrapperMode Mode>
class HeapMojoAssociatedReceiverGCBaseTest : public TestSupportingGC { … };
template <HeapMojoWrapperMode Mode>
class HeapMojoAssociatedReceiverDestroyContextBaseTest
: public TestSupportingGC { … };
}
class HeapMojoAssociatedReceiverGCWithContextObserverTest
: public HeapMojoAssociatedReceiverGCBaseTest<
HeapMojoWrapperMode::kWithContextObserver> { … };
class HeapMojoAssociatedReceiverGCWithoutContextObserverTest
: public HeapMojoAssociatedReceiverGCBaseTest<
HeapMojoWrapperMode::kForceWithoutContextObserver> { … };
class HeapMojoAssociatedReceiverDestroyContextWithContextObserverTest
: public HeapMojoAssociatedReceiverDestroyContextBaseTest<
HeapMojoWrapperMode::kWithContextObserver> { … };
class HeapMojoAssociatedReceiverDestroyContextWithoutContextObserverTest
: public HeapMojoAssociatedReceiverDestroyContextBaseTest<
HeapMojoWrapperMode::kForceWithoutContextObserver> { … };
TEST_F(HeapMojoAssociatedReceiverGCWithContextObserverTest, ResetsOnGC) { … }
TEST_F(HeapMojoAssociatedReceiverGCWithContextObserverTest,
NoResetOnConservativeGC) { … }
TEST_F(HeapMojoAssociatedReceiverGCWithoutContextObserverTest, ResetsOnGC) { … }
TEST_F(HeapMojoAssociatedReceiverDestroyContextWithContextObserverTest,
ResetsOnContextDestroyed) { … }
TEST_F(HeapMojoAssociatedReceiverDestroyContextWithoutContextObserverTest,
ResetsOnContextDestroyed) { … }
}