Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(867)

Unified Diff: ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller_egtest.mm

Issue 2880373002: [ObjC ARC] Converts ios/chrome/browser/ui/qr_scanner:eg_tests to ARC. (Closed)
Patch Set: remove comment Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ui/qr_scanner/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « ios/chrome/browser/ui/qr_scanner/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698