Commit 71cf910
committed
Fix crash in SplashScreenManagerTests
Tests passed locally but
testLoadDefaultSplashScreenViewFailsWhenStoryboardNotFound crashed in
*some* CI runs with:
```
Test Case '-[ios_test_flutter_swift.SplashScreenManagerTests testLoadDefaultSplashScreenViewFailsWhenStoryboardNotFound]' started.
IosUnitTests(19638,0x10b879200) malloc: enabling scribbling to detect mods to free blocks
IosUnitTests(19638) MallocStackLogging: could not tag MSL-related memory as no_footprint, so those pages will be included in process footprint - (null)
IosUnitTests(19638) MallocStackLogging: recording malloc (and VM allocation) stacks using lite mode
2026-04-23 08:57:59.075045-0700 IosUnitTests[19638:136527] [General] Failed to send CA Event for app launch measurements for ca_event_type: 0 event_name: com.apple.app_launch_measurement.FirstFramePresentationMetric
2026-04-23 08:57:59.145240-0700 IosUnitTests[19638:136528] [General] Failed to send CA Event for app launch measurements for ca_event_type: 1 event_name: com.apple.app_launch_measurement.ExtendedLaunchMetrics
```
MockBundle subclassed Bundle, but relied on the default initializer.
Bundle is a class cluster and the default initializer really wants a
real bundle with a physical directory on disk. The mock overrides the
infoDictionary and path(forResource:ofType:) methods, but any other
methods will be on some uninitialised garbage version of Bundle.
To work around this, I bootstrapped it with the bundle for the tests
themselves. We still mock out the two methods we care about for the
test, but this should avoid the crash.1 parent a444181 commit 71cf910
1 file changed
Lines changed: 6 additions & 0 deletions
File tree
- engine/src/flutter/shell/platform/darwin/ios/framework/Source
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
0 commit comments