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

Unified Diff: ios/web/public/test/fakes/test_java_script_dialog_presenter.mm

Issue 2615093004: [ios] Made TestWebStateDelegate and TestJavaScriptDialogPresenter reusable. (Closed)
Patch Set: 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_java_script_dialog_presenter.mm
diff --git a/ios/web/public/test/fakes/test_java_script_dialog_presenter.mm b/ios/web/public/test/fakes/test_java_script_dialog_presenter.mm
new file mode 100644
index 0000000000000000000000000000000000000000..c0bb09f221c9d3c0d5b830e891fba1af67913148
--- /dev/null
+++ b/ios/web/public/test/fakes/test_java_script_dialog_presenter.mm
@@ -0,0 +1,43 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/web/public/test/fakes/test_java_script_dialog_presenter.h"
+
+namespace web {
+
+TestJavaScriptDialog::TestJavaScriptDialog() = default;
+
+TestJavaScriptDialog::TestJavaScriptDialog(const TestJavaScriptDialog&) =
+ default;
+
+TestJavaScriptDialog::~TestJavaScriptDialog() = default;
+
+TestJavaScriptDialogPresenter::TestJavaScriptDialogPresenter() = default;
+
+TestJavaScriptDialogPresenter::~TestJavaScriptDialogPresenter() = default;
+
+void TestJavaScriptDialogPresenter::RunJavaScriptDialog(
+ WebState* web_state,
+ const GURL& origin_url,
+ JavaScriptDialogType java_script_dialog_type,
+ NSString* message_text,
+ NSString* default_prompt_text,
+ const DialogClosedCallback& callback) {
+ TestJavaScriptDialog dialog;
+ dialog.web_state = web_state;
+ dialog.origin_url = origin_url;
+ dialog.java_script_dialog_type = java_script_dialog_type;
+ dialog.message_text.reset(message_text);
+ dialog.default_prompt_text.reset(default_prompt_text);
+
+ requested_dialogs_.push_back(dialog);
+
+ callback.Run(callback_success_argument_, callback_user_input_argument_.get());
+}
+
+void TestJavaScriptDialogPresenter::CancelDialogs(WebState* web_state) {
+ cancel_dialogs_called_ = true;
+}
+
+} // namespace web
« no previous file with comments | « ios/web/public/test/fakes/test_java_script_dialog_presenter.h ('k') | ios/web/public/test/fakes/test_web_state_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698