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 #include "ios/web/public/test/web_test.h" | 5 #include "ios/web/public/test/web_test.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #import "ios/web/public/active_state_manager.h" | 8 #include "ios/web/public/active_state_manager.h" |
9 #import "ios/web/public/test/test_web_client.h" | 9 #import "ios/web/public/test/test_web_client.h" |
10 | 10 |
11 namespace web { | 11 namespace web { |
12 | 12 |
13 WebTest::WebTest() : web_client_(base::WrapUnique(new TestWebClient)) {} | 13 WebTest::WebTest() : web_client_(base::WrapUnique(new TestWebClient)) {} |
14 | 14 |
15 WebTest::~WebTest() {} | 15 WebTest::~WebTest() {} |
16 | 16 |
17 void WebTest::SetUp() { | 17 void WebTest::SetUp() { |
18 PlatformTest::SetUp(); | 18 PlatformTest::SetUp(); |
19 BrowserState::GetActiveStateManager(&browser_state_)->SetActive(true); | 19 BrowserState::GetActiveStateManager(&browser_state_)->SetActive(true); |
20 } | 20 } |
21 | 21 |
22 void WebTest::TearDown() { | 22 void WebTest::TearDown() { |
23 BrowserState::GetActiveStateManager(&browser_state_)->SetActive(false); | 23 BrowserState::GetActiveStateManager(&browser_state_)->SetActive(false); |
24 PlatformTest::TearDown(); | 24 PlatformTest::TearDown(); |
25 } | 25 } |
26 | 26 |
27 TestWebClient* WebTest::GetWebClient() { | 27 TestWebClient* WebTest::GetWebClient() { |
28 return static_cast<TestWebClient*>(web_client_.Get()); | 28 return static_cast<TestWebClient*>(web_client_.Get()); |
29 } | 29 } |
30 | 30 |
31 BrowserState* WebTest::GetBrowserState() { | 31 BrowserState* WebTest::GetBrowserState() { |
32 return &browser_state_; | 32 return &browser_state_; |
33 } | 33 } |
34 | 34 |
35 } // namespace web | 35 } // namespace web |
OLD | NEW |