OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 entry->GetBrowserInitiatedPostData()); | 492 entry->GetBrowserInitiatedPostData()); |
493 EXPECT_EQ(load_params.transferred_global_request_id, | 493 EXPECT_EQ(load_params.transferred_global_request_id, |
494 entry->transferred_global_request_id()); | 494 entry->transferred_global_request_id()); |
495 } | 495 } |
496 | 496 |
497 TEST_F(NavigationControllerTest, LoadURLWithParams) { | 497 TEST_F(NavigationControllerTest, LoadURLWithParams) { |
498 NavigationControllerImpl& controller = controller_impl(); | 498 NavigationControllerImpl& controller = controller_impl(); |
499 | 499 |
500 NavigationController::LoadURLParams load_params(GURL("http://foo")); | 500 NavigationController::LoadURLParams load_params(GURL("http://foo")); |
501 load_params.referrer = | 501 load_params.referrer = |
502 Referrer(GURL("http://referrer"), WebKit::WebReferrerPolicyDefault); | 502 Referrer(GURL("http://referrer"), blink::WebReferrerPolicyDefault); |
503 load_params.transition_type = PAGE_TRANSITION_GENERATED; | 503 load_params.transition_type = PAGE_TRANSITION_GENERATED; |
504 load_params.extra_headers = "content-type: text/plain"; | 504 load_params.extra_headers = "content-type: text/plain"; |
505 load_params.load_type = NavigationController::LOAD_TYPE_DEFAULT; | 505 load_params.load_type = NavigationController::LOAD_TYPE_DEFAULT; |
506 load_params.is_renderer_initiated = true; | 506 load_params.is_renderer_initiated = true; |
507 load_params.override_user_agent = NavigationController::UA_OVERRIDE_TRUE; | 507 load_params.override_user_agent = NavigationController::UA_OVERRIDE_TRUE; |
508 load_params.transferred_global_request_id = GlobalRequestID(2, 3); | 508 load_params.transferred_global_request_id = GlobalRequestID(2, 3); |
509 | 509 |
510 controller.LoadURLWithParams(load_params); | 510 controller.LoadURLWithParams(load_params); |
511 NavigationEntryImpl* entry = | 511 NavigationEntryImpl* entry = |
512 NavigationEntryImpl::FromNavigationEntry( | 512 NavigationEntryImpl::FromNavigationEntry( |
(...skipping 3322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3835 EXPECT_EQ(1, controller.GetEntryCount()); | 3835 EXPECT_EQ(1, controller.GetEntryCount()); |
3836 EXPECT_EQ(0, controller.GetCurrentEntryIndex()); | 3836 EXPECT_EQ(0, controller.GetCurrentEntryIndex()); |
3837 EXPECT_EQ(0, controller.GetLastCommittedEntryIndex()); | 3837 EXPECT_EQ(0, controller.GetLastCommittedEntryIndex()); |
3838 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); | 3838 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); |
3839 EXPECT_FALSE(controller.CanGoBack()); | 3839 EXPECT_FALSE(controller.CanGoBack()); |
3840 EXPECT_FALSE(controller.CanGoForward()); | 3840 EXPECT_FALSE(controller.CanGoForward()); |
3841 EXPECT_EQ(url4, controller.GetVisibleEntry()->GetURL()); | 3841 EXPECT_EQ(url4, controller.GetVisibleEntry()->GetURL()); |
3842 } | 3842 } |
3843 | 3843 |
3844 } // namespace content | 3844 } // namespace content |
OLD | NEW |