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

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

Issue 2879413002: Pass NavigationContext to WebStateImpl::OnNavigationStarted. (Closed)
Patch Set: Fixed tests Created 3 years, 7 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/chrome/browser/tabs/tab_unittest.mm ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/navigation_callbacks_inttest.mm
diff --git a/ios/web/web_state/navigation_callbacks_inttest.mm b/ios/web/web_state/navigation_callbacks_inttest.mm
index 23b2f6af14c3c99ba739c810ed1b8acce9648010..1d7730898129e0e2d79e526884304b3bb34676fa 100644
--- a/ios/web/web_state/navigation_callbacks_inttest.mm
+++ b/ios/web/web_state/navigation_callbacks_inttest.mm
@@ -109,7 +109,7 @@ TEST_F(StartAndFinishNavigationTest, NewPageNavigation) {
web::test::SetUpSimpleHttpServer(responses);
// Perform new page navigation.
- EXPECT_CALL(*observer_, ProvisionalNavigationStarted(_));
+ EXPECT_CALL(*observer_, ProvisionalNavigationStarted(url));
EXPECT_CALL(*observer_, DidFinishNavigation(_))
.WillOnce(VerifyNewPageContext(web_state(), url));
LoadUrl(url);
@@ -123,20 +123,20 @@ TEST_F(StartAndFinishNavigationTest, UserInitiatedHashChangeNavigation) {
web::test::SetUpSimpleHttpServer(responses);
// Perform new page navigation.
- EXPECT_CALL(*observer_, ProvisionalNavigationStarted(_));
+ EXPECT_CALL(*observer_, ProvisionalNavigationStarted(url));
EXPECT_CALL(*observer_, DidFinishNavigation(_))
.WillOnce(VerifyNewPageContext(web_state(), url));
LoadUrl(url);
// Perform same-page navigation.
const GURL hash_url = HttpServer::MakeUrl("http://chromium.test#1");
- EXPECT_CALL(*observer_, ProvisionalNavigationStarted(_));
+ EXPECT_CALL(*observer_, ProvisionalNavigationStarted(hash_url));
EXPECT_CALL(*observer_, DidFinishNavigation(_))
.WillOnce(VerifySameDocumentContext(web_state(), hash_url));
LoadUrl(hash_url);
// Perform same-page navigation by going back.
- EXPECT_CALL(*observer_, ProvisionalNavigationStarted(_));
+ EXPECT_CALL(*observer_, ProvisionalNavigationStarted(url));
EXPECT_CALL(*observer_, DidFinishNavigation(_))
.WillOnce(VerifySameDocumentContext(web_state(), url));
ExecuteBlockAndWaitForLoad(url, ^{
@@ -152,14 +152,14 @@ TEST_F(StartAndFinishNavigationTest, RendererInitiatedHashChangeNavigation) {
web::test::SetUpSimpleHttpServer(responses);
// Perform new page navigation.
- EXPECT_CALL(*observer_, ProvisionalNavigationStarted(_));
+ EXPECT_CALL(*observer_, ProvisionalNavigationStarted(url));
EXPECT_CALL(*observer_, DidFinishNavigation(_))
.WillOnce(VerifyNewPageContext(web_state(), url));
LoadUrl(url);
// Perform same-page navigation using JavaScript.
const GURL hash_url = HttpServer::MakeUrl("http://chromium.test#1");
- EXPECT_CALL(*observer_, ProvisionalNavigationStarted(_));
+ EXPECT_CALL(*observer_, ProvisionalNavigationStarted(hash_url));
EXPECT_CALL(*observer_, DidFinishNavigation(_))
.WillOnce(VerifySameDocumentContext(web_state(), hash_url));
ExecuteJavaScript(@"window.location.hash = '#1'");
@@ -173,21 +173,21 @@ TEST_F(StartAndFinishNavigationTest, StateNavigation) {
web::test::SetUpSimpleHttpServer(responses);
// Perform new page navigation.
- EXPECT_CALL(*observer_, ProvisionalNavigationStarted(_));
+ EXPECT_CALL(*observer_, ProvisionalNavigationStarted(url));
EXPECT_CALL(*observer_, DidFinishNavigation(_))
.WillOnce(VerifyNewPageContext(web_state(), url));
LoadUrl(url);
// Perform push state using JavaScript.
const GURL push_url = HttpServer::MakeUrl("http://chromium.test/test.html");
- EXPECT_CALL(*observer_, ProvisionalNavigationStarted(_));
+ EXPECT_CALL(*observer_, ProvisionalNavigationStarted(push_url));
EXPECT_CALL(*observer_, DidFinishNavigation(_))
.WillOnce(VerifySameDocumentContext(web_state(), push_url));
ExecuteJavaScript(@"window.history.pushState('', 'Test', 'test.html')");
// Perform replace state using JavaScript.
const GURL replace_url = HttpServer::MakeUrl("http://chromium.test/1.html");
- EXPECT_CALL(*observer_, ProvisionalNavigationStarted(_));
+ EXPECT_CALL(*observer_, ProvisionalNavigationStarted(replace_url));
EXPECT_CALL(*observer_, DidFinishNavigation(_))
.WillOnce(VerifySameDocumentContext(web_state(), replace_url));
ExecuteJavaScript(@"window.history.replaceState('', 'Test', '1.html')");
@@ -196,7 +196,7 @@ TEST_F(StartAndFinishNavigationTest, StateNavigation) {
// Tests native content navigation.
TEST_F(StartAndFinishNavigationTest, NativeContentNavigation) {
GURL url(url::SchemeHostPort(kTestNativeContentScheme, "ui", 0).Serialize());
- EXPECT_CALL(*observer_, ProvisionalNavigationStarted(_));
+ EXPECT_CALL(*observer_, ProvisionalNavigationStarted(url));
EXPECT_CALL(*observer_, DidFinishNavigation(_))
.WillOnce(VerifyNewNativePageContext(web_state(), url));
LoadUrl(url);
« no previous file with comments | « ios/chrome/browser/tabs/tab_unittest.mm ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698