Flutter Engine
Loading...
Searching...
No Matches
mock_gles_unittests.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "
flutter/testing/testing.h
"
// IWYU pragma: keep
6
#include "gtest/gtest.h"
7
#include "
impeller/renderer/backend/gles/proc_table_gles.h
"
8
#include "
impeller/renderer/backend/gles/test/mock_gles.h
"
9
10
namespace
impeller
{
11
namespace
testing {
12
13
// This test just checks that the proc table is initialized correctly.
14
//
15
// If this test doesn't pass, no test that uses the proc table will pass.
16
TEST
(
MockGLES
, CanInitialize) {
17
auto
mock_gles =
MockGLES::Init
();
18
19
std::string_view vendor(
reinterpret_cast<
const
char
*
>
(
20
mock_gles->GetProcTable().GetString(GL_VENDOR)));
21
EXPECT_EQ(vendor,
"MockGLES"
);
22
}
23
24
// Tests that if we call a function we have not mocked, it's OK.
25
TEST
(
MockGLES
, CanCallUnmockedFunction) {
26
auto
mock_gles =
MockGLES::Init
();
27
28
auto
& gl = mock_gles->GetProcTable();
29
gl.DeleteFramebuffers(1,
nullptr
);
30
31
// Test should still complete.
32
// If we end up mocking DeleteFramebuffers, delete this test.
33
}
34
35
}
// namespace testing
36
}
// namespace impeller
impeller::testing::MockGLES
Provides a mocked version of the |ProcTableGLES| class.
Definition
mock_gles.h:173
impeller::testing::MockGLES::Init
static std::shared_ptr< MockGLES > Init(std::unique_ptr< MockGLESImpl > impl, const std::optional< std::vector< const char * > > &extensions=std::nullopt)
Definition
mock_gles.cc:260
mock_gles.h
flutter::TEST
TEST(FrameTimingsRecorderTest, RecordVsync)
Definition
frame_timings_recorder_unittests.cc:22
impeller
Definition
texture.h:16
proc_table_gles.h
testing.h
impeller
renderer
backend
gles
test
mock_gles_unittests.cc
Generated on Thu Nov 6 2025 16:11:23 for Flutter Engine by
1.9.8