Chromium Code Reviews| 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 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 409 // 1. Pending entry for A is created. | 409 // 1. Pending entry for A is created. |
| 410 // 2. DidStartProvisionalLoad message for A arrives. | 410 // 2. DidStartProvisionalLoad message for A arrives. |
| 411 // 3. Pending entry for B is created. | 411 // 3. Pending entry for B is created. |
| 412 // 4. DidFailProvisionalLoad message for A arrives. The logic here discards. | 412 // 4. DidFailProvisionalLoad message for A arrives. The logic here discards. |
| 413 // 5. DidStartProvisionalLoad message for B arrives. | 413 // 5. DidStartProvisionalLoad message for B arrives. |
| 414 // | 414 // |
| 415 // At step (4), the pending entry for B is discarded, when A is the one that | 415 // At step (4), the pending entry for B is discarded, when A is the one that |
| 416 // is being aborted. This caused the last committed entry to be displayed in | 416 // is being aborted. This caused the last committed entry to be displayed in |
| 417 // the omnibox, which is the entry before A was created. | 417 // the omnibox, which is the entry before A was created. |
| 418 TEST_F(NavigationControllerTest, DontDiscardWrongPendingEntry) { | 418 TEST_F(NavigationControllerTest, DontDiscardWrongPendingEntry) { |
| 419 // PlzNavigate: Entries are not discarded following the reception of | |
| 420 // DidFailProvisionalLoad. They are discarded in DidFailNavigation, when we | |
| 421 // still have the NavigationRequest. Since every change of the | |
| 422 // NavigationEntry would cause the NavigationRequest to go away, the right | |
| 423 // pending NavigationEntry will be discarded in DidFailNavigation. | |
| 424 if (IsBrowserSideNavigationEnabled()) { | |
| 425 SUCCEED() << "PlzNavigate: test not applicable."; | |
|
Charlie Reis
2016/04/11 21:10:57
I'm a bit nervous removing coverage for this witho
clamy
2016/04/12 14:08:01
I've made a few changes that enable the test to te
| |
| 426 return; | |
| 427 } | |
| 428 | |
| 419 NavigationControllerImpl& controller = controller_impl(); | 429 NavigationControllerImpl& controller = controller_impl(); |
| 420 GURL initial_url("http://www.google.com"); | 430 GURL initial_url("http://www.google.com"); |
| 421 GURL url_1("http://foo.com"); | 431 GURL url_1("http://foo.com"); |
| 422 GURL url_2("http://foo2.com"); | 432 GURL url_2("http://foo2.com"); |
| 423 | 433 |
| 424 // Navigate inititally. This is the url that could erroneously be the visible | 434 // Navigate inititally. This is the url that could erroneously be the visible |
| 425 // entry when url_1 fails. | 435 // entry when url_1 fails. |
| 426 NavigateAndCommit(initial_url); | 436 NavigateAndCommit(initial_url); |
| 427 | 437 |
| 428 // Set the pending entry as url_1 and receive the DidStartProvisionalLoad | 438 // Set the pending entry as url_1 and receive the DidStartProvisionalLoad |
| (...skipping 4797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5226 EXPECT_EQ(default_ssl_status.content_status, | 5236 EXPECT_EQ(default_ssl_status.content_status, |
| 5227 observer.details().ssl_status.content_status); | 5237 observer.details().ssl_status.content_status); |
| 5228 EXPECT_EQ( | 5238 EXPECT_EQ( |
| 5229 0u, | 5239 0u, |
| 5230 observer.details().ssl_status.signed_certificate_timestamp_ids.size()); | 5240 observer.details().ssl_status.signed_certificate_timestamp_ids.size()); |
| 5231 | 5241 |
| 5232 EXPECT_EQ(1, main_test_rfh()->GetProcess()->bad_msg_count()); | 5242 EXPECT_EQ(1, main_test_rfh()->GetProcess()->bad_msg_count()); |
| 5233 } | 5243 } |
| 5234 | 5244 |
| 5235 } // namespace content | 5245 } // namespace content |
| OLD | NEW |