| OLD | NEW |
| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 bridge_->PageLoaded(PageLoadCompletionStatus::FAILURE); | 78 bridge_->PageLoaded(PageLoadCompletionStatus::FAILURE); |
| 79 ASSERT_TRUE([observer_ loadPageInfo]); | 79 ASSERT_TRUE([observer_ loadPageInfo]); |
| 80 EXPECT_EQ(&test_web_state_, [observer_ loadPageInfo]->web_state); | 80 EXPECT_EQ(&test_web_state_, [observer_ loadPageInfo]->web_state); |
| 81 EXPECT_FALSE([observer_ loadPageInfo]->success); | 81 EXPECT_FALSE([observer_ loadPageInfo]->success); |
| 82 } | 82 } |
| 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 // TODO(crbug.com/687735): Fix this method name. | 88 bridge_->InterstitialDismissed(); |
| 89 bridge_->InsterstitialDismissed(); | |
| 90 ASSERT_TRUE([observer_ dismissInterstitialInfo]); | 89 ASSERT_TRUE([observer_ dismissInterstitialInfo]); |
| 91 EXPECT_EQ(&test_web_state_, [observer_ dismissInterstitialInfo]->web_state); | 90 EXPECT_EQ(&test_web_state_, [observer_ dismissInterstitialInfo]->web_state); |
| 92 } | 91 } |
| 93 | 92 |
| 94 // Tests |webState:webStateDidChangeURLHash:| forwarding. | 93 // Tests |webState:webStateDidChangeURLHash:| forwarding. |
| 95 TEST_F(WebStateObserverBridgeTest, UrlHashChanged) { | 94 TEST_F(WebStateObserverBridgeTest, UrlHashChanged) { |
| 96 ASSERT_FALSE([observer_ changeUrlHashInfo]); | 95 ASSERT_FALSE([observer_ changeUrlHashInfo]); |
| 97 | 96 |
| 98 bridge_->UrlHashChanged(); | 97 bridge_->UrlHashChanged(); |
| 99 ASSERT_TRUE([observer_ changeUrlHashInfo]); | 98 ASSERT_TRUE([observer_ changeUrlHashInfo]); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // Tests |webState:webStateDidStartLoading:| forwarding. | 202 // Tests |webState:webStateDidStartLoading:| forwarding. |
| 204 TEST_F(WebStateObserverBridgeTest, DidStartLoading) { | 203 TEST_F(WebStateObserverBridgeTest, DidStartLoading) { |
| 205 ASSERT_FALSE([observer_ startLoadingInfo]); | 204 ASSERT_FALSE([observer_ startLoadingInfo]); |
| 206 | 205 |
| 207 bridge_->DidStartLoading(); | 206 bridge_->DidStartLoading(); |
| 208 ASSERT_TRUE([observer_ startLoadingInfo]); | 207 ASSERT_TRUE([observer_ startLoadingInfo]); |
| 209 EXPECT_EQ(&test_web_state_, [observer_ startLoadingInfo]->web_state); | 208 EXPECT_EQ(&test_web_state_, [observer_ startLoadingInfo]->web_state); |
| 210 } | 209 } |
| 211 | 210 |
| 212 } // namespace web | 211 } // namespace web |
| OLD | NEW |