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

Unified Diff: components/translate/ios/browser/translate_controller_unittest.mm

Issue 2813703002: [ObjC ARC] Converts components/translate/ios/browser:unit_tests to ARC. (Closed)
Patch Set: make_unique Created 3 years, 8 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 | « components/translate/ios/browser/language_detection_controller_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/translate/ios/browser/translate_controller_unittest.mm
diff --git a/components/translate/ios/browser/translate_controller_unittest.mm b/components/translate/ios/browser/translate_controller_unittest.mm
index 44e55a3f0b656cb3f4e1517d4eebab202c9880e9..99d5e36d3815dd54ed1690f2c8af30ab2d834d06 100644
--- a/components/translate/ios/browser/translate_controller_unittest.mm
+++ b/components/translate/ios/browser/translate_controller_unittest.mm
@@ -6,6 +6,7 @@
#include <memory>
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#import "components/translate/ios/browser/js_translate_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h"
@@ -13,6 +14,10 @@
#import "third_party/ocmock/OCMock/OCMock.h"
#include "url/gurl.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace translate {
class TranslateControllerTest : public PlatformTest,
@@ -26,10 +31,10 @@ class TranslateControllerTest : public PlatformTest,
translation_time_(0),
on_script_ready_called_(false),
on_translate_complete_called_(false) {
- mock_js_translate_manager_.reset(
- [[OCMockObject niceMockForClass:[JsTranslateManager class]] retain]);
- translate_controller_.reset(new TranslateController(
- test_web_state_.get(), mock_js_translate_manager_));
+ mock_js_translate_manager_ =
+ [OCMockObject niceMockForClass:[JsTranslateManager class]];
+ translate_controller_ = base::MakeUnique<TranslateController>(
+ test_web_state_.get(), mock_js_translate_manager_);
translate_controller_->set_observer(this);
}
@@ -53,7 +58,7 @@ class TranslateControllerTest : public PlatformTest,
}
std::unique_ptr<web::TestWebState> test_web_state_;
- base::scoped_nsobject<id> mock_js_translate_manager_;
+ id mock_js_translate_manager_;
std::unique_ptr<TranslateController> translate_controller_;
bool success_;
double ready_time_;
« no previous file with comments | « components/translate/ios/browser/language_detection_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698