| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 3073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3084 | 3084 |
| 3085 // Suppose it aborts before committing, if it's a 204 or download or due to a | 3085 // Suppose it aborts before committing, if it's a 204 or download or due to a |
| 3086 // stop or a new navigation from the user. The URL should remain visible. | 3086 // stop or a new navigation from the user. The URL should remain visible. |
| 3087 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; | 3087 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; |
| 3088 params.error_code = net::ERR_ABORTED; | 3088 params.error_code = net::ERR_ABORTED; |
| 3089 params.error_description = base::string16(); | 3089 params.error_description = base::string16(); |
| 3090 params.url = url; | 3090 params.url = url; |
| 3091 params.showing_repost_interstitial = false; | 3091 params.showing_repost_interstitial = false; |
| 3092 main_test_rfh()->OnMessageReceived( | 3092 main_test_rfh()->OnMessageReceived( |
| 3093 FrameHostMsg_DidFailProvisionalLoadWithError(0, params)); | 3093 FrameHostMsg_DidFailProvisionalLoadWithError(0, params)); |
| 3094 contents()->SetIsLoading(test_rvh(), false, true, NULL); | 3094 contents()->SetIsLoading(false, true, NULL); |
| 3095 EXPECT_EQ(url, controller.GetVisibleEntry()->GetURL()); | 3095 EXPECT_EQ(url, controller.GetVisibleEntry()->GetURL()); |
| 3096 | 3096 |
| 3097 // If something else later modifies the contents of the about:blank page, then | 3097 // If something else later modifies the contents of the about:blank page, then |
| 3098 // we must revert to showing about:blank to avoid a URL spoof. | 3098 // we must revert to showing about:blank to avoid a URL spoof. |
| 3099 main_test_rfh()->OnMessageReceived(FrameHostMsg_DidAccessInitialDocument(0)); | 3099 main_test_rfh()->OnMessageReceived(FrameHostMsg_DidAccessInitialDocument(0)); |
| 3100 EXPECT_TRUE(contents()->HasAccessedInitialDocument()); | 3100 EXPECT_TRUE(contents()->HasAccessedInitialDocument()); |
| 3101 EXPECT_FALSE(controller.GetVisibleEntry()); | 3101 EXPECT_FALSE(controller.GetVisibleEntry()); |
| 3102 EXPECT_FALSE(controller.GetPendingEntry()); | 3102 EXPECT_FALSE(controller.GetPendingEntry()); |
| 3103 | 3103 |
| 3104 notifications.Reset(); | 3104 notifications.Reset(); |
| (...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4536 { | 4536 { |
| 4537 LoadCommittedDetails details; | 4537 LoadCommittedDetails details; |
| 4538 controller_impl().RendererDidNavigate(main_test_rfh(), params, &details); | 4538 controller_impl().RendererDidNavigate(main_test_rfh(), params, &details); |
| 4539 EXPECT_EQ(PAGE_TYPE_ERROR, | 4539 EXPECT_EQ(PAGE_TYPE_ERROR, |
| 4540 controller_impl().GetLastCommittedEntry()->GetPageType()); | 4540 controller_impl().GetLastCommittedEntry()->GetPageType()); |
| 4541 EXPECT_EQ(NAVIGATION_TYPE_IN_PAGE, details.type); | 4541 EXPECT_EQ(NAVIGATION_TYPE_IN_PAGE, details.type); |
| 4542 } | 4542 } |
| 4543 } | 4543 } |
| 4544 | 4544 |
| 4545 } // namespace content | 4545 } // namespace content |
| OLD | NEW |