Flutter Engine
The Flutter Engine
test_metal_surface_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/test_metal_context.h"
6#include "flutter/testing/test_metal_surface.h"
7#include "flutter/testing/testing.h"
8
9namespace flutter {
10namespace testing {
11
12#ifdef SHELL_ENABLE_METAL
13
14TEST(TestMetalSurface, EmptySurfaceIsInvalid) {
16 GTEST_SKIP();
17 }
18
19 TestMetalContext metal_context = TestMetalContext();
20 auto surface = TestMetalSurface::Create(metal_context);
21 ASSERT_NE(surface, nullptr);
22 ASSERT_FALSE(surface->IsValid());
23}
24
25TEST(TestMetalSurface, CanCreateValidTestMetalSurface) {
27 GTEST_SKIP();
28 }
29
30 TestMetalContext metal_context = TestMetalContext();
31 auto surface =
32 TestMetalSurface::Create(metal_context, SkISize::Make(100, 100));
33 ASSERT_NE(surface, nullptr);
34 ASSERT_TRUE(surface->IsValid());
35 ASSERT_NE(surface->GetSurface(), nullptr);
36 ASSERT_NE(surface->GetGrContext(), nullptr);
37}
38
39#endif
40
41} // namespace testing
42} // namespace flutter
static std::unique_ptr< TestMetalSurface > Create(const TestMetalContext &test_metal_context, SkISize surface_size=SkISize::MakeEmpty())
VkSurfaceKHR surface
Definition: main.cc:49
TEST(DisplayListComplexity, EmptyDisplayList)
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20