| 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() {} |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 std::unique_ptr<web::TestCommitNavigationInfo> _commitNavigationInfo; | 22 std::unique_ptr<web::TestCommitNavigationInfo> _commitNavigationInfo; |
| 23 // Arguments passed to |webState:didLoadPageWithSuccess:|. | 23 // Arguments passed to |webState:didLoadPageWithSuccess:|. |
| 24 std::unique_ptr<web::TestLoadPageInfo> _loadPageInfo; | 24 std::unique_ptr<web::TestLoadPageInfo> _loadPageInfo; |
| 25 // Arguments passed to |webStateDidDismissInterstitial:|. | 25 // Arguments passed to |webStateDidDismissInterstitial:|. |
| 26 std::unique_ptr<web::TestDismissInterstitialInfo> _dismissInterstitialInfo; | 26 std::unique_ptr<web::TestDismissInterstitialInfo> _dismissInterstitialInfo; |
| 27 // Arguments passed to |webStateDidChangeHistoryState:|. | 27 // Arguments passed to |webStateDidChangeHistoryState:|. |
| 28 std::unique_ptr<web::TestChangeHistoryStateInfo> _changeHistoryStateInfo; | 28 std::unique_ptr<web::TestChangeHistoryStateInfo> _changeHistoryStateInfo; |
| 29 // Arguments passed to |webState:didChangeLoadingProgress:|. | 29 // Arguments passed to |webState:didChangeLoadingProgress:|. |
| 30 std::unique_ptr<web::TestChangeLoadingProgressInfo> | 30 std::unique_ptr<web::TestChangeLoadingProgressInfo> |
| 31 _changeLoadingProgressInfo; | 31 _changeLoadingProgressInfo; |
| 32 // Arguments passed to |webStateDidChangeTitle:|. |
| 33 std::unique_ptr<web::TestTitleWasSetInfo> _titleWasSetInfo; |
| 32 // Arguments passed to | 34 // Arguments passed to |
| 33 // |webState:didSubmitDocumentWithFormNamed:userInitiated:|. | 35 // |webState:didSubmitDocumentWithFormNamed:userInitiated:|. |
| 34 std::unique_ptr<web::TestSubmitDocumentInfo> _submitDocumentInfo; | 36 std::unique_ptr<web::TestSubmitDocumentInfo> _submitDocumentInfo; |
| 35 // Arguments passed to | 37 // Arguments passed to |
| 36 // |webState:didRegisterFormActivityWithFormNamed:fieldName:type:value:|. | 38 // |webState:didRegisterFormActivityWithFormNamed:fieldName:type:value:|. |
| 37 std::unique_ptr<web::TestFormActivityInfo> _formActivityInfo; | 39 std::unique_ptr<web::TestFormActivityInfo> _formActivityInfo; |
| 38 // Arguments passed to |webState:didUpdateFaviconURLCandidates|. | 40 // Arguments passed to |webState:didUpdateFaviconURLCandidates|. |
| 39 std::unique_ptr<web::TestUpdateFaviconUrlCandidatesInfo> | 41 std::unique_ptr<web::TestUpdateFaviconUrlCandidatesInfo> |
| 40 _updateFaviconUrlCandidatesInfo; | 42 _updateFaviconUrlCandidatesInfo; |
| 41 // Arguments passed to |webState:renderProcessGoneForWebState:|. | 43 // Arguments passed to |webState:renderProcessGoneForWebState:|. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 65 } | 67 } |
| 66 | 68 |
| 67 - (web::TestChangeHistoryStateInfo*)changeHistoryStateInfo { | 69 - (web::TestChangeHistoryStateInfo*)changeHistoryStateInfo { |
| 68 return _changeHistoryStateInfo.get(); | 70 return _changeHistoryStateInfo.get(); |
| 69 } | 71 } |
| 70 | 72 |
| 71 - (web::TestChangeLoadingProgressInfo*)changeLoadingProgressInfo { | 73 - (web::TestChangeLoadingProgressInfo*)changeLoadingProgressInfo { |
| 72 return _changeLoadingProgressInfo.get(); | 74 return _changeLoadingProgressInfo.get(); |
| 73 } | 75 } |
| 74 | 76 |
| 77 - (web::TestTitleWasSetInfo*)titleWasSetInfo { |
| 78 return _titleWasSetInfo.get(); |
| 79 } |
| 80 |
| 75 - (web::TestSubmitDocumentInfo*)submitDocumentInfo { | 81 - (web::TestSubmitDocumentInfo*)submitDocumentInfo { |
| 76 return _submitDocumentInfo.get(); | 82 return _submitDocumentInfo.get(); |
| 77 } | 83 } |
| 78 | 84 |
| 79 - (web::TestFormActivityInfo*)formActivityInfo { | 85 - (web::TestFormActivityInfo*)formActivityInfo { |
| 80 return _formActivityInfo.get(); | 86 return _formActivityInfo.get(); |
| 81 } | 87 } |
| 82 | 88 |
| 83 - (web::TestUpdateFaviconUrlCandidatesInfo*)updateFaviconUrlCandidatesInfo { | 89 - (web::TestUpdateFaviconUrlCandidatesInfo*)updateFaviconUrlCandidatesInfo { |
| 84 return _updateFaviconUrlCandidatesInfo.get(); | 90 return _updateFaviconUrlCandidatesInfo.get(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 142 } |
| 137 | 143 |
| 138 - (void)webState:(web::WebState*)webState | 144 - (void)webState:(web::WebState*)webState |
| 139 didChangeLoadingProgress:(double)progress { | 145 didChangeLoadingProgress:(double)progress { |
| 140 _changeLoadingProgressInfo = | 146 _changeLoadingProgressInfo = |
| 141 base::MakeUnique<web::TestChangeLoadingProgressInfo>(); | 147 base::MakeUnique<web::TestChangeLoadingProgressInfo>(); |
| 142 _changeLoadingProgressInfo->web_state = webState; | 148 _changeLoadingProgressInfo->web_state = webState; |
| 143 _changeLoadingProgressInfo->progress = progress; | 149 _changeLoadingProgressInfo->progress = progress; |
| 144 } | 150 } |
| 145 | 151 |
| 152 - (void)webStateDidChangeTitle:(web::WebState*)webState { |
| 153 _titleWasSetInfo = base::MakeUnique<web::TestTitleWasSetInfo>(); |
| 154 _titleWasSetInfo->web_state = webState; |
| 155 } |
| 156 |
| 146 - (void)webState:(web::WebState*)webState | 157 - (void)webState:(web::WebState*)webState |
| 147 didSubmitDocumentWithFormNamed:(const std::string&)formName | 158 didSubmitDocumentWithFormNamed:(const std::string&)formName |
| 148 userInitiated:(BOOL)userInitiated { | 159 userInitiated:(BOOL)userInitiated { |
| 149 _submitDocumentInfo = base::MakeUnique<web::TestSubmitDocumentInfo>(); | 160 _submitDocumentInfo = base::MakeUnique<web::TestSubmitDocumentInfo>(); |
| 150 _submitDocumentInfo->web_state = webState; | 161 _submitDocumentInfo->web_state = webState; |
| 151 _submitDocumentInfo->form_name = formName; | 162 _submitDocumentInfo->form_name = formName; |
| 152 _submitDocumentInfo->user_initiated = userInitiated; | 163 _submitDocumentInfo->user_initiated = userInitiated; |
| 153 } | 164 } |
| 154 | 165 |
| 155 - (void)webState:(web::WebState*)webState | 166 - (void)webState:(web::WebState*)webState |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>(); | 201 _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>(); |
| 191 _stopLoadingInfo->web_state = webState; | 202 _stopLoadingInfo->web_state = webState; |
| 192 } | 203 } |
| 193 | 204 |
| 194 - (void)webStateDidStartLoading:(web::WebState*)webState { | 205 - (void)webStateDidStartLoading:(web::WebState*)webState { |
| 195 _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>(); | 206 _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>(); |
| 196 _startLoadingInfo->web_state = webState; | 207 _startLoadingInfo->web_state = webState; |
| 197 } | 208 } |
| 198 | 209 |
| 199 @end | 210 @end |
| OLD | NEW |