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 "content/browser/frame_host/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 3449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3460 EXPECT_EQ(url, controller.GetPendingEntry()->GetURL()); | 3460 EXPECT_EQ(url, controller.GetPendingEntry()->GetURL()); |
3461 EXPECT_FALSE(controller.GetPendingEntry()->is_renderer_initiated()); | 3461 EXPECT_FALSE(controller.GetPendingEntry()->is_renderer_initiated()); |
3462 EXPECT_TRUE(controller.IsInitialNavigation()); | 3462 EXPECT_TRUE(controller.IsInitialNavigation()); |
3463 EXPECT_FALSE(contents()->HasAccessedInitialDocument()); | 3463 EXPECT_FALSE(contents()->HasAccessedInitialDocument()); |
3464 | 3464 |
3465 // There should be no title yet. | 3465 // There should be no title yet. |
3466 EXPECT_TRUE(contents()->GetTitle().empty()); | 3466 EXPECT_TRUE(contents()->GetTitle().empty()); |
3467 | 3467 |
3468 // Suppose it aborts before committing, if it's a 204 or download or due to a | 3468 // Suppose it aborts before committing, if it's a 204 or download or due to a |
3469 // stop or a new navigation from the user. The URL should remain visible. | 3469 // stop or a new navigation from the user. The URL should remain visible. |
3470 if (IsBrowserSideNavigationEnabled()) { | 3470 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; |
3471 static_cast<NavigatorImpl*>(main_test_rfh()->frame_tree_node()->navigator()) | 3471 params.error_code = net::ERR_ABORTED; |
3472 ->CancelNavigation(main_test_rfh()->frame_tree_node()); | 3472 params.error_description = base::string16(); |
3473 } else { | 3473 params.url = url; |
3474 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; | 3474 params.showing_repost_interstitial = false; |
3475 params.error_code = net::ERR_ABORTED; | 3475 main_test_rfh()->OnMessageReceived( |
3476 params.error_description = base::string16(); | 3476 FrameHostMsg_DidFailProvisionalLoadWithError(0, params)); |
3477 params.url = url; | 3477 contents()->SetIsLoading(false, true, NULL); |
3478 params.showing_repost_interstitial = false; | |
3479 main_test_rfh()->OnMessageReceived( | |
3480 FrameHostMsg_DidFailProvisionalLoadWithError(0, params)); | |
3481 main_test_rfh()->OnMessageReceived(FrameHostMsg_DidStopLoading(0)); | |
3482 } | |
3483 EXPECT_EQ(url, controller.GetVisibleEntry()->GetURL()); | 3478 EXPECT_EQ(url, controller.GetVisibleEntry()->GetURL()); |
3484 | 3479 |
3485 // If something else later modifies the contents of the about:blank page, then | 3480 // If something else later modifies the contents of the about:blank page, then |
3486 // we must revert to showing about:blank to avoid a URL spoof. | 3481 // we must revert to showing about:blank to avoid a URL spoof. |
3487 main_test_rfh()->OnMessageReceived(FrameHostMsg_DidAccessInitialDocument(0)); | 3482 main_test_rfh()->OnMessageReceived(FrameHostMsg_DidAccessInitialDocument(0)); |
3488 EXPECT_TRUE(contents()->HasAccessedInitialDocument()); | 3483 EXPECT_TRUE(contents()->HasAccessedInitialDocument()); |
3489 EXPECT_FALSE(controller.GetVisibleEntry()); | 3484 EXPECT_FALSE(controller.GetVisibleEntry()); |
3490 EXPECT_FALSE(controller.GetPendingEntry()); | 3485 EXPECT_FALSE(controller.GetPendingEntry()); |
3491 | 3486 |
3492 notifications.Reset(); | 3487 notifications.Reset(); |
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5123 EXPECT_EQ(default_ssl_status.connection_status, | 5118 EXPECT_EQ(default_ssl_status.connection_status, |
5124 details.ssl_status.connection_status); | 5119 details.ssl_status.connection_status); |
5125 EXPECT_EQ(default_ssl_status.content_status, | 5120 EXPECT_EQ(default_ssl_status.content_status, |
5126 details.ssl_status.content_status); | 5121 details.ssl_status.content_status); |
5127 EXPECT_EQ(0u, details.ssl_status.signed_certificate_timestamp_ids.size()); | 5122 EXPECT_EQ(0u, details.ssl_status.signed_certificate_timestamp_ids.size()); |
5128 | 5123 |
5129 EXPECT_EQ(1, main_test_rfh()->GetProcess()->bad_msg_count()); | 5124 EXPECT_EQ(1, main_test_rfh()->GetProcess()->bad_msg_count()); |
5130 } | 5125 } |
5131 | 5126 |
5132 } // namespace content | 5127 } // namespace content |
OLD | NEW |