iOS: Fix IOSSurfaceNoopTest (flutter/engine#55621)

Previously, we were passing `nullptr` to the `IOSSurfaceNoop` constructor:
56d060d501/shell/platform/darwin/ios/ios_surface_noop.mm (L23-L24)

which calls the IOSSurface constructor:
56d060d501/shell/platform/darwin/ios/ios_surface.mm (L55-L58)

Which calls `FML_DCHECK(ios_context_)`, which really doesn't like it when `ios_context_` is null.

I will later follow up with the next question of... "what exactly is going on with our CI here?", but this unbreaks my local dev testing workflow for the moment :)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
Chris Bracken
2024-10-03 12:22:09 -07:00
committed by GitHub
parent 5215356e5a
commit 36078b8126

View File

@@ -14,6 +14,7 @@
#import "flutter/lib/ui/window/platform_message_response.h"
#import "flutter/shell/common/thread_host.h"
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
#import "flutter/shell/platform/darwin/ios/ios_context_noop.h"
FLUTTER_ASSERT_ARC
@@ -22,7 +23,8 @@ FLUTTER_ASSERT_ARC
@implementation IOSSurfaceNoopTest
- (void)testCreateSurface {
flutter::IOSSurfaceNoop noop(nullptr);
auto context = std::make_shared<flutter::IOSContextNoop>();
flutter::IOSSurfaceNoop noop(context);
XCTAssertTrue(noop.IsValid());
XCTAssertTrue(!!noop.CreateGPUSurface());