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

Side by Side Diff: ios/web/web_state/web_state_impl_unittest.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 unified diff | Download patch
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | ios/web/webui/crw_web_ui_manager_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/web_state/web_state_impl.h" 5 #import "ios/web/web_state/web_state_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 observer->did_finish_navigation_info()->web_state); 358 observer->did_finish_navigation_info()->web_state);
359 NavigationContext* actual_context = 359 NavigationContext* actual_context =
360 observer->did_finish_navigation_info()->context.get(); 360 observer->did_finish_navigation_info()->context.get();
361 EXPECT_EQ(context->GetUrl(), actual_context->GetUrl()); 361 EXPECT_EQ(context->GetUrl(), actual_context->GetUrl());
362 EXPECT_FALSE(actual_context->IsSameDocument()); 362 EXPECT_FALSE(actual_context->IsSameDocument());
363 EXPECT_FALSE(actual_context->IsErrorPage()); 363 EXPECT_FALSE(actual_context->IsErrorPage());
364 EXPECT_FALSE(actual_context->GetResponseHeaders()); 364 EXPECT_FALSE(actual_context->GetResponseHeaders());
365 365
366 // Test that OnNavigationFinished() is called. 366 // Test that OnNavigationFinished() is called.
367 ASSERT_FALSE(observer->start_provisional_navigation_info()); 367 ASSERT_FALSE(observer->start_provisional_navigation_info());
368 web_state_->OnProvisionalNavigationStarted(url); 368 web_state_->OnNavigationStarted(context.get());
369 ASSERT_TRUE(observer->start_provisional_navigation_info()); 369 ASSERT_TRUE(observer->start_provisional_navigation_info());
370 EXPECT_EQ(web_state_.get(), 370 EXPECT_EQ(web_state_.get(),
371 observer->start_provisional_navigation_info()->web_state); 371 observer->start_provisional_navigation_info()->web_state);
372 EXPECT_EQ(url, observer->start_provisional_navigation_info()->url); 372 EXPECT_EQ(url, observer->start_provisional_navigation_info()->url);
373 373
374 // Test that NavigationItemsPruned() is called. 374 // Test that NavigationItemsPruned() is called.
375 ASSERT_FALSE(observer->navigation_items_pruned_info()); 375 ASSERT_FALSE(observer->navigation_items_pruned_info());
376 web_state_->OnNavigationItemsPruned(1); 376 web_state_->OnNavigationItemsPruned(1);
377 ASSERT_TRUE(observer->navigation_items_pruned_info()); 377 ASSERT_TRUE(observer->navigation_items_pruned_info());
378 EXPECT_EQ(web_state_.get(), 378 EXPECT_EQ(web_state_.get(),
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 // Set |created_with_opener| to true and verify that HasOpener() returns true. 683 // Set |created_with_opener| to true and verify that HasOpener() returns true.
684 WebState::CreateParams params_with_opener = 684 WebState::CreateParams params_with_opener =
685 WebState::CreateParams(GetBrowserState()); 685 WebState::CreateParams(GetBrowserState());
686 params_with_opener.created_with_opener = true; 686 params_with_opener.created_with_opener = true;
687 std::unique_ptr<WebState> web_state_with_opener = 687 std::unique_ptr<WebState> web_state_with_opener =
688 WebState::Create(params_with_opener); 688 WebState::Create(params_with_opener);
689 EXPECT_TRUE(web_state_with_opener->HasOpener()); 689 EXPECT_TRUE(web_state_with_opener->HasOpener());
690 } 690 }
691 691
692 } // namespace web 692 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | ios/web/webui/crw_web_ui_manager_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698