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 5998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6009 "document.getElementsByTagName('pre')[1].innerText);", | 6009 "document.getElementsByTagName('pre')[1].innerText);", |
6010 &headers)); | 6010 &headers)); |
6011 | 6011 |
6012 // Verify the Origin and Referer headers. | 6012 // Verify the Origin and Referer headers. |
6013 EXPECT_THAT(headers, ::testing::HasSubstr("Origin: null")); | 6013 EXPECT_THAT(headers, ::testing::HasSubstr("Origin: null")); |
6014 EXPECT_THAT(headers, | 6014 EXPECT_THAT(headers, |
6015 ::testing::ContainsRegex( | 6015 ::testing::ContainsRegex( |
6016 "Referer: http://a.com:.*/form_that_posts_cross_site.html")); | 6016 "Referer: http://a.com:.*/form_that_posts_cross_site.html")); |
6017 } | 6017 } |
6018 | 6018 |
| 6019 // Check that the favicon is not cleared for navigating in-page. |
| 6020 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| 6021 InPageNavigationDoesNotClearFavicon) { |
| 6022 // Load a page and fake a favicon for it. |
| 6023 NavigationController& controller = shell()->web_contents()->GetController(); |
| 6024 ASSERT_TRUE(NavigateToURL(shell(), GURL("data:text/html,page1"))); |
| 6025 content::NavigationEntry* entry = controller.GetLastCommittedEntry(); |
| 6026 ASSERT_TRUE(entry); |
| 6027 content::FaviconStatus& favicon_status = entry->GetFavicon(); |
| 6028 favicon_status.valid = true; |
| 6029 |
| 6030 ASSERT_TRUE(RendererLocationReplace(shell(), GURL("data:text/html,page1#"))); |
| 6031 entry = controller.GetLastCommittedEntry(); |
| 6032 content::FaviconStatus& favicon_status2 = entry->GetFavicon(); |
| 6033 EXPECT_TRUE(favicon_status2.valid); |
| 6034 |
| 6035 ASSERT_TRUE(RendererLocationReplace(shell(), GURL("data:text/html,page2"))); |
| 6036 entry = controller.GetLastCommittedEntry(); |
| 6037 content::FaviconStatus& favicon_status3 = entry->GetFavicon(); |
| 6038 EXPECT_FALSE(favicon_status3.valid); |
| 6039 } |
| 6040 |
6019 } // namespace content | 6041 } // namespace content |
OLD | NEW |