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

Unified Diff: ios/chrome/app/main_controller_unittest.mm

Issue 2935713002: [ObjC ARC] Converts ios/chrome/app:unit_tests to ARC. (Closed)
Patch Set: Removed spurious include. Created 3 years, 6 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/app/main_application_delegate_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/app/main_controller_unittest.mm
diff --git a/ios/chrome/app/main_controller_unittest.mm b/ios/chrome/app/main_controller_unittest.mm
index 87dec947133b8285a46109c0430f792ccfbc0581..6c8e617721d972ce67ba8144c68c47feff1a17a9 100644
--- a/ios/chrome/app/main_controller_unittest.mm
+++ b/ios/chrome/app/main_controller_unittest.mm
@@ -4,7 +4,6 @@
#import <Foundation/Foundation.h>
-#import "base/mac/bind_objc_block.h"
#include "base/threading/thread.h"
#import "ios/chrome/app/application_delegate/app_state.h"
#import "ios/chrome/app/application_delegate/url_opener.h"
@@ -14,6 +13,10 @@
#include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
#pragma mark - MainController Testing Additions
@interface MainController (TestingAdditions)
@@ -60,16 +63,16 @@ class TabOpenerTest : public PlatformTest {
id<StartupInformation> expectedStartupInformation,
AppState* expectedAppState) {
swizzle_block_executed_ = NO;
- swizzle_block_.reset(
+ swizzle_block_ =
[^(id self, NSDictionary* options, BOOL applicationActive,
id<TabOpening> tabOpener, id<StartupInformation> startupInformation,
AppState* appState) {
swizzle_block_executed_ = YES;
EXPECT_EQ(expectedLaunchOptions, options);
EXPECT_EQ(expectedStartupInformation, startupInformation);
- EXPECT_EQ(main_controller_.get(), tabOpener);
+ EXPECT_EQ(main_controller_, tabOpener);
EXPECT_EQ(expectedAppState, appState);
- } copy]);
+ } copy];
URL_opening_handle_launch_swizzler_.reset(new ScopedBlockSwizzler(
[URLOpener class], @selector(handleLaunchOptions:
applicationActive:
@@ -80,16 +83,16 @@ class TabOpenerTest : public PlatformTest {
}
MainController* GetMainController() {
- if (!main_controller_.get()) {
- main_controller_.reset([[MainController alloc] initForTesting]);
+ if (!main_controller_) {
+ main_controller_ = [[MainController alloc] initForTesting];
}
- return main_controller_.get();
+ return main_controller_;
}
private:
- base::scoped_nsobject<MainController> main_controller_;
+ MainController* main_controller_;
__block BOOL swizzle_block_executed_;
- base::mac::ScopedBlock<HandleLaunchOptions> swizzle_block_;
+ HandleLaunchOptions swizzle_block_;
std::unique_ptr<ScopedBlockSwizzler> URL_opening_handle_launch_swizzler_;
};
« no previous file with comments | « ios/chrome/app/main_application_delegate_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698