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

Unified Diff: ios/web/web_state/web_state_unittest.mm

Issue 2935933003: [ObjC ARC] Converts ios/web:ios_web_web_state_unittests to ARC. (Closed)
Patch Set: Review fixes. 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/web_state_unittest.mm
diff --git a/ios/web/web_state/web_state_unittest.mm b/ios/web/web_state/web_state_unittest.mm
index a68359f69ef60e28ad9551d9d85cc799aeb62be0..35c165c2e97920b0a1148b38be887504cdee26f9 100644
--- a/ios/web/web_state/web_state_unittest.mm
+++ b/ios/web/web_state/web_state_unittest.mm
@@ -10,6 +10,10 @@
#import "ios/web/public/navigation_manager.h"
#import "ios/web/public/test/web_test_with_web_state.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace web {
// Test fixture for web::WebTest class.
@@ -25,11 +29,12 @@ TEST_F(WebStateTest, ScriptExecution) {
// Execute script with callback.
__block std::unique_ptr<base::Value> execution_result;
__block bool execution_complete = false;
- web_state()->ExecuteJavaScript(base::UTF8ToUTF16("window.foo"),
- base::BindBlock(^(const base::Value* value) {
- execution_result = value->CreateDeepCopy();
- execution_complete = true;
- }));
+ web_state()->ExecuteJavaScript(
+ base::UTF8ToUTF16("window.foo"),
+ base::BindBlockArc(^(const base::Value* value) {
+ execution_result = value->CreateDeepCopy();
+ execution_complete = true;
+ }));
WaitForCondition(^{
return execution_complete;
});
@@ -54,8 +59,8 @@ TEST_F(WebStateTest, LoadingProgress) {
TEST_F(WebStateTest, OverridingWebKitObject) {
// Add a script command handler.
__block bool message_received = false;
- const web::WebState::ScriptCommandCallback callback =
- base::BindBlock(^bool(const base::DictionaryValue&, const GURL&, bool) {
+ const web::WebState::ScriptCommandCallback callback = base::BindBlockArc(
+ ^bool(const base::DictionaryValue&, const GURL&, bool) {
message_received = true;
return true;
});
« no previous file with comments | « ios/web/web_state/web_state_observer_bridge_unittest.mm ('k') | ios/web/web_state/web_view_internal_creation_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698