OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef IOS_WEB_PUBLIC_TEST_WEB_TEST_H_ | 5 #ifndef IOS_WEB_PUBLIC_TEST_WEB_TEST_H_ |
6 #define IOS_WEB_PUBLIC_TEST_WEB_TEST_H_ | 6 #define IOS_WEB_PUBLIC_TEST_WEB_TEST_H_ |
7 | 7 |
8 #include "ios/web/public/test/fakes/test_browser_state.h" | 8 #include "ios/web/public/test/fakes/test_browser_state.h" |
9 #include "ios/web/public/test/scoped_testing_web_client.h" | 9 #include "ios/web/public/test/scoped_testing_web_client.h" |
10 #include "ios/web/public/test/test_web_thread_bundle.h" | 10 #include "ios/web/public/test/test_web_thread_bundle.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 private: | 42 private: |
43 // The WebClient used in tests. | 43 // The WebClient used in tests. |
44 ScopedTestingWebClient web_client_; | 44 ScopedTestingWebClient web_client_; |
45 // The threads used for testing. | 45 // The threads used for testing. |
46 web::TestWebThreadBundle thread_bundle_; | 46 web::TestWebThreadBundle thread_bundle_; |
47 // The browser state used in tests. | 47 // The browser state used in tests. |
48 TestBrowserState browser_state_; | 48 TestBrowserState browser_state_; |
49 | 49 |
50 // Triggers test failures if a render process dies during the test. | 50 // Triggers test failures if a render process dies during the test. |
51 std::unique_ptr<WebTestRenderProcessCrashObserver> crash_observer_; | 51 std::unique_ptr<WebTestRenderProcessCrashObserver> crash_observer_; |
52 | |
53 // The system autorelease pool is deallocated after some of the C++ objects | |
54 // have been destroyed in the test (e.g. WebThreadImpl). Therefore any | |
55 // autoreleased object will be deallocated after a lot of the expected | |
56 // application context is gone, causing DCHECKs on deallocation. Creating our | |
57 // own root pool wrapping the test ensures that autoreleased objects are | |
58 // released at the end of the test, not later after the C++ test objects are | |
59 // destroyed. | |
60 // Of type ID to prevent ARC imports from complaining about NSAutoreleasePool. | |
61 id root_pool_; | |
Eugene But (OOO till 7-30)
2017/06/12 06:12:51
Using |id| makes this header an Objective-C header
stkhapugin
2017/06/12 12:36:23
Please don't create a bare objc pointer in a heade
PL
2017/06/14 00:31:10
Thanks both, this is great guidance.
In the next
| |
52 }; | 62 }; |
53 | 63 |
54 } // namespace web | 64 } // namespace web |
55 | 65 |
56 #endif // IOS_WEB_PUBLIC_TEST_WEB_TEST_H_ | 66 #endif // IOS_WEB_PUBLIC_TEST_WEB_TEST_H_ |
OLD | NEW |