Index: ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller_egtest.mm |
diff --git a/ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller_egtest.mm b/ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller_egtest.mm |
index 31aabe36b105c3c4bc0d41e5ab13b76fb8ad48ff..e656803c2828ff8200802b8503dd149912c09f07 100644 |
--- a/ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller_egtest.mm |
+++ b/ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller_egtest.mm |
@@ -396,13 +396,11 @@ - (NSString*)dialogTitleForState:(CameraState)state { |
- (void)swizzleCameraController:(id)cameraControllerMock { |
CameraController* (^swizzleCameraControllerBlock)( |
id<CameraControllerDelegate>) = ^(id<CameraControllerDelegate> delegate) { |
- // |initWithDelegate:| must return an object with a return count of 1 |
- // because it is preceded by a call to |alloc|. |
- return [cameraControllerMock retain]; |
+ return cameraControllerMock; |
}; |
camera_controller_swizzler_.reset(new ScopedBlockSwizzler( |
- [CameraController class], @selector(initWithDelegate:), |
+ [CameraController class], @selector(cameraControllerWithDelegate:), |
swizzleCameraControllerBlock)); |
} |