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

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

Issue 2755013002: Removed webControllerDidSuppressDialog: callback. (Closed)
Patch Set: Self review Created 3 years, 9 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') | ios/web/web_state/web_state_observer_bridge.mm » ('j') | 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 ASSERT_TRUE(observer->title_was_set_info()); 276 ASSERT_TRUE(observer->title_was_set_info());
277 EXPECT_EQ(web_state_.get(), observer->title_was_set_info()->web_state); 277 EXPECT_EQ(web_state_.get(), observer->title_was_set_info()->web_state);
278 278
279 // Test that DidChangeVisibleSecurityState() is called. 279 // Test that DidChangeVisibleSecurityState() is called.
280 ASSERT_FALSE(observer->did_change_visible_security_state_info()); 280 ASSERT_FALSE(observer->did_change_visible_security_state_info());
281 web_state_->OnVisibleSecurityStateChange(); 281 web_state_->OnVisibleSecurityStateChange();
282 ASSERT_TRUE(observer->did_change_visible_security_state_info()); 282 ASSERT_TRUE(observer->did_change_visible_security_state_info());
283 EXPECT_EQ(web_state_.get(), 283 EXPECT_EQ(web_state_.get(),
284 observer->did_change_visible_security_state_info()->web_state); 284 observer->did_change_visible_security_state_info()->web_state);
285 285
286 // Test that DidSuppressDialog() is called.
287 ASSERT_FALSE(observer->did_suppress_dialog_info());
288 web_state_->SetShouldSuppressDialogs(true);
289 web_state_->OnDialogSuppressed();
290 ASSERT_TRUE(observer->did_suppress_dialog_info());
291 EXPECT_EQ(web_state_.get(), observer->did_suppress_dialog_info()->web_state);
292
286 // Test that DocumentSubmitted() is called. 293 // Test that DocumentSubmitted() is called.
287 ASSERT_FALSE(observer->submit_document_info()); 294 ASSERT_FALSE(observer->submit_document_info());
288 std::string kTestFormName("form-name"); 295 std::string kTestFormName("form-name");
289 BOOL user_initiated = true; 296 BOOL user_initiated = true;
290 web_state_->OnDocumentSubmitted(kTestFormName, user_initiated); 297 web_state_->OnDocumentSubmitted(kTestFormName, user_initiated);
291 ASSERT_TRUE(observer->submit_document_info()); 298 ASSERT_TRUE(observer->submit_document_info());
292 EXPECT_EQ(web_state_.get(), observer->submit_document_info()->web_state); 299 EXPECT_EQ(web_state_.get(), observer->submit_document_info()->web_state);
293 EXPECT_EQ(kTestFormName, observer->submit_document_info()->form_name); 300 EXPECT_EQ(kTestFormName, observer->submit_document_info()->form_name);
294 EXPECT_EQ(user_initiated, observer->submit_document_info()->user_initiated); 301 EXPECT_EQ(user_initiated, observer->submit_document_info()->user_initiated);
295 302
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 // Check that a false return value is forwarded correctly. 675 // Check that a false return value is forwarded correctly.
669 EXPECT_FALSE( 676 EXPECT_FALSE(
670 web_state_->OnScriptCommandReceived(kCommand2, value_2, kUrl2, false)); 677 web_state_->OnScriptCommandReceived(kCommand2, value_2, kUrl2, false));
671 EXPECT_FALSE(is_called_1); 678 EXPECT_FALSE(is_called_1);
672 EXPECT_TRUE(is_called_2); 679 EXPECT_TRUE(is_called_2);
673 680
674 web_state_->RemoveScriptCommandCallback(kPrefix2); 681 web_state_->RemoveScriptCommandCallback(kPrefix2);
675 } 682 }
676 683
677 } // namespace web 684 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | ios/web/web_state/web_state_observer_bridge.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698