Skip to content

Commit c8fe16a

Browse files
committed
Gate unittests on USE_TCORE_WL too
The unittests cc files unconditionally include <tizen_core_wl.h> and call tizen_core_wl_init(), which breaks ecore builds because the header is not in the include path on non-tcore sysroots. Conversely, the flutter_tizen_unittests executable target was not getting the USE_TCORE_WL define, so a tcore build was pulling in flutter_tizen_engine.h -> tizen_view_base.h -> the ecore input-method header. - Add #ifdef USE_TCORE_WL gates in flutter_tizen_engine_unittest.cc and flutter_tizen_texture_registrar_unittests.cc so each variant uses the matching init call (tizen_core_wl_init / ecore_init). - Propagate USE_TCORE_WL to the flutter_tizen_unittests target in BUILD.gn when use_tcore is set.
1 parent 1203622 commit c8fe16a

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

flutter/shell/platform/tizen/BUILD.gn

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ executable("flutter_tizen_unittests") {
297297

298298
ldflags = [ "-Wl,--unresolved-symbols=ignore-in-shared-libs" ]
299299

300+
if (use_tcore) {
301+
defines = [ "USE_TCORE_WL" ]
302+
}
303+
300304
configs += [ ":flutter_tizen_config" ]
301305

302306
deps += [

flutter/shell/platform/tizen/flutter_tizen_engine_unittest.cc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
#include "flutter/shell/platform/tizen/flutter_tizen_engine.h"
66

7+
#ifdef USE_TCORE_WL
78
#include <tizen_core_wl.h>
9+
#else
10+
#include <Ecore.h>
11+
#endif
812

913
#include "flutter/shell/platform/embedder/test_utils/proc_table_replacement.h"
1014
#include "flutter/shell/platform/tizen/testing/engine_modifier.h"
@@ -15,7 +19,13 @@ namespace testing {
1519

1620
class FlutterTizenEngineTest : public ::testing::Test {
1721
public:
18-
FlutterTizenEngineTest() { tizen_core_wl_init(); }
22+
FlutterTizenEngineTest() {
23+
#ifdef USE_TCORE_WL
24+
tizen_core_wl_init();
25+
#else
26+
ecore_init();
27+
#endif
28+
}
1929

2030
protected:
2131
void SetUp() {

flutter/shell/platform/tizen/flutter_tizen_texture_registrar_unittests.cc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
#include "flutter/shell/platform/tizen/flutter_tizen_texture_registrar.h"
66

7+
#ifdef USE_TCORE_WL
78
#include <tizen_core_wl.h>
9+
#else
10+
#include <Ecore.h>
11+
#endif
812

913
#include <iostream>
1014

@@ -18,7 +22,13 @@ namespace testing {
1822

1923
class FlutterTizenTextureRegistrarTest : public ::testing::Test {
2024
public:
21-
FlutterTizenTextureRegistrarTest() { tizen_core_wl_init(); }
25+
FlutterTizenTextureRegistrarTest() {
26+
#ifdef USE_TCORE_WL
27+
tizen_core_wl_init();
28+
#else
29+
ecore_init();
30+
#endif
31+
}
2232

2333
protected:
2434
void SetUp() {

0 commit comments

Comments
 (0)