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

Unified Diff: ios/web/web_state/js/crw_js_window_id_manager_unittest.mm

Issue 2933373002: [ObjC ARC] Converts ios/web:ios_web_web_state_js_unittests to ARC. (Closed)
Patch Set: 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
Index: ios/web/web_state/js/crw_js_window_id_manager_unittest.mm
diff --git a/ios/web/web_state/js/crw_js_window_id_manager_unittest.mm b/ios/web/web_state/js/crw_js_window_id_manager_unittest.mm
index 41463aa61cb67fa90bd35956674fcc704cde62d1..9e3847e49a7d5f3dd1c1f86f4f2e6a6d9a098e21 100644
--- a/ios/web/web_state/js/crw_js_window_id_manager_unittest.mm
+++ b/ios/web/web_state/js/crw_js_window_id_manager_unittest.mm
@@ -12,6 +12,10 @@
#import "testing/gtest_mac.h"
#import "testing/platform_test.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace web {
// Test fixture for testing CRWJSWindowIDManager class.
@@ -24,21 +28,21 @@ class JSWindowIDManagerTest : public PlatformTest {
// window ID.
TEST_F(JSWindowIDManagerTest, WindowIDDifferentManager) {
// Inject the first manager.
- WKWebView* web_view = [[[WKWebView alloc] init] autorelease];
+ WKWebView* web_view = [[WKWebView alloc] init];
ExecuteJavaScript(web_view, GetEarlyPageScript(&browser_state_));
CRWJSWindowIDManager* manager =
- [[[CRWJSWindowIDManager alloc] initWithWebView:web_view] autorelease];
+ [[CRWJSWindowIDManager alloc] initWithWebView:web_view];
[manager inject];
EXPECT_NSEQ([manager windowID],
ExecuteJavaScript(web_view, @"window.__gCrWeb.windowId"));
// Inject the second manager.
- WKWebView* web_view2 = [[[WKWebView alloc] init] autorelease];
+ WKWebView* web_view2 = [[WKWebView alloc] init];
ExecuteJavaScript(web_view2, GetEarlyPageScript(&browser_state_));
CRWJSWindowIDManager* manager2 =
- [[[CRWJSWindowIDManager alloc] initWithWebView:web_view2] autorelease];
+ [[CRWJSWindowIDManager alloc] initWithWebView:web_view2];
[manager2 inject];
EXPECT_NSEQ([manager2 windowID],
ExecuteJavaScript(web_view2, @"window.__gCrWeb.windowId"));
@@ -49,12 +53,12 @@ TEST_F(JSWindowIDManagerTest, WindowIDDifferentManager) {
// Tests that injecting multiple times creates a new window ID.
TEST_F(JSWindowIDManagerTest, MultipleInjections) {
- WKWebView* web_view = [[[WKWebView alloc] init] autorelease];
+ WKWebView* web_view = [[WKWebView alloc] init];
ExecuteJavaScript(web_view, GetEarlyPageScript(&browser_state_));
// First injection.
CRWJSWindowIDManager* manager =
- [[[CRWJSWindowIDManager alloc] initWithWebView:web_view] autorelease];
+ [[CRWJSWindowIDManager alloc] initWithWebView:web_view];
[manager inject];
NSString* windowID = [manager windowID];
EXPECT_NSEQ(windowID,
@@ -70,10 +74,10 @@ TEST_F(JSWindowIDManagerTest, MultipleInjections) {
// Tests that injection will retry if |window.__gCrWeb| is not present.
TEST_F(JSWindowIDManagerTest, InjectionRetry) {
- WKWebView* web_view = [[[WKWebView alloc] init] autorelease];
+ WKWebView* web_view = [[WKWebView alloc] init];
CRWJSWindowIDManager* manager =
- [[[CRWJSWindowIDManager alloc] initWithWebView:web_view] autorelease];
+ [[CRWJSWindowIDManager alloc] initWithWebView:web_view];
[manager inject];
EXPECT_TRUE([manager windowID]);
EXPECT_FALSE(ExecuteJavaScript(web_view, @"window.__gCrWeb"));
« no previous file with comments | « ios/web/web_state/js/crw_js_post_request_loader_unittest.mm ('k') | ios/web/web_state/js/page_script_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698