5 #include "flutter/testing/testing.h"
6 #include "gtest/gtest.h"
8 #include "impeller/renderer/backend/gles/test/mock_gles.h"
16 class TestWorker :
public ReactorGLES::Worker {
18 bool CanReactorReactOnCurrentThreadNow(
19 const ReactorGLES& reactor)
const override {
25 TEST(DeviceBufferGLESTest, BindUniformData) {
26 auto mock_gles_impl = std::make_unique<MockGLESImpl>();
28 EXPECT_CALL(*mock_gles_impl, GenBuffers(1, _)).Times(1);
30 std::shared_ptr<MockGLES> mock_gled =
31 MockGLES::Init(std::move(mock_gles_impl));
33 auto proc_table = std::make_unique<ProcTableGLES>(resolver);
34 auto worker = std::make_shared<TestWorker>();
35 auto reactor = std::make_shared<ReactorGLES>(std::move(proc_table));
36 reactor->AddWorker(worker);
38 std::shared_ptr<Allocation> backing_store = std::make_shared<Allocation>();
39 ASSERT_TRUE(backing_store->Truncate(
Bytes{sizeof(float)}));
41 reactor, backing_store);
42 EXPECT_FALSE(device_buffer.GetHandle().has_value());
43 EXPECT_TRUE(device_buffer.BindAndUploadDataIfNecessary(
45 EXPECT_TRUE(device_buffer.GetHandle().has_value());
std::function< void *(const char *function_name)> Resolver
TEST(AllocationSizeTest, CanCreateTypedAllocations)