| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 6139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6150 | 6150 |
| 6151 // Simulate the user hitting Enter in the omnibox without changing the URL. | 6151 // Simulate the user hitting Enter in the omnibox without changing the URL. |
| 6152 { | 6152 { |
| 6153 TestNavigationObserver observer(web_contents); | 6153 TestNavigationObserver observer(web_contents); |
| 6154 web_contents->GetController().LoadURL(web_contents->GetLastCommittedURL(), | 6154 web_contents->GetController().LoadURL(web_contents->GetLastCommittedURL(), |
| 6155 Referrer(), ui::PAGE_TRANSITION_LINK, | 6155 Referrer(), ui::PAGE_TRANSITION_LINK, |
| 6156 std::string()); | 6156 std::string()); |
| 6157 observer.Wait(); | 6157 observer.Wait(); |
| 6158 } | 6158 } |
| 6159 | 6159 |
| 6160 EXPECT_EQ(2, web_contents->GetController().GetEntryCount()); |
| 6161 |
| 6160 // Prior to fixing the issue, the above omnibox navigation (which is | 6162 // Prior to fixing the issue, the above omnibox navigation (which is |
| 6161 // classified as SAME_PAGE) was leaving the FrameNavigationEntry with the | 6163 // classified as SAME_PAGE) was leaving the FrameNavigationEntry with the |
| 6162 // same document sequence number as the previous entry but updates the URL. | 6164 // same document sequence number as the previous entry but updates the URL. |
| 6163 // Doing a back session history navigation now will cause the browser to | 6165 // Doing a back session history navigation now will cause the browser to |
| 6164 // consider it as in-page because of this matching document sequence number | 6166 // consider it as in-page because of this matching document sequence number |
| 6165 // and lead to a mismatch of origin and URL in the renderer process. | 6167 // and lead to a mismatch of origin and URL in the renderer process. |
| 6166 { | 6168 { |
| 6167 TestNavigationObserver observer(web_contents); | 6169 TestNavigationObserver observer(web_contents); |
| 6168 web_contents->GetController().GoBack(); | 6170 web_contents->GetController().GoBack(); |
| 6169 observer.Wait(); | 6171 observer.Wait(); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6550 histogram.ExpectTotalCount(kReloadToReloadMetricName, 4); | 6552 histogram.ExpectTotalCount(kReloadToReloadMetricName, 4); |
| 6551 histogram.ExpectTotalCount(kReloadMainResourceToReloadMetricName, 3); | 6553 histogram.ExpectTotalCount(kReloadMainResourceToReloadMetricName, 3); |
| 6552 | 6554 |
| 6553 controller.ReloadToRefreshContent(false); | 6555 controller.ReloadToRefreshContent(false); |
| 6554 EXPECT_TRUE(WaitForLoadStop(shell()->web_contents())); | 6556 EXPECT_TRUE(WaitForLoadStop(shell()->web_contents())); |
| 6555 histogram.ExpectTotalCount(kReloadToReloadMetricName, 4); | 6557 histogram.ExpectTotalCount(kReloadToReloadMetricName, 4); |
| 6556 histogram.ExpectTotalCount(kReloadMainResourceToReloadMetricName, 3); | 6558 histogram.ExpectTotalCount(kReloadMainResourceToReloadMetricName, 3); |
| 6557 } | 6559 } |
| 6558 | 6560 |
| 6559 } // namespace content | 6561 } // namespace content |
| OLD | NEW |