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

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

Issue 2710913006: Removed -[CRWWebDelegate webController:titleDidChange:]. (Closed)
Patch Set: iOS9 fix 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
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/web_state/web_state_observer_bridge.h" 5 #import "ios/web/public/web_state/web_state_observer_bridge.h"
6 6
7 #import "base/mac/scoped_nsobject.h" 7 #import "base/mac/scoped_nsobject.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "ios/web/public/favicon_url.h" 9 #include "ios/web/public/favicon_url.h"
10 #import "ios/web/public/test/fakes/crw_test_web_state_observer.h" 10 #import "ios/web/public/test/fakes/crw_test_web_state_observer.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 TEST_F(WebStateObserverBridgeTest, LoadProgressChanged) { 112 TEST_F(WebStateObserverBridgeTest, LoadProgressChanged) {
113 ASSERT_FALSE([observer_ changeLoadingProgressInfo]); 113 ASSERT_FALSE([observer_ changeLoadingProgressInfo]);
114 114
115 const double kTestLoadProgress = 0.75; 115 const double kTestLoadProgress = 0.75;
116 bridge_->LoadProgressChanged(kTestLoadProgress); 116 bridge_->LoadProgressChanged(kTestLoadProgress);
117 ASSERT_TRUE([observer_ changeLoadingProgressInfo]); 117 ASSERT_TRUE([observer_ changeLoadingProgressInfo]);
118 EXPECT_EQ(&test_web_state_, [observer_ changeLoadingProgressInfo]->web_state); 118 EXPECT_EQ(&test_web_state_, [observer_ changeLoadingProgressInfo]->web_state);
119 EXPECT_EQ(kTestLoadProgress, [observer_ changeLoadingProgressInfo]->progress); 119 EXPECT_EQ(kTestLoadProgress, [observer_ changeLoadingProgressInfo]->progress);
120 } 120 }
121 121
122 // Tests |webStateDidChangeTitle:| forwarding.
123 TEST_F(WebStateObserverBridgeTest, TitleWasSet) {
124 ASSERT_FALSE([observer_ titleWasSetInfo]);
125
126 bridge_->TitleWasSet();
127 ASSERT_TRUE([observer_ titleWasSetInfo]);
128 EXPECT_EQ(&test_web_state_, [observer_ titleWasSetInfo]->web_state);
129 }
130
122 // Tests |webState:didSubmitDocumentWithFormNamed:userInitiated:| forwarding. 131 // Tests |webState:didSubmitDocumentWithFormNamed:userInitiated:| forwarding.
123 TEST_F(WebStateObserverBridgeTest, DocumentSubmitted) { 132 TEST_F(WebStateObserverBridgeTest, DocumentSubmitted) {
124 ASSERT_FALSE([observer_ submitDocumentInfo]); 133 ASSERT_FALSE([observer_ submitDocumentInfo]);
125 134
126 std::string kTestFormName("form-name"); 135 std::string kTestFormName("form-name");
127 BOOL user_initiated = YES; 136 BOOL user_initiated = YES;
128 bridge_->DocumentSubmitted(kTestFormName, user_initiated); 137 bridge_->DocumentSubmitted(kTestFormName, user_initiated);
129 ASSERT_TRUE([observer_ submitDocumentInfo]); 138 ASSERT_TRUE([observer_ submitDocumentInfo]);
130 EXPECT_EQ(&test_web_state_, [observer_ submitDocumentInfo]->web_state); 139 EXPECT_EQ(&test_web_state_, [observer_ submitDocumentInfo]->web_state);
131 EXPECT_EQ(kTestFormName, [observer_ submitDocumentInfo]->form_name); 140 EXPECT_EQ(kTestFormName, [observer_ submitDocumentInfo]->form_name);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // Tests |webState:webStateDidStartLoading:| forwarding. 211 // Tests |webState:webStateDidStartLoading:| forwarding.
203 TEST_F(WebStateObserverBridgeTest, DidStartLoading) { 212 TEST_F(WebStateObserverBridgeTest, DidStartLoading) {
204 ASSERT_FALSE([observer_ startLoadingInfo]); 213 ASSERT_FALSE([observer_ startLoadingInfo]);
205 214
206 bridge_->DidStartLoading(); 215 bridge_->DidStartLoading();
207 ASSERT_TRUE([observer_ startLoadingInfo]); 216 ASSERT_TRUE([observer_ startLoadingInfo]);
208 EXPECT_EQ(&test_web_state_, [observer_ startLoadingInfo]->web_state); 217 EXPECT_EQ(&test_web_state_, [observer_ startLoadingInfo]->web_state);
209 } 218 }
210 219
211 } // namespace web 220 } // namespace web
OLDNEW
« ios/web/web_state/ui/crw_web_controller.mm ('K') | « ios/web/web_state/web_state_observer_bridge.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698