| Flutter Linux Embedder |

Functions
fl_display_monitor_test.cc File Reference
`#include "flutter/shell/platform/linux/fl_display_monitor.h"`
`#include "flutter/shell/platform/embedder/test_utils/proc_table_replacement.h"`
`#include "flutter/shell/platform/linux/fl_engine_private.h"`
`#include "gtest/gtest.h"`

Go to the source code of this file.

## Functions
| TEST (FlDisplayMonitorTest, Test)

## Function Documentation

## ◆ TEST()

TEST | ( | FlDisplayMonitorTest | ,
|  | Test |
| ) |  |

Definition at line 11 of file fl_display_monitor_test.cc.

11 {
12 g_autoptr(FlDartProject) project = fl_dart_project_new();
13 g_autoptr(FlEngine) engine = fl_engine_new(project);
14
15 g_autoptr(GError) error = nullptr;
16 EXPECT_TRUE(fl_engine_start(engine, &error));
17 EXPECT_EQ(error, nullptr);
18
19 bool called = false;
20 fl_engine_get_embedder_api(engine)->NotifyDisplayUpdate = MOCK_ENGINE_PROC(
21 NotifyDisplayUpdate,
22 ([&called](auto engine, FlutterEngineDisplaysUpdateType update_type,
23 const FlutterEngineDisplay* displays, size_t displays_length) {
24 called = true;
25
26 EXPECT_EQ(displays_length, 1u);
27
28 return kSuccess;
29 }));
30
31 g_autoptr(FlDisplayMonitor) monitor =
32 fl_display_monitor_new(engine, gdk_display_get_default());
33 EXPECT_FALSE(called);
34 fl_display_monitor_start(monitor);
35 EXPECT_TRUE(called);
36 }
fl_dart_project_new
G_MODULE_EXPORT FlDartProject * fl_dart_project_new()
Definition: fl_dart_project.cc:50
fl_display_monitor_start
void fl_display_monitor_start(FlDisplayMonitor *self)
Definition: fl_display_monitor.cc:103
fl_display_monitor_new
FlDisplayMonitor * fl_display_monitor_new(FlEngine *engine, GdkDisplay *display)
Definition: fl_display_monitor.cc:94
fl_engine_get_embedder_api
FlutterEngineProcTable * fl_engine_get_embedder_api(FlEngine *self)
Definition: fl_engine.cc:726
fl_engine_start
gboolean fl_engine_start(FlEngine *self, GError **error)
Definition: fl_engine.cc:613
fl_engine_new
G_MODULE_EXPORT FlEngine * fl_engine_new(FlDartProject *project)
Definition: fl_engine.cc:584
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40

References error, fl_dart_project_new(), fl_display_monitor_new(), fl_display_monitor_start(), fl_engine_get_embedder_api(), fl_engine_new(), and fl_engine_start().