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

Side by Side Diff: ios/web/web_state/web_state_impl_unittest.mm

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 unified diff | Download patch
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/web_state/web_state_impl.h" 5 #import "ios/web/web_state/web_state_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 EXPECT_FALSE(delegate.load_progress_changed_called()); 410 EXPECT_FALSE(delegate.load_progress_changed_called());
411 web_state_->SendChangeLoadProgress(0.0); 411 web_state_->SendChangeLoadProgress(0.0);
412 EXPECT_TRUE(delegate.load_progress_changed_called()); 412 EXPECT_TRUE(delegate.load_progress_changed_called());
413 413
414 // Test that HandleContextMenu() is called. 414 // Test that HandleContextMenu() is called.
415 EXPECT_FALSE(delegate.handle_context_menu_called()); 415 EXPECT_FALSE(delegate.handle_context_menu_called());
416 web::ContextMenuParams context_menu_params; 416 web::ContextMenuParams context_menu_params;
417 web_state_->HandleContextMenu(context_menu_params); 417 web_state_->HandleContextMenu(context_menu_params);
418 EXPECT_TRUE(delegate.handle_context_menu_called()); 418 EXPECT_TRUE(delegate.handle_context_menu_called());
419 419
420 // Test that ShowRepostFormWarningDialog() is called.
421 EXPECT_FALSE(delegate.last_repost_form_request());
422 base::Callback<void(bool)> repost_callback;
423 web_state_->ShowRepostFormWarningDialog(repost_callback);
424 ASSERT_TRUE(delegate.last_repost_form_request());
425 EXPECT_EQ(delegate.last_repost_form_request()->web_state, web_state_.get());
426
420 // Test that GetJavaScriptDialogPresenter() is called. 427 // Test that GetJavaScriptDialogPresenter() is called.
421 TestJavaScriptDialogPresenter* presenter = 428 TestJavaScriptDialogPresenter* presenter =
422 delegate.GetTestJavaScriptDialogPresenter(); 429 delegate.GetTestJavaScriptDialogPresenter();
423 EXPECT_FALSE(delegate.get_java_script_dialog_presenter_called()); 430 EXPECT_FALSE(delegate.get_java_script_dialog_presenter_called());
424 EXPECT_TRUE(presenter->requested_dialogs().empty()); 431 EXPECT_TRUE(presenter->requested_dialogs().empty());
425 EXPECT_FALSE(presenter->cancel_dialogs_called()); 432 EXPECT_FALSE(presenter->cancel_dialogs_called());
426 433
427 __block bool callback_called = false; 434 __block bool callback_called = false;
428 web_state_->RunJavaScriptDialog(GURL(), JAVASCRIPT_DIALOG_TYPE_ALERT, @"", 435 web_state_->RunJavaScriptDialog(GURL(), JAVASCRIPT_DIALOG_TYPE_ALERT, @"",
429 nil, base::BindBlock(^(bool, NSString*) { 436 nil, base::BindBlock(^(bool, NSString*) {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 "</script>"); 673 "</script>");
667 674
668 base::test::ios::WaitUntilCondition(^{ 675 base::test::ios::WaitUntilCondition(^{
669 return message_received; 676 return message_received;
670 }); 677 });
671 web_state_->RemoveScriptCommandCallback("test"); 678 web_state_->RemoveScriptCommandCallback("test");
672 } 679 }
673 680
674 } // namespace 681 } // namespace
675 } // namespace web 682 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698