Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Unified Diff: ios/web/public/test/fakes/test_web_state_delegate.h

Issue 2642233004: Removed Form Resubmission callback from CRWWebDelegate. (Closed)
Patch Set: Added ShowRepostFormWarningWithNoDelegateMethod test Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/web/public/test/fakes/test_web_state_delegate.h
diff --git a/ios/web/public/test/fakes/test_web_state_delegate.h b/ios/web/public/test/fakes/test_web_state_delegate.h
index 30e941dfac9c879462f69d74a7d35975908ee410..02b112b22b73b59007ec26935b85fb9835100c05 100644
--- a/ios/web/public/test/fakes/test_web_state_delegate.h
+++ b/ios/web/public/test/fakes/test_web_state_delegate.h
@@ -15,6 +15,15 @@
namespace web {
+// Encapsulates parameters passed to ShowRepostFormWarningDialog.
+struct TestRepostFormRequest {
+ TestRepostFormRequest();
+ TestRepostFormRequest(const TestRepostFormRequest&);
+ ~TestRepostFormRequest();
+ WebState* web_state = nullptr;
+ base::Callback<void(bool)> callback;
+};
+
// Encapsulates parameters passed to OnAuthRequired.
struct TestAuthenticationRequest {
TestAuthenticationRequest();
@@ -37,7 +46,9 @@ class TestWebStateDelegate : public WebStateDelegate {
void LoadProgressChanged(WebState* source, double progress) override;
bool HandleContextMenu(WebState* source,
const ContextMenuParams& params) override;
-
+ void ShowRepostFormWarningDialog(
+ WebState* source,
+ const base::Callback<void(bool)>& callback) override;
TestJavaScriptDialogPresenter* GetTestJavaScriptDialogPresenter();
void OnAuthRequired(WebState* source,
NSURLProtectionSpace* protection_space,
@@ -54,6 +65,12 @@ class TestWebStateDelegate : public WebStateDelegate {
return handle_context_menu_called_;
}
+ // Returns the last Repost Form request passed to
+ // |ShowRepostFormWarningDialog|.
+ TestRepostFormRequest* last_repost_form_request() const {
+ return last_repost_form_request_.get();
+ }
+
// True if the WebStateDelegate GetJavaScriptDialogPresenter method has been
// called.
bool get_java_script_dialog_presenter_called() const {
@@ -73,6 +90,7 @@ class TestWebStateDelegate : public WebStateDelegate {
private:
bool load_progress_changed_called_ = false;
bool handle_context_menu_called_ = false;
+ std::unique_ptr<TestRepostFormRequest> last_repost_form_request_;
bool get_java_script_dialog_presenter_called_ = false;
TestJavaScriptDialogPresenter java_script_dialog_presenter_;
std::unique_ptr<TestAuthenticationRequest> last_authentication_request_;
« no previous file with comments | « ios/chrome/browser/ui/browser_view_controller.mm ('k') | ios/web/public/test/fakes/test_web_state_delegate.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698