OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/fakes/test_web_state_observer.h" | 5 #include "ios/web/public/test/fakes/test_web_state_observer.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #import "ios/web/public/web_state/navigation_context.h" | 8 #import "ios/web/public/web_state/navigation_context.h" |
9 #include "ios/web/public/web_state/web_state.h" | 9 #include "ios/web/public/web_state/web_state.h" |
10 #include "ios/web/web_state/navigation_context_impl.h" | 10 #include "ios/web/web_state/navigation_context_impl.h" |
11 #include "net/http/http_response_headers.h" | 11 #include "net/http/http_response_headers.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
| 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 15 #error "This file requires ARC support." |
| 16 #endif |
| 17 |
14 namespace web { | 18 namespace web { |
15 | 19 |
16 TestWebStateObserver::TestWebStateObserver(WebState* web_state) | 20 TestWebStateObserver::TestWebStateObserver(WebState* web_state) |
17 : WebStateObserver(web_state) {} | 21 : WebStateObserver(web_state) {} |
18 TestWebStateObserver::~TestWebStateObserver() = default; | 22 TestWebStateObserver::~TestWebStateObserver() = default; |
19 | 23 |
20 void TestWebStateObserver::NavigationItemCommitted( | 24 void TestWebStateObserver::NavigationItemCommitted( |
21 const LoadCommittedDetails& load_details) { | 25 const LoadCommittedDetails& load_details) { |
22 commit_navigation_info_ = base::MakeUnique<web::TestCommitNavigationInfo>(); | 26 commit_navigation_info_ = base::MakeUnique<web::TestCommitNavigationInfo>(); |
23 commit_navigation_info_->web_state = web_state(); | 27 commit_navigation_info_->web_state = web_state(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 start_loading_info_ = base::MakeUnique<web::TestStartLoadingInfo>(); | 155 start_loading_info_ = base::MakeUnique<web::TestStartLoadingInfo>(); |
152 start_loading_info_->web_state = web_state(); | 156 start_loading_info_->web_state = web_state(); |
153 } | 157 } |
154 | 158 |
155 void TestWebStateObserver::DidStopLoading() { | 159 void TestWebStateObserver::DidStopLoading() { |
156 stop_loading_info_ = base::MakeUnique<web::TestStopLoadingInfo>(); | 160 stop_loading_info_ = base::MakeUnique<web::TestStopLoadingInfo>(); |
157 stop_loading_info_->web_state = web_state(); | 161 stop_loading_info_->web_state = web_state(); |
158 } | 162 } |
159 | 163 |
160 } // namespace web | 164 } // namespace web |
OLD | NEW |