| 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 #import "ios/web/public/test/fakes/crw_test_web_state_observer.h" | 5 #import "ios/web/public/test/fakes/crw_test_web_state_observer.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 | 8 |
| 9 namespace web { | 9 namespace web { |
| 10 TestFormActivityInfo::TestFormActivityInfo() {} | 10 TestFormActivityInfo::TestFormActivityInfo() {} |
| 11 TestFormActivityInfo::~TestFormActivityInfo() = default; | 11 TestFormActivityInfo::~TestFormActivityInfo() = default; |
| 12 TestUpdateFaviconUrlCandidatesInfo::TestUpdateFaviconUrlCandidatesInfo() {} | 12 TestUpdateFaviconUrlCandidatesInfo::TestUpdateFaviconUrlCandidatesInfo() {} |
| 13 TestUpdateFaviconUrlCandidatesInfo::~TestUpdateFaviconUrlCandidatesInfo() = | 13 TestUpdateFaviconUrlCandidatesInfo::~TestUpdateFaviconUrlCandidatesInfo() = |
| 14 default; | 14 default; |
| 15 } | 15 } |
| 16 | 16 |
| 17 @implementation CRWTestWebStateObserver { | 17 @implementation CRWTestWebStateObserver { |
| 18 // Arguments passed to |webState:didStartProvisionalNavigationForURL:|. | 18 // Arguments passed to |webState:didStartProvisionalNavigationForURL:|. |
| 19 std::unique_ptr<web::TestStartProvisionalNavigationInfo> | 19 std::unique_ptr<web::TestStartProvisionalNavigationInfo> |
| 20 _startProvisionalNavigationInfo; | 20 _startProvisionalNavigationInfo; |
| 21 // Arguments passed to |webState:didFinishNavigationForURL:|. |
| 22 std::unique_ptr<web::TestDidFinishNavigationInfo> _didFinishNavigationInfo; |
| 21 // Arguments passed to |webState:didCommitNavigationWithDetails:|. | 23 // Arguments passed to |webState:didCommitNavigationWithDetails:|. |
| 22 std::unique_ptr<web::TestCommitNavigationInfo> _commitNavigationInfo; | 24 std::unique_ptr<web::TestCommitNavigationInfo> _commitNavigationInfo; |
| 23 // Arguments passed to |webState:didLoadPageWithSuccess:|. | 25 // Arguments passed to |webState:didLoadPageWithSuccess:|. |
| 24 std::unique_ptr<web::TestLoadPageInfo> _loadPageInfo; | 26 std::unique_ptr<web::TestLoadPageInfo> _loadPageInfo; |
| 25 // Arguments passed to |webStateDidDismissInterstitial:|. | 27 // Arguments passed to |webStateDidDismissInterstitial:|. |
| 26 std::unique_ptr<web::TestDismissInterstitialInfo> _dismissInterstitialInfo; | 28 std::unique_ptr<web::TestDismissInterstitialInfo> _dismissInterstitialInfo; |
| 27 // Arguments passed to |webStateDidChangeURLHash:|. | 29 // Arguments passed to |webStateDidChangeURLHash:|. |
| 28 std::unique_ptr<web::TestChangeUrlHashInfo> _changeUrlHashInfo; | 30 std::unique_ptr<web::TestChangeUrlHashInfo> _changeUrlHashInfo; |
| 29 // Arguments passed to |webStateDidChangeHistoryState:|. | 31 // Arguments passed to |webStateDidChangeHistoryState:|. |
| 30 std::unique_ptr<web::TestChangeHistoryStateInfo> _changeHistoryStateInfo; | 32 std::unique_ptr<web::TestChangeHistoryStateInfo> _changeHistoryStateInfo; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 47 // Arguments passed to |webStateDidStopLoading:|. | 49 // Arguments passed to |webStateDidStopLoading:|. |
| 48 std::unique_ptr<web::TestStopLoadingInfo> _stopLoadingInfo; | 50 std::unique_ptr<web::TestStopLoadingInfo> _stopLoadingInfo; |
| 49 // Arguments passed to |webStateDidStartLoading:|. | 51 // Arguments passed to |webStateDidStartLoading:|. |
| 50 std::unique_ptr<web::TestStartLoadingInfo> _startLoadingInfo; | 52 std::unique_ptr<web::TestStartLoadingInfo> _startLoadingInfo; |
| 51 } | 53 } |
| 52 | 54 |
| 53 - (web::TestStartProvisionalNavigationInfo*)startProvisionalNavigationInfo { | 55 - (web::TestStartProvisionalNavigationInfo*)startProvisionalNavigationInfo { |
| 54 return _startProvisionalNavigationInfo.get(); | 56 return _startProvisionalNavigationInfo.get(); |
| 55 } | 57 } |
| 56 | 58 |
| 59 - (web::TestDidFinishNavigationInfo*)didFinishNavigationInfo { |
| 60 return _didFinishNavigationInfo.get(); |
| 61 } |
| 62 |
| 57 - (web::TestCommitNavigationInfo*)commitNavigationInfo { | 63 - (web::TestCommitNavigationInfo*)commitNavigationInfo { |
| 58 return _commitNavigationInfo.get(); | 64 return _commitNavigationInfo.get(); |
| 59 } | 65 } |
| 60 | 66 |
| 61 - (web::TestLoadPageInfo*)loadPageInfo { | 67 - (web::TestLoadPageInfo*)loadPageInfo { |
| 62 return _loadPageInfo.get(); | 68 return _loadPageInfo.get(); |
| 63 } | 69 } |
| 64 | 70 |
| 65 - (web::TestDismissInterstitialInfo*)dismissInterstitialInfo { | 71 - (web::TestDismissInterstitialInfo*)dismissInterstitialInfo { |
| 66 return _dismissInterstitialInfo.get(); | 72 return _dismissInterstitialInfo.get(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 123 } |
| 118 | 124 |
| 119 - (void)webState:(web::WebState*)webState | 125 - (void)webState:(web::WebState*)webState |
| 120 didCommitNavigationWithDetails: | 126 didCommitNavigationWithDetails: |
| 121 (const web::LoadCommittedDetails&)load_details { | 127 (const web::LoadCommittedDetails&)load_details { |
| 122 _commitNavigationInfo = base::MakeUnique<web::TestCommitNavigationInfo>(); | 128 _commitNavigationInfo = base::MakeUnique<web::TestCommitNavigationInfo>(); |
| 123 _commitNavigationInfo->web_state = webState; | 129 _commitNavigationInfo->web_state = webState; |
| 124 _commitNavigationInfo->load_details = load_details; | 130 _commitNavigationInfo->load_details = load_details; |
| 125 } | 131 } |
| 126 | 132 |
| 133 - (void)webState:(web::WebState*)webState |
| 134 didFinishNavigation:(web::NavigationContext*)navigation { |
| 135 _didFinishNavigationInfo = |
| 136 base::MakeUnique<web::TestDidFinishNavigationInfo>(); |
| 137 _didFinishNavigationInfo->web_state = webState; |
| 138 _didFinishNavigationInfo->context = navigation; |
| 139 } |
| 140 |
| 127 - (void)webState:(web::WebState*)webState didLoadPageWithSuccess:(BOOL)success { | 141 - (void)webState:(web::WebState*)webState didLoadPageWithSuccess:(BOOL)success { |
| 128 _loadPageInfo = base::MakeUnique<web::TestLoadPageInfo>(); | 142 _loadPageInfo = base::MakeUnique<web::TestLoadPageInfo>(); |
| 129 _loadPageInfo->web_state = webState; | 143 _loadPageInfo->web_state = webState; |
| 130 _loadPageInfo->success = success; | 144 _loadPageInfo->success = success; |
| 131 } | 145 } |
| 132 | 146 |
| 133 - (void)webStateDidDismissInterstitial:(web::WebState*)webState { | 147 - (void)webStateDidDismissInterstitial:(web::WebState*)webState { |
| 134 _dismissInterstitialInfo = | 148 _dismissInterstitialInfo = |
| 135 base::MakeUnique<web::TestDismissInterstitialInfo>(); | 149 base::MakeUnique<web::TestDismissInterstitialInfo>(); |
| 136 _dismissInterstitialInfo->web_state = webState; | 150 _dismissInterstitialInfo->web_state = webState; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>(); | 215 _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>(); |
| 202 _stopLoadingInfo->web_state = webState; | 216 _stopLoadingInfo->web_state = webState; |
| 203 } | 217 } |
| 204 | 218 |
| 205 - (void)webStateDidStartLoading:(web::WebState*)webState { | 219 - (void)webStateDidStartLoading:(web::WebState*)webState { |
| 206 _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>(); | 220 _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>(); |
| 207 _startLoadingInfo->web_state = webState; | 221 _startLoadingInfo->web_state = webState; |
| 208 } | 222 } |
| 209 | 223 |
| 210 @end | 224 @end |
| OLD | NEW |