5 #include "impeller/renderer/testing/mocks.h"
10 TEST(MockPipelineLibrary, LogAndGetPipelineUsageSinglePipeline) {
11 MockPipelineLibrary pipeline_library;
16 pipeline_library.LogPipelineUsage(pipeline_desc);
17 pipeline_library.LogPipelineUsage(pipeline_desc);
19 auto usage_counts = pipeline_library.GetPipelineUseCounts();
20 #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG || \
21 FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_PROFILE
22 EXPECT_EQ(usage_counts[pipeline_desc], 2);
24 EXPECT_EQ(usage_counts[pipeline_desc], 0);
28 TEST(MockPipelineLibrary, LogAndGetPipelineUsageMultiplePipelines) {
29 MockPipelineLibrary pipeline_library;
37 pipeline_library.LogPipelineUsage(pipeline_a);
38 pipeline_library.LogPipelineUsage(pipeline_a);
39 pipeline_library.LogPipelineUsage(pipeline_b);
41 auto usage_counts = pipeline_library.GetPipelineUseCounts();
43 #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG || \
44 FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_PROFILE
45 EXPECT_EQ(usage_counts[pipeline_a], 2);
46 EXPECT_EQ(usage_counts[pipeline_b], 1);
48 EXPECT_EQ(usage_counts[pipeline_a], 0);
49 EXPECT_EQ(usage_counts[pipeline_b], 0);
PipelineDescriptor & SetLabel(std::string_view label)
TEST(AllocationSizeTest, CanCreateTypedAllocations)