| 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 3060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3071 | 3071 |
| 3072 // Suppose it aborts before committing, if it's a 204 or download or due to a | 3072 // Suppose it aborts before committing, if it's a 204 or download or due to a |
| 3073 // stop or a new navigation from the user. The URL should remain visible. | 3073 // stop or a new navigation from the user. The URL should remain visible. |
| 3074 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; | 3074 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; |
| 3075 params.error_code = net::ERR_ABORTED; | 3075 params.error_code = net::ERR_ABORTED; |
| 3076 params.error_description = base::string16(); | 3076 params.error_description = base::string16(); |
| 3077 params.url = url; | 3077 params.url = url; |
| 3078 params.showing_repost_interstitial = false; | 3078 params.showing_repost_interstitial = false; |
| 3079 main_test_rfh()->OnMessageReceived( | 3079 main_test_rfh()->OnMessageReceived( |
| 3080 FrameHostMsg_DidFailProvisionalLoadWithError(0, params)); | 3080 FrameHostMsg_DidFailProvisionalLoadWithError(0, params)); |
| 3081 contents()->SetIsLoading(test_rvh(), false, true, NULL); | 3081 contents()->SetIsLoading(false, true, NULL); |
| 3082 EXPECT_EQ(url, controller.GetVisibleEntry()->GetURL()); | 3082 EXPECT_EQ(url, controller.GetVisibleEntry()->GetURL()); |
| 3083 | 3083 |
| 3084 // If something else later modifies the contents of the about:blank page, then | 3084 // If something else later modifies the contents of the about:blank page, then |
| 3085 // we must revert to showing about:blank to avoid a URL spoof. | 3085 // we must revert to showing about:blank to avoid a URL spoof. |
| 3086 main_test_rfh()->OnMessageReceived(FrameHostMsg_DidAccessInitialDocument(0)); | 3086 main_test_rfh()->OnMessageReceived(FrameHostMsg_DidAccessInitialDocument(0)); |
| 3087 EXPECT_TRUE(contents()->HasAccessedInitialDocument()); | 3087 EXPECT_TRUE(contents()->HasAccessedInitialDocument()); |
| 3088 EXPECT_FALSE(controller.GetVisibleEntry()); | 3088 EXPECT_FALSE(controller.GetVisibleEntry()); |
| 3089 EXPECT_FALSE(controller.GetPendingEntry()); | 3089 EXPECT_FALSE(controller.GetPendingEntry()); |
| 3090 | 3090 |
| 3091 notifications.Reset(); | 3091 notifications.Reset(); |
| (...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4523 { | 4523 { |
| 4524 LoadCommittedDetails details; | 4524 LoadCommittedDetails details; |
| 4525 controller_impl().RendererDidNavigate(main_test_rfh(), params, &details); | 4525 controller_impl().RendererDidNavigate(main_test_rfh(), params, &details); |
| 4526 EXPECT_EQ(PAGE_TYPE_ERROR, | 4526 EXPECT_EQ(PAGE_TYPE_ERROR, |
| 4527 controller_impl().GetLastCommittedEntry()->GetPageType()); | 4527 controller_impl().GetLastCommittedEntry()->GetPageType()); |
| 4528 EXPECT_EQ(NAVIGATION_TYPE_IN_PAGE, details.type); | 4528 EXPECT_EQ(NAVIGATION_TYPE_IN_PAGE, details.type); |
| 4529 } | 4529 } |
| 4530 } | 4530 } |
| 4531 | 4531 |
| 4532 } // namespace content | 4532 } // namespace content |
| OLD | NEW |