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 #import "ios/web/public/test/web_test_with_web_state.h" | 5 #import "ios/web/public/test/web_test_with_web_state.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
9 #import "base/test/ios/wait_util.h" | 9 #import "base/test/ios/wait_util.h" |
10 #include "ios/web/public/web_state/url_verification_constants.h" | 10 #include "ios/web/public/web_state/url_verification_constants.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 namespace web { | 24 namespace web { |
25 | 25 |
26 WebTestWithWebState::WebTestWithWebState() {} | 26 WebTestWithWebState::WebTestWithWebState() {} |
27 | 27 |
28 WebTestWithWebState::~WebTestWithWebState() {} | 28 WebTestWithWebState::~WebTestWithWebState() {} |
29 | 29 |
30 void WebTestWithWebState::SetUp() { | 30 void WebTestWithWebState::SetUp() { |
31 WebTest::SetUp(); | 31 WebTest::SetUp(); |
32 std::unique_ptr<WebStateImpl> web_state(new WebStateImpl(GetBrowserState())); | 32 std::unique_ptr<WebStateImpl> web_state(new WebStateImpl(GetBrowserState())); |
33 web_state->GetNavigationManagerImpl().InitializeSession(nil, nil, NO, 0); | 33 web_state->GetNavigationManagerImpl().InitializeSession(nil, NO); |
34 web_state->SetWebUsageEnabled(true); | 34 web_state->SetWebUsageEnabled(true); |
35 web_state_.reset(web_state.release()); | 35 web_state_.reset(web_state.release()); |
36 | 36 |
37 // Force generation of child views; necessary for some tests. | 37 // Force generation of child views; necessary for some tests. |
38 [GetWebController(web_state_.get()) triggerPendingLoad]; | 38 [GetWebController(web_state_.get()) triggerPendingLoad]; |
39 } | 39 } |
40 | 40 |
41 void WebTestWithWebState::TearDown() { | 41 void WebTestWithWebState::TearDown() { |
42 web_state_.reset(); | 42 web_state_.reset(); |
43 WebTest::TearDown(); | 43 WebTest::TearDown(); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 void WebTestWithWebState::WillProcessTask(const base::PendingTask&) { | 148 void WebTestWithWebState::WillProcessTask(const base::PendingTask&) { |
149 // Nothing to do. | 149 // Nothing to do. |
150 } | 150 } |
151 | 151 |
152 void WebTestWithWebState::DidProcessTask(const base::PendingTask&) { | 152 void WebTestWithWebState::DidProcessTask(const base::PendingTask&) { |
153 processed_a_task_ = true; | 153 processed_a_task_ = true; |
154 } | 154 } |
155 | 155 |
156 } // namespace web | 156 } // namespace web |
OLD | NEW |