| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 entry_id = controller().GetPendingEntry()->GetUniqueID(); | 978 entry_id = controller().GetPendingEntry()->GetUniqueID(); |
| 979 contents()->TestDidNavigate(pending_rfh, entry_id, true, url2, | 979 contents()->TestDidNavigate(pending_rfh, entry_id, true, url2, |
| 980 ui::PAGE_TRANSITION_TYPED); | 980 ui::PAGE_TRANSITION_TYPED); |
| 981 EXPECT_FALSE( | 981 EXPECT_FALSE( |
| 982 contents()->GetRenderManager()->GetRenderFrameProxyHost(instance)); | 982 contents()->GetRenderManager()->GetRenderFrameProxyHost(instance)); |
| 983 } | 983 } |
| 984 | 984 |
| 985 // Tests that WebContentsImpl uses the current URL, not the SiteInstance's site, | 985 // Tests that WebContentsImpl uses the current URL, not the SiteInstance's site, |
| 986 // to determine whether a navigation is cross-site. | 986 // to determine whether a navigation is cross-site. |
| 987 TEST_F(WebContentsImplTest, CrossSiteComparesAgainstCurrentPage) { | 987 TEST_F(WebContentsImplTest, CrossSiteComparesAgainstCurrentPage) { |
| 988 // The assumptions this test makes aren't valid with --site-per-process. For |
| 989 // example, a cross-site URL won't ever commit in the old RFH. |
| 990 if (AreAllSitesIsolatedForTesting()) |
| 991 return; |
| 992 |
| 988 TestRenderFrameHost* orig_rfh = main_test_rfh(); | 993 TestRenderFrameHost* orig_rfh = main_test_rfh(); |
| 989 SiteInstance* instance1 = contents()->GetSiteInstance(); | 994 SiteInstance* instance1 = contents()->GetSiteInstance(); |
| 990 | 995 |
| 991 // Navigate to URL. | 996 // Navigate to URL. |
| 992 const GURL url("http://www.google.com"); | 997 const GURL url("http://www.google.com"); |
| 993 controller().LoadURL( | 998 controller().LoadURL( |
| 994 url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); | 999 url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); |
| 995 int entry_id = controller().GetPendingEntry()->GetUniqueID(); | 1000 int entry_id = controller().GetPendingEntry()->GetUniqueID(); |
| 996 main_test_rfh()->PrepareForCommit(); | 1001 main_test_rfh()->PrepareForCommit(); |
| 997 contents()->TestDidNavigate(orig_rfh, entry_id, true, url, | 1002 contents()->TestDidNavigate(orig_rfh, entry_id, true, url, |
| (...skipping 2445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3443 // An automatic navigation. | 3448 // An automatic navigation. |
| 3444 main_test_rfh()->SendNavigateWithModificationCallback( | 3449 main_test_rfh()->SendNavigateWithModificationCallback( |
| 3445 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); | 3450 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); |
| 3446 | 3451 |
| 3447 EXPECT_EQ(1u, dialog_manager.reset_count()); | 3452 EXPECT_EQ(1u, dialog_manager.reset_count()); |
| 3448 | 3453 |
| 3449 contents()->SetJavaScriptDialogManagerForTesting(nullptr); | 3454 contents()->SetJavaScriptDialogManagerForTesting(nullptr); |
| 3450 } | 3455 } |
| 3451 | 3456 |
| 3452 } // namespace content | 3457 } // namespace content |
| OLD | NEW |