27 std::unique_ptr<MockSnapshotDelegate> snapshot_delegate;
30 snapshot_delegate = std::make_unique<MockSnapshotDelegate>();
32 ON_CALL(*snapshot_delegate, GetTextureRegistry())
34 ::testing::Return(snapshot_delegate->GetMockTextureRegistry()));
35 snapshot_delegate_weak_ptr = snapshot_delegate->GetWeakPtr();
40 snapshot_delegate_weak_ptr, task_runner);
43 PostTaskSync(task_runner, [&]() { snapshot_delegate.reset(); });
52 std::unique_ptr<MockSnapshotDelegate> snapshot_delegate;
55 snapshot_delegate = std::make_unique<MockSnapshotDelegate>();
57 ON_CALL(*snapshot_delegate, GetTextureRegistry())
59 ::testing::Return(snapshot_delegate->GetMockTextureRegistry()));
64 auto mock_texture = std::make_shared<impeller::testing::MockTexture>(desc);
66 .WillOnce(::testing::Return(mock_texture));
69 MakeRasterSnapshotSync(::testing::_, ::testing::_, ::testing::_))
71 snapshot_delegate_weak_ptr = snapshot_delegate->GetWeakPtr();
76 task_runner->PostTask([&latch]() { latch.Wait(); });
80 snapshot_delegate_weak_ptr, task_runner);
82 EXPECT_FALSE(
image->impeller_texture());
88 EXPECT_TRUE(
image->impeller_texture());
89 snapshot_delegate.reset();
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...