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