| 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/test_java_script_dialog_presenter.h" | 5 #import "ios/web/public/test/fakes/test_java_script_dialog_presenter.h" |
| 6 | 6 |
| 7 namespace web { | 7 namespace web { |
| 8 | 8 |
| 9 TestJavaScriptDialog::TestJavaScriptDialog() = default; | 9 TestJavaScriptDialog::TestJavaScriptDialog() = default; |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 WebState* web_state, | 21 WebState* web_state, |
| 22 const GURL& origin_url, | 22 const GURL& origin_url, |
| 23 JavaScriptDialogType java_script_dialog_type, | 23 JavaScriptDialogType java_script_dialog_type, |
| 24 NSString* message_text, | 24 NSString* message_text, |
| 25 NSString* default_prompt_text, | 25 NSString* default_prompt_text, |
| 26 const DialogClosedCallback& callback) { | 26 const DialogClosedCallback& callback) { |
| 27 TestJavaScriptDialog dialog; | 27 TestJavaScriptDialog dialog; |
| 28 dialog.web_state = web_state; | 28 dialog.web_state = web_state; |
| 29 dialog.origin_url = origin_url; | 29 dialog.origin_url = origin_url; |
| 30 dialog.java_script_dialog_type = java_script_dialog_type; | 30 dialog.java_script_dialog_type = java_script_dialog_type; |
| 31 dialog.message_text.reset(message_text); | 31 dialog.message_text.reset([message_text copy]); |
| 32 dialog.default_prompt_text.reset(default_prompt_text); | 32 dialog.default_prompt_text.reset([default_prompt_text copy]); |
| 33 | 33 |
| 34 requested_dialogs_.push_back(dialog); | 34 requested_dialogs_.push_back(dialog); |
| 35 | 35 |
| 36 callback.Run(callback_success_argument_, callback_user_input_argument_.get()); | 36 callback.Run(callback_success_argument_, callback_user_input_argument_.get()); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void TestJavaScriptDialogPresenter::CancelDialogs(WebState* web_state) { | 39 void TestJavaScriptDialogPresenter::CancelDialogs(WebState* web_state) { |
| 40 cancel_dialogs_called_ = true; | 40 cancel_dialogs_called_ = true; |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace web | 43 } // namespace web |
| OLD | NEW |