Skip to content

Commit 148f320

Browse files
Restore the unit test behavior that was in main.m
1 parent 43f13cd commit 148f320

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

packages/camera/camera_avfoundation/example/ios/Runner/AppDelegate.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ import UIKit
1515
}
1616

1717
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
18+
// Plugin registration eventually sends camera operations on the background queue, which
19+
// would run concurrently with the test cases during unit tests, making the debugging
20+
// process confusing. This setup is actually not necessary for the unit tests, so
21+
// skip it when running unit tests.
22+
if NSClassFromString("XCTestCase") != nil {
23+
return
24+
}
1825
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
1926
}
2027
}

0 commit comments

Comments
 (0)