OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "ios/chrome/browser/web/chrome_web_test.h" | 5 #import "ios/chrome/browser/web/chrome_web_test.h" |
6 | 6 |
7 #include "components/password_manager/core/browser/mock_password_store.h" | 7 #include "components/password_manager/core/browser/mock_password_store.h" |
8 #include "components/password_manager/core/browser/password_manager_test_utils.h
" | 8 #include "components/password_manager/core/browser/password_manager_test_utils.h
" |
9 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" | 9 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" |
10 #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" | 10 #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" |
11 #import "ios/chrome/browser/ui/fullscreen_controller.h" | 11 #import "ios/chrome/browser/ui/fullscreen_controller.h" |
12 #import "ios/web/public/web_state/web_state.h" | 12 #import "ios/web/public/web_state/web_state.h" |
13 | 13 |
| 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 15 #error "This file requires ARC support." |
| 16 #endif |
| 17 |
14 ChromeWebTest::~ChromeWebTest() {} | 18 ChromeWebTest::~ChromeWebTest() {} |
15 | 19 |
16 ChromeWebTest::ChromeWebTest() : web::WebTestWithWebState() { | 20 ChromeWebTest::ChromeWebTest() : web::WebTestWithWebState() { |
17 TestChromeBrowserState::Builder browser_state_builder; | 21 TestChromeBrowserState::Builder browser_state_builder; |
18 chrome_browser_state_ = browser_state_builder.Build(); | 22 chrome_browser_state_ = browser_state_builder.Build(); |
19 } | 23 } |
20 | 24 |
21 void ChromeWebTest::SetUp() { | 25 void ChromeWebTest::SetUp() { |
22 web::WebTestWithWebState::SetUp(); | 26 web::WebTestWithWebState::SetUp(); |
23 IOSChromePasswordStoreFactory::GetInstance()->SetTestingFactory( | 27 IOSChromePasswordStoreFactory::GetInstance()->SetTestingFactory( |
24 chrome_browser_state_.get(), | 28 chrome_browser_state_.get(), |
25 &password_manager::BuildPasswordStore< | 29 &password_manager::BuildPasswordStore< |
26 web::BrowserState, password_manager::MockPasswordStore>); | 30 web::BrowserState, password_manager::MockPasswordStore>); |
27 [FullScreenController setEnabledForTests:NO]; | 31 [FullScreenController setEnabledForTests:NO]; |
28 } | 32 } |
29 | 33 |
30 void ChromeWebTest::TearDown() { | 34 void ChromeWebTest::TearDown() { |
31 WaitForBackgroundTasks(); | 35 WaitForBackgroundTasks(); |
32 [FullScreenController setEnabledForTests:YES]; | 36 [FullScreenController setEnabledForTests:YES]; |
33 web::WebTestWithWebState::TearDown(); | 37 web::WebTestWithWebState::TearDown(); |
34 } | 38 } |
35 | 39 |
36 web::BrowserState* ChromeWebTest::GetBrowserState() { | 40 web::BrowserState* ChromeWebTest::GetBrowserState() { |
37 return chrome_browser_state_.get(); | 41 return chrome_browser_state_.get(); |
38 } | 42 } |
OLD | NEW |