| Index: ios/chrome/browser/ui/ntp/new_tab_page_controller_unittest.mm
|
| diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_controller_unittest.mm b/ios/chrome/browser/ui/ntp/new_tab_page_controller_unittest.mm
|
| index 1bae95d9b5999e01111a27afa9635afb917b419a..0c54bfe52ac90faa51448bd2db84da3eca89c54e 100644
|
| --- a/ios/chrome/browser/ui/ntp/new_tab_page_controller_unittest.mm
|
| +++ b/ios/chrome/browser/ui/ntp/new_tab_page_controller_unittest.mm
|
| @@ -17,6 +17,8 @@
|
| #include "ios/chrome/browser/chrome_url_constants.h"
|
| #include "ios/chrome/browser/search_engines/template_url_service_factory.h"
|
| #include "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h"
|
| +#import "ios/chrome/browser/sessions/test_session_service.h"
|
| +#import "ios/chrome/browser/tabs/tab_model.h"
|
| #import "ios/chrome/browser/ui/ntp/new_tab_page_view.h"
|
| #include "ios/chrome/browser/ui/ui_util.h"
|
| #include "ios/chrome/test/block_cleanup_test.h"
|
| @@ -87,6 +89,10 @@ class NewTabPageControllerTest : public BlockCleanupTest {
|
| chrome_browser_state_.get()));
|
| GURL url(kChromeUINewTabURL);
|
| parentViewController_ = [[UIViewController alloc] init];
|
| + tabModel_ = [[TabModel alloc]
|
| + initWithSessionWindow:nil
|
| + sessionService:[[TestSessionService alloc] init]
|
| + browserState:chrome_browser_state_.get()];
|
| controller_ =
|
| [[NewTabPageController alloc] initWithUrl:url
|
| loader:nil
|
| @@ -95,7 +101,7 @@ class NewTabPageControllerTest : public BlockCleanupTest {
|
| browserState:chrome_browser_state_.get()
|
| colorCache:nil
|
| webToolbarDelegate:nil
|
| - tabModel:nil
|
| + tabModel:tabModel_
|
| parentViewController:parentViewController_];
|
|
|
| incognitoController_ = [[NewTabPageController alloc]
|
| @@ -115,6 +121,8 @@ class NewTabPageControllerTest : public BlockCleanupTest {
|
| incognitoController_ = nil;
|
| controller_ = nil;
|
| parentViewController_ = nil;
|
| + [tabModel_ browserStateDestroyed];
|
| + tabModel_ = nil;
|
|
|
| // There may be blocks released below that have weak references to |profile|
|
| // owned by chrome_browser_state_. Ensure BlockCleanupTest::TearDown() is
|
| @@ -126,6 +134,7 @@ class NewTabPageControllerTest : public BlockCleanupTest {
|
| web::TestWebThreadBundle thread_bundle_;
|
| IOSChromeScopedTestingLocalState local_state_;
|
| std::unique_ptr<TestChromeBrowserState> chrome_browser_state_;
|
| + TabModel* tabModel_;
|
| UIViewController* parentViewController_;
|
| NewTabPageController* controller_;
|
| NewTabPageController* incognitoController_;
|
|
|