Flutter Engine
The Flutter Engine
shell
platform
linux
fl_plugin_registrar_test.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 <gtk/gtk.h>
6
7
// Included first as it collides with the X11 headers.
8
#include "gtest/gtest.h"
9
10
#include "flutter/shell/platform/linux/fl_binary_messenger_private.h"
11
#include "flutter/shell/platform/linux/fl_texture_registrar_private.h"
12
#include "flutter/shell/platform/linux/public/flutter_linux/fl_plugin_registrar.h"
13
#include "flutter/shell/platform/linux/testing/fl_test.h"
14
#include "flutter/shell/platform/linux/testing/mock_plugin_registrar.h"
15
16
// Checks can make a mock registrar.
17
TEST
(FlPluginRegistrarTest, FlMockRegistrar) {
18
g_autoptr(FlEngine)
engine
=
make_mock_engine
();
19
g_autoptr(FlBinaryMessenger) messenger =
fl_binary_messenger_new
(
engine
);
20
g_autoptr(FlTextureRegistrar)
texture_registrar
=
21
fl_texture_registrar_new
(
engine
);
22
23
g_autoptr(FlPluginRegistrar) registrar =
24
fl_mock_plugin_registrar_new
(messenger,
texture_registrar
);
25
EXPECT_TRUE
(FL_IS_MOCK_PLUGIN_REGISTRAR(registrar));
26
27
EXPECT_EQ(
fl_plugin_registrar_get_messenger
(registrar), messenger);
28
EXPECT_EQ(
fl_plugin_registrar_get_texture_registrar
(registrar),
29
texture_registrar
);
30
}
engine
FlutterEngine engine
Definition:
main.cc:68
fl_binary_messenger_new
FlBinaryMessenger * fl_binary_messenger_new(FlEngine *engine)
Definition:
fl_binary_messenger.cc:406
make_mock_engine
static FlEngine * make_mock_engine()
Definition:
fl_event_channel_test.cc:24
fl_plugin_registrar_get_texture_registrar
G_MODULE_EXPORT FlTextureRegistrar * fl_plugin_registrar_get_texture_registrar(FlPluginRegistrar *self)
Definition:
fl_plugin_registrar.cc:120
fl_plugin_registrar_get_messenger
G_MODULE_EXPORT FlBinaryMessenger * fl_plugin_registrar_get_messenger(FlPluginRegistrar *self)
Definition:
fl_plugin_registrar.cc:113
TEST
TEST(FlPluginRegistrarTest, FlMockRegistrar)
Definition:
fl_plugin_registrar_test.cc:17
fl_texture_registrar_new
FlTextureRegistrar * fl_texture_registrar_new(FlEngine *engine)
Definition:
fl_texture_registrar.cc:216
fl_mock_plugin_registrar_new
FlPluginRegistrar * fl_mock_plugin_registrar_new(FlBinaryMessenger *messenger, FlTextureRegistrar *texture_registrar)
Definition:
mock_plugin_registrar.cc:61
texture_registrar
G_BEGIN_DECLS FlTextureRegistrar * texture_registrar
Definition:
mock_plugin_registrar.h:22
EXPECT_TRUE
#define EXPECT_TRUE(handle)
Definition:
unit_test.h:678
Generated on Sun Jun 23 2024 21:55:17 for Flutter Engine by
1.9.4