#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/viz/client/client_resource_provider.h"
#include <algorithm>
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/test/gtest_util.h"
#include "base/test/scoped_feature_list.h"
#include "components/viz/common/features.h"
#include "components/viz/common/resources/release_callback.h"
#include "components/viz/common/resources/returned_resource.h"
#include "components/viz/test/test_context_provider.h"
#include "components/viz/test/viz_test_suite.h"
#include "gpu/command_buffer/client/client_shared_image.h"
#include "gpu/command_buffer/client/raster_interface.h"
#include "gpu/command_buffer/common/shared_image_usage.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
Each;
namespace viz {
namespace {
class MockFlushCallback { … };
class ClientResourceProviderTest : public testing::TestWithParam<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
class MockReleaseCallback { … };
TEST_P(ClientResourceProviderTest, TransferableResourceReleased) { … }
TEST_P(ClientResourceProviderTest, TransferableResourceSendToParent) { … }
TEST_P(ClientResourceProviderTest, TransferableResourceSendTwoToParent) { … }
TEST_P(ClientResourceProviderTest, TransferableResourceSendToParentTwoTimes) { … }
TEST_P(ClientResourceProviderTest,
TransferableResourceLostOnShutdownIfExported) { … }
TEST_P(ClientResourceProviderTest, TransferableResourceSendToParentManyUnsent) { … }
TEST_P(ClientResourceProviderTest, TransferableResourceRemovedAfterReturn) { … }
TEST_P(ClientResourceProviderTest, TransferableResourceExportedTwice) { … }
TEST_P(ClientResourceProviderTest, TransferableResourceReturnedTwiceAtOnce) { … }
TEST_P(ClientResourceProviderTest, TransferableResourceLostOnReturn) { … }
TEST_P(ClientResourceProviderTest, TransferableResourceLostOnFirstReturn) { … }
TEST_P(ClientResourceProviderTest, ReturnedSyncTokensArePassedToClient) { … }
TEST_P(ClientResourceProviderTest, LostResourcesAreReturnedLost) { … }
TEST_P(ClientResourceProviderTest, ShutdownLosesExportedResources) { … }
TEST_P(ClientResourceProviderTest, ReleaseExportedResources) { … }
TEST_P(ClientResourceProviderTest, ReleaseExportedResourcesThenRemove) { … }
TEST_P(ClientResourceProviderTest, ReleaseMultipleResources) { … }
TEST_P(ClientResourceProviderTest, ReleaseMultipleResourcesBeforeReturn) { … }
TEST_P(ClientResourceProviderTest, ReturnDuplicateResourceBeforeRemove) { … }
TEST_P(ClientResourceProviderTest, ReturnDuplicateResourceAfterRemove) { … }
TEST_P(ClientResourceProviderTest, EvictionUnlocksResources) { … }
TEST_P(ClientResourceProviderTest,
LockedReturnedResourcesReleasedDuringEviction) { … }
TEST_P(ClientResourceProviderTest, RemovedEvictedResourcesDoNotNotifyClient) { … }
TEST_P(ClientResourceProviderTest, EvictionNotifiesMainAndFlushes) { … }
TEST_P(ClientResourceProviderTest, BatchedCallbacksDoNotFireImmediately) { … }
TEST_P(ClientResourceProviderTest,
BatchedCallbacksFireUponProviderDestruction) { … }
}
}