| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |