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

Unified Diff: ios/web/test/web_int_test.h

Issue 2916473002: [ObjC ARC] Converts ios/web:web to ARC. (Closed)
Patch Set: Adoption of NS_VALID_UNTIL_END_OF_SCOPE Created 3 years, 7 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/test/web_int_test.h
diff --git a/ios/web/test/web_int_test.h b/ios/web/test/web_int_test.h
index 4bd312ebcc911e12bbe73dd1937f51adc6502bcb..0eae4bfc88ff23b11ffd6641747e2e9acb474ad9 100644
--- a/ios/web/test/web_int_test.h
+++ b/ios/web/test/web_int_test.h
@@ -71,6 +71,14 @@ class WebIntTest : public WebTest {
std::unique_ptr<WebState> web_state_;
// WebStateObserver used to wait for page loads.
std::unique_ptr<IntTestWebStateObserver> observer_;
+
+ // The system autorelease pool is deallocated after some of the C++ objects
+ // have been destroyed in the test (e.g. WebThreadImpl). Therefore any
+ // autoreleased object will be deallocated after a lot of the expected
+ // is gone, causing DCHECKs on deallocation. Creating our own root pool
+ // application context ensures that autoreleased objects are released at the
+ // end of the test, not later after the C++ test objects are destroyed.
+ NSAutoreleasePool* rootPool_;
Eugene But (OOO till 7-30) 2017/06/02 23:18:37 root_pool_ per C++ Style Guide. But also, should w
PL 2017/06/05 23:26:18 Done! This is a great suggestion, thanks!
};
} // namespace web

Powered by Google App Engine
This is Rietveld 408576698