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..4a3e755be55d68e8ab8e5623c396e83db4283c33 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 |
@@ -6,7 +6,6 @@ |
#import <EarlGrey/EarlGrey.h> |
#import <UIKit/UIKit.h> |
-#import "base/mac/scoped_nsobject.h" |
#include "base/strings/sys_string_conversions.h" |
#include "base/strings/utf_string_conversions.h" |
#include "components/strings/grit/components_strings.h" |
@@ -34,6 +33,10 @@ |
#import "ui/base/l10n/l10n_util.h" |
#import "ui/base/l10n/l10n_util_mac.h" |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
+ |
using namespace chrome_test_util; |
using namespace qr_scanner; |
@@ -110,8 +113,8 @@ id<GREYMatcher> DialogCancelButton() { |
// Opens the QR Scanner view using a command. |
// TODO(crbug.com/629776): Replace the command call with a UI action. |
void ShowQRScannerWithCommand() { |
- base::scoped_nsobject<GenericChromeCommand> command( |
- [[GenericChromeCommand alloc] initWithTag:IDC_SHOW_QR_SCANNER]); |
+ GenericChromeCommand* command = |
+ [[GenericChromeCommand alloc] initWithTag:IDC_SHOW_QR_SCANNER]; |
chrome_test_util::RunCommandWithActiveViewController(command); |
} |
@@ -396,9 +399,7 @@ void TapKeyboardReturnKeyInOmniboxWithText(std::string text) { |
- (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]; |
baxley
2017/05/16 00:51:36
So we need to keep the retain count at 1. Current
stkhapugin
2017/05/30 14:13:56
This is not the first time ARC is blocked with thi
jif
2017/05/31 11:32:46
Fundamentally, when running tests we need the BVC
stkhapugin
2017/05/31 12:28:40
Mike, can you try swizzling the implementation wit
jif
2017/05/31 13:28:53
Landed the quick fix (https://codereview.chromium.
|
+ return cameraControllerMock; |
}; |
camera_controller_swizzler_.reset(new ScopedBlockSwizzler( |