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

Unified Diff: ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm

Issue 2933363002: [ObjC ARC] Converts ios/web:ios_web_web_state_ui_unittests to ARC. (Closed)
Patch Set: Review nits. 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/web/web_state/ui/wk_back_forward_list_item_holder_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm
diff --git a/ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm b/ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm
index 2432724ce19719c7ce58b62bf395c5c9033f5808..a10486715c5d927396fb57b5dba73969f3d0c8a3 100644
--- a/ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm
+++ b/ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm
@@ -6,7 +6,6 @@
#import <WebKit/WebKit.h>
-#import "base/ios/weak_nsobject.h"
#include "base/memory/ptr_util.h"
#include "ios/web/public/test/fakes/test_browser_state.h"
#include "ios/web/public/test/scoped_testing_web_client.h"
@@ -17,6 +16,10 @@
#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace web {
namespace {
@@ -81,10 +84,10 @@ TEST_F(WKWebViewConfigurationProviderTest, OffTheRecordConfiguration) {
TEST_F(WKWebViewConfigurationProviderTest, ConfigurationProtection) {
WKWebViewConfigurationProvider& provider = GetProvider(&browser_state_);
WKWebViewConfiguration* config = provider.GetWebViewConfiguration();
- base::scoped_nsobject<WKProcessPool> pool([[config processPool] retain]);
- base::scoped_nsobject<WKPreferences> prefs([[config preferences] retain]);
- base::scoped_nsobject<WKUserContentController> userContentController(
- [[config userContentController] retain]);
+ WKProcessPool* pool = [config processPool];
+ WKPreferences* prefs = [config preferences];
+ WKUserContentController* userContentController =
+ [config userContentController];
// Change the properties of returned configuration object.
TestBrowserState other_browser_state;
@@ -98,11 +101,11 @@ TEST_F(WKWebViewConfigurationProviderTest, ConfigurationProtection) {
// Make sure that the properties of internal configuration were not changed.
EXPECT_TRUE(provider.GetWebViewConfiguration().processPool);
- EXPECT_EQ(pool.get(), provider.GetWebViewConfiguration().processPool);
+ EXPECT_EQ(pool, provider.GetWebViewConfiguration().processPool);
EXPECT_TRUE(provider.GetWebViewConfiguration().preferences);
- EXPECT_EQ(prefs.get(), provider.GetWebViewConfiguration().preferences);
+ EXPECT_EQ(prefs, provider.GetWebViewConfiguration().preferences);
EXPECT_TRUE(provider.GetWebViewConfiguration().userContentController);
- EXPECT_EQ(userContentController.get(),
+ EXPECT_EQ(userContentController,
provider.GetWebViewConfiguration().userContentController);
}
@@ -116,11 +119,11 @@ TEST_F(WKWebViewConfigurationProviderTest, ScriptMessageRouter) {
// Tests that both configuration and script message router are deallocated after
// |Purge| call.
TEST_F(WKWebViewConfigurationProviderTest, Purge) {
- base::WeakNSObject<id> config;
- base::WeakNSObject<id> router;
+ __weak id config;
+ __weak id router;
@autoreleasepool { // Make sure that resulting copy is deallocated.
- config.reset(GetProvider().GetWebViewConfiguration());
- router.reset(GetProvider().GetScriptMessageRouter());
+ config = GetProvider().GetWebViewConfiguration();
+ router = GetProvider().GetScriptMessageRouter();
ASSERT_TRUE(config);
ASSERT_TRUE(router);
}
« no previous file with comments | « ios/web/web_state/ui/wk_back_forward_list_item_holder_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698