Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
proc_table_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 <optional>
6
7#include "flutter/testing/testing.h" // IWYU pragma: keep
8#include "gtest/gtest.h"
11
12namespace impeller {
13namespace testing {
14
15#define EXPECT_AVAILABLE(proc_ivar) \
16 EXPECT_TRUE(mock_gles->GetProcTable().proc_ivar.IsAvailable());
17#define EXPECT_UNAVAILABLE(proc_ivar) \
18 EXPECT_FALSE(mock_gles->GetProcTable().proc_ivar.IsAvailable());
19
20TEST(ProcTableGLES, ResolvesCorrectClearDepthProcOnES) {
21 auto mock_gles = MockGLES::Init(std::nullopt, "OpenGL ES 3.0");
22 EXPECT_TRUE(mock_gles->GetProcTable().GetDescription()->IsES());
23
26}
27
28TEST(ProcTableGLES, ResolvesCorrectClearDepthProcOnDesktopGL) {
29 auto mock_gles = MockGLES::Init(std::nullopt, "OpenGL 4.0");
30 EXPECT_FALSE(mock_gles->GetProcTable().GetDescription()->IsES());
31
34}
35
36} // namespace testing
37} // namespace impeller
#define TEST(S, s, D, expected)
static std::shared_ptr< MockGLES > Init(const std::optional< std::vector< const unsigned char * > > &extensions=std::nullopt, const char *version_string="OpenGL ES 3.0", ProcTableGLES::Resolver resolver=kMockResolverGLES)
Returns an initialized |MockGLES| instance.
Definition mock_gles.cc:166
#define FOR_EACH_IMPELLER_DESKTOP_ONLY_PROC(PROC)
#define FOR_EACH_IMPELLER_ES_ONLY_PROC(PROC)
#define EXPECT_AVAILABLE(proc_ivar)
#define EXPECT_UNAVAILABLE(proc_ivar)
#define EXPECT_TRUE(handle)
Definition unit_test.h:685