| Flutter Linux Embedder |

fl_view_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 "flutter/shell/platform/linux/public/flutter_linux/fl_view.h"
6 #include "flutter/shell/platform/linux/testing/fl_test_gtk_logs.h"
7
8 #include "gtest/gtest.h"
9
10 TEST(FlViewTest, StateUpdateDoesNotHappenInInit) {
11 flutter::testing::fl_ensure_gtk_init();
12 g_autoptr(FlDartProject) project = fl_dart_project_new();
13 g_autoptr(FlView) view = fl_view_new(project);
14 // Check that creating a view doesn't try to query the window state in
15 // initialization, causing a critical log to be issued.
16 EXPECT_EQ(
17 flutter::testing::fl_get_received_gtk_log_levels() & G_LOG_LEVEL_CRITICAL,
18 (GLogLevelFlags)0x0);
19 g_object_ref_sink(view);
20 }
fl_dart_project_new
G_MODULE_EXPORT FlDartProject * fl_dart_project_new()
Definition: fl_dart_project.cc:50
fl_view_new
G_MODULE_EXPORT FlView * fl_view_new(FlDartProject *project)
Definition: fl_view.cc:765
TEST
TEST(FlViewTest, StateUpdateDoesNotHappenInInit)
Definition: fl_view_test.cc:10
fl_view.h