Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 97acb46

Browse files
committed
WIP test
1 parent bb0f4be commit 97acb46

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,7 @@ FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterTextI
10271027
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterView.h
10281028
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterView.mm
10291029
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm
1030+
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterViewControllerTest.mm
10301031
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h
10311032
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/fixtures/flutter_desktop_test.dart
10321033
FILE: ../../../flutter/shell/platform/darwin/macos/framework/module.modulemap

shell/platform/darwin/macos/BUILD.gn

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ test_fixtures("flutter_desktop_darwin_fixtures") {
101101
executable("flutter_desktop_darwin_unittests") {
102102
testonly = true
103103

104-
sources = [ "framework/Source/FlutterEngineUnittests.mm" ]
104+
sources = [
105+
"framework/Source/FlutterEngineUnittests.mm",
106+
"framework/Source/FlutterViewControllerTest.mm"
107+
]
105108

106109
cflags_objcc = [ "-fobjc-arc" ]
107110

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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/darwin/macos/framework/Headers/FlutterEngine.h"
6+
#include "flutter/shell/platform/darwin/macos/framework/Source/FlutterDartProject_Internal.h"
7+
#include "flutter/shell/platform/darwin/macos/framework/Source/FlutterEngine_Internal.h"
8+
#include "flutter/testing/testing.h"
9+
10+
namespace flutter::testing {
11+
12+
// TODO(justinmc): This is just copied from FlutterEngineUnittests.
13+
TEST(FlutterViewControllerTest, MacOSTestTest) {
14+
NSString* fixtures = @(testing::GetFixturesPath());
15+
FlutterDartProject* project = [[FlutterDartProject alloc]
16+
initWithAssetsPath:fixtures
17+
ICUDataPath:[fixtures stringByAppendingString:@"/icudtl.dat"]];
18+
FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"test"
19+
project:project
20+
allowHeadlessExecution:true];
21+
ASSERT_TRUE([engine runWithEntrypoint:@"main"]);
22+
ASSERT_TRUE(engine.running);
23+
[engine shutDownEngine];
24+
}
25+
26+
} // flutter::testing

0 commit comments

Comments
 (0)