OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/web/public/test/fakes/test_java_script_dialog_presenter.h" |
| 6 |
| 7 namespace web { |
| 8 |
| 9 TestJavaScriptDialog::TestJavaScriptDialog() = default; |
| 10 |
| 11 TestJavaScriptDialog::TestJavaScriptDialog(const TestJavaScriptDialog&) = |
| 12 default; |
| 13 |
| 14 TestJavaScriptDialog::~TestJavaScriptDialog() = default; |
| 15 |
| 16 TestJavaScriptDialogPresenter::TestJavaScriptDialogPresenter() = default; |
| 17 |
| 18 TestJavaScriptDialogPresenter::~TestJavaScriptDialogPresenter() = default; |
| 19 |
| 20 void TestJavaScriptDialogPresenter::RunJavaScriptDialog( |
| 21 WebState* web_state, |
| 22 const GURL& origin_url, |
| 23 JavaScriptDialogType java_script_dialog_type, |
| 24 NSString* message_text, |
| 25 NSString* default_prompt_text, |
| 26 const DialogClosedCallback& callback) { |
| 27 TestJavaScriptDialog dialog; |
| 28 dialog.web_state = web_state; |
| 29 dialog.origin_url = origin_url; |
| 30 dialog.java_script_dialog_type = java_script_dialog_type; |
| 31 dialog.message_text.reset(message_text); |
| 32 dialog.default_prompt_text.reset(default_prompt_text); |
| 33 |
| 34 requested_dialogs_.push_back(dialog); |
| 35 |
| 36 callback.Run(callback_success_argument_, callback_user_input_argument_.get()); |
| 37 } |
| 38 |
| 39 void TestJavaScriptDialogPresenter::CancelDialogs(WebState* web_state) { |
| 40 cancel_dialogs_called_ = true; |
| 41 } |
| 42 |
| 43 } // namespace web |
OLD | NEW |