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

Side by Side Diff: ios/web/public/test/fakes/test_java_script_dialog_presenter.mm

Issue 2612423003: [ios] Fixed memory management bug in TestJavaScriptDialogPresenter. (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698