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

Unified Diff: ios/web/web_state/web_state_observer_bridge_unittest.mm

Issue 2718733003: Removed -[CRWWebDelegate webDidUpdateHistoryStateWithPageURL]. (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/web_state_observer_bridge_unittest.mm
diff --git a/ios/web/web_state/web_state_observer_bridge_unittest.mm b/ios/web/web_state/web_state_observer_bridge_unittest.mm
index 4e2008842f9f92303f491db18dcef87dcce32ebd..03d8bf4889815da6dab0aa250cd5f1a8785d256b 100644
--- a/ios/web/web_state/web_state_observer_bridge_unittest.mm
+++ b/ios/web/web_state/web_state_observer_bridge_unittest.mm
@@ -10,6 +10,7 @@
#import "ios/web/public/test/fakes/crw_test_web_state_observer.h"
#import "ios/web/public/test/fakes/test_web_state.h"
#import "ios/web/public/web_state/web_state_observer_bridge.h"
+#include "ios/web/web_state/navigation_context_impl.h"
#include "testing/platform_test.h"
namespace web {
@@ -40,6 +41,21 @@ TEST_F(WebStateObserverBridgeTest, ProvisionalNavigationStarted) {
EXPECT_EQ(url, [observer_ startProvisionalNavigationInfo]->url);
}
+// Tests |webState:didFinishNavigation:| forwarding.
+TEST_F(WebStateObserverBridgeTest, DidFinishNavigation) {
+ ASSERT_FALSE([observer_ didFinishNavigationInfo]);
+
+ GURL url("https://chromium.test/");
+ std::unique_ptr<web::NavigationContext> context =
+ web::NavigationContextImpl::CreateNavigationContext(&test_web_state_,
+ url);
+ bridge_->DidFinishNavigation(context.get());
+
+ ASSERT_TRUE([observer_ didFinishNavigationInfo]);
+ EXPECT_EQ(&test_web_state_, [observer_ didFinishNavigationInfo]->web_state);
+ EXPECT_EQ(context.get(), [observer_ didFinishNavigationInfo]->context);
+}
+
// Tests |webState:didCommitNavigationWithDetails:| forwarding.
TEST_F(WebStateObserverBridgeTest, NavigationItemCommitted) {
ASSERT_FALSE([observer_ commitNavigationInfo]);
« 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