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 | #define FML_USED_ON_EMBEDDER |
6 | |
7 | #include "flutter/common/graphics/gl_context_switch.h" |
8 | |
9 | #include <functional> |
10 | #include <future> |
11 | #include <memory> |
12 | |
13 | #include "flutter/flow/testing/gl_context_switch_test.h" |
14 | #include "gtest/gtest.h" |
15 | |
16 | namespace flutter { |
17 | namespace testing { |
18 | |
19 | TEST(GLContextSwitchTest, SwitchKeepsContextCurrentWhileInScope) { |
20 | { |
21 | auto test_gl_context = std::make_unique<TestSwitchableGLContext>(args: 0); |
22 | auto context_switch = GLContextSwitch(std::move(test_gl_context)); |
23 | ASSERT_EQ(TestSwitchableGLContext::GetCurrentContext(), 0); |
24 | } |
25 | ASSERT_EQ(TestSwitchableGLContext::GetCurrentContext(), -1); |
26 | } |
27 | |
28 | } // namespace testing |
29 | } // namespace flutter |
30 |