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

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

Issue 2711363003: Use DidFinishNavigation callback in LanguageDetectionController. (Closed)
Patch Set: Removed unused method 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_observer_bridge.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 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 // Tests |webState:webStateDidDismissInterstitial:| forwarding. 84 // Tests |webState:webStateDidDismissInterstitial:| forwarding.
85 TEST_F(WebStateObserverBridgeTest, InterstitialDismissed) { 85 TEST_F(WebStateObserverBridgeTest, InterstitialDismissed) {
86 ASSERT_FALSE([observer_ dismissInterstitialInfo]); 86 ASSERT_FALSE([observer_ dismissInterstitialInfo]);
87 87
88 bridge_->InterstitialDismissed(); 88 bridge_->InterstitialDismissed();
89 ASSERT_TRUE([observer_ dismissInterstitialInfo]); 89 ASSERT_TRUE([observer_ dismissInterstitialInfo]);
90 EXPECT_EQ(&test_web_state_, [observer_ dismissInterstitialInfo]->web_state); 90 EXPECT_EQ(&test_web_state_, [observer_ dismissInterstitialInfo]->web_state);
91 } 91 }
92 92
93 // Tests |webState:webStateDidChangeURLHash:| forwarding.
94 TEST_F(WebStateObserverBridgeTest, UrlHashChanged) {
95 ASSERT_FALSE([observer_ changeUrlHashInfo]);
96
97 bridge_->UrlHashChanged();
98 ASSERT_TRUE([observer_ changeUrlHashInfo]);
99 EXPECT_EQ(&test_web_state_, [observer_ changeUrlHashInfo]->web_state);
100 }
101
102 // Tests |webState:webStateDidChangeHistoryState:| forwarding.
103 TEST_F(WebStateObserverBridgeTest, HistoryStateChanged) {
104 ASSERT_FALSE([observer_ changeHistoryStateInfo]);
105
106 bridge_->HistoryStateChanged();
107 ASSERT_TRUE([observer_ changeHistoryStateInfo]);
108 EXPECT_EQ(&test_web_state_, [observer_ changeHistoryStateInfo]->web_state);
109 }
110
111 // Tests |webState:didChangeLoadingProgress:| forwarding. 93 // Tests |webState:didChangeLoadingProgress:| forwarding.
112 TEST_F(WebStateObserverBridgeTest, LoadProgressChanged) { 94 TEST_F(WebStateObserverBridgeTest, LoadProgressChanged) {
113 ASSERT_FALSE([observer_ changeLoadingProgressInfo]); 95 ASSERT_FALSE([observer_ changeLoadingProgressInfo]);
114 96
115 const double kTestLoadProgress = 0.75; 97 const double kTestLoadProgress = 0.75;
116 bridge_->LoadProgressChanged(kTestLoadProgress); 98 bridge_->LoadProgressChanged(kTestLoadProgress);
117 ASSERT_TRUE([observer_ changeLoadingProgressInfo]); 99 ASSERT_TRUE([observer_ changeLoadingProgressInfo]);
118 EXPECT_EQ(&test_web_state_, [observer_ changeLoadingProgressInfo]->web_state); 100 EXPECT_EQ(&test_web_state_, [observer_ changeLoadingProgressInfo]->web_state);
119 EXPECT_EQ(kTestLoadProgress, [observer_ changeLoadingProgressInfo]->progress); 101 EXPECT_EQ(kTestLoadProgress, [observer_ changeLoadingProgressInfo]->progress);
120 } 102 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // Tests |webState:webStateDidStartLoading:| forwarding. 184 // Tests |webState:webStateDidStartLoading:| forwarding.
203 TEST_F(WebStateObserverBridgeTest, DidStartLoading) { 185 TEST_F(WebStateObserverBridgeTest, DidStartLoading) {
204 ASSERT_FALSE([observer_ startLoadingInfo]); 186 ASSERT_FALSE([observer_ startLoadingInfo]);
205 187
206 bridge_->DidStartLoading(); 188 bridge_->DidStartLoading();
207 ASSERT_TRUE([observer_ startLoadingInfo]); 189 ASSERT_TRUE([observer_ startLoadingInfo]);
208 EXPECT_EQ(&test_web_state_, [observer_ startLoadingInfo]->web_state); 190 EXPECT_EQ(&test_web_state_, [observer_ startLoadingInfo]->web_state);
209 } 191 }
210 192
211 } // namespace web 193 } // namespace web
OLDNEW
« no previous file with comments | « 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