#include "third_party/blink/renderer/platform/mojo/heap_mojo_receiver_set.h"
#include <utility>
#include <string>
#include "base/memory/raw_ptr.h"
#include "base/test/null_task_runner.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/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_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, typename ContextType>
class HeapMojoReceiverSetGCBaseTest;
template <HeapMojoWrapperMode Mode, typename ContextType>
class GCOwner final : public GarbageCollected<GCOwner<Mode, ContextType>>,
public sample::blink::Service { … };
template <HeapMojoWrapperMode Mode, typename ContextType>
class HeapMojoReceiverSetGCBaseTest : public TestSupportingGC { … };
template <HeapMojoWrapperMode Mode, typename ContextType>
class HeapMojoReceiverSetDisconnectHandlerBaseTest
: public HeapMojoReceiverSetGCBaseTest<Mode, ContextType> { … };
template <HeapMojoWrapperMode Mode, typename ContextType>
class HeapMojoReceiverSetDisconnectWithReasonHandlerBaseTest
: public HeapMojoReceiverSetDisconnectHandlerBaseTest<Mode, ContextType> { … };
}
class HeapMojoReceiverSetGCWithContextObserverTest
: public HeapMojoReceiverSetGCBaseTest<
HeapMojoWrapperMode::kWithContextObserver,
void> { … };
class HeapMojoReceiverSetStringContextGCWithContextObserverTest
: public HeapMojoReceiverSetGCBaseTest<
HeapMojoWrapperMode::kWithContextObserver,
std::string> { … };
class HeapMojoReceiverSetGCWithoutContextObserverTest
: public HeapMojoReceiverSetGCBaseTest<
HeapMojoWrapperMode::kForceWithoutContextObserver,
void> { … };
class HeapMojoReceiverSetDisconnectHandlerWithoutContextObserverTest
: public HeapMojoReceiverSetDisconnectHandlerBaseTest<
HeapMojoWrapperMode::kForceWithoutContextObserver,
void> { … };
class HeapMojoReceiverSetDisconnectWithReasonHandlerWithoutContextObserverTest
: public HeapMojoReceiverSetDisconnectWithReasonHandlerBaseTest<
HeapMojoWrapperMode::kForceWithoutContextObserver,
void> { … };
TEST_F(HeapMojoReceiverSetGCWithContextObserverTest, RemovesReceiver) { … }
TEST_F(HeapMojoReceiverSetGCWithContextObserverTest, NoClearOnConservativeGC) { … }
TEST_F(HeapMojoReceiverSetGCWithoutContextObserverTest, RemovesReceiver) { … }
TEST_F(HeapMojoReceiverSetGCWithContextObserverTest, ClearLeavesSetEmpty) { … }
TEST_F(HeapMojoReceiverSetGCWithoutContextObserverTest, ClearLeavesSetEmpty) { … }
TEST_F(HeapMojoReceiverSetGCWithContextObserverTest, AddSeveralReceiverSet) { … }
TEST_F(HeapMojoReceiverSetStringContextGCWithContextObserverTest,
AddSeveralReceiverSetWithContext) { … }
TEST_F(HeapMojoReceiverSetDisconnectHandlerWithoutContextObserverTest, Clear) { … }
TEST_F(HeapMojoReceiverSetDisconnectWithReasonHandlerWithoutContextObserverTest,
ClearWithReason) { … }
}