This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -5082,6 +5082,7 @@ ORIGIN: ../../../flutter/shell/platform/linux/fl_view_accessible.cc + ../../../f
50825082ORIGIN: ../../../flutter/shell/platform/linux/fl_view_accessible.h + ../../../flutter/LICENSE
50835083ORIGIN: ../../../flutter/shell/platform/linux/fl_view_accessible_test.cc + ../../../flutter/LICENSE
50845084ORIGIN: ../../../flutter/shell/platform/linux/fl_view_private.h + ../../../flutter/LICENSE
5085+ ORIGIN: ../../../flutter/shell/platform/linux/fl_view_test.cc + ../../../flutter/LICENSE
50855086ORIGIN: ../../../flutter/shell/platform/linux/key_mapping.g.cc + ../../../flutter/LICENSE
50865087ORIGIN: ../../../flutter/shell/platform/linux/key_mapping.h + ../../../flutter/LICENSE
50875088ORIGIN: ../../../flutter/shell/platform/linux/public/flutter_linux/fl_basic_message_channel.h + ../../../flutter/LICENSE
@@ -7893,6 +7894,7 @@ FILE: ../../../flutter/shell/platform/linux/fl_view_accessible.cc
78937894FILE: ../../../flutter/shell/platform/linux/fl_view_accessible.h
78947895FILE: ../../../flutter/shell/platform/linux/fl_view_accessible_test.cc
78957896FILE: ../../../flutter/shell/platform/linux/fl_view_private.h
7897+ FILE: ../../../flutter/shell/platform/linux/fl_view_test.cc
78967898FILE: ../../../flutter/shell/platform/linux/key_mapping.g.cc
78977899FILE: ../../../flutter/shell/platform/linux/key_mapping.h
78987900FILE: ../../../flutter/shell/platform/linux/public/flutter_linux/fl_basic_message_channel.h
Original file line number Diff line number Diff line change @@ -227,7 +227,10 @@ executable("flutter_linux_unittests") {
227227 " fl_texture_registrar_test.cc" ,
228228 " fl_value_test.cc" ,
229229 " fl_view_accessible_test.cc" ,
230+ " fl_view_test.cc" ,
230231 " testing/fl_test.cc" ,
232+ " testing/fl_test_gtk_logs.cc" ,
233+ " testing/fl_test_gtk_logs.h" ,
231234 " testing/mock_binary_messenger.cc" ,
232235 " testing/mock_binary_messenger_response_handle.cc" ,
233236 " testing/mock_engine.cc" ,
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change @@ -49,6 +49,11 @@ source_set("testing") {
4949
5050 sources = [ " run_all_unittests.cc" ]
5151
52+ if (is_linux ) {
53+ # So that we can call gtk_init in main().
54+ configs += [ " //flutter/shell/platform/linux/config:gtk" ]
55+ }
56+
5257 public_deps = [ " :testing_lib" ]
5358 public_configs = [ " :dynamic_symbols" ]
5459}
You can’t perform that action at this time.
0 commit comments