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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 entry_id = controller().GetPendingEntry()->GetUniqueID(); | 981 entry_id = controller().GetPendingEntry()->GetUniqueID(); |
982 contents()->TestDidNavigate(pending_rfh, entry_id, true, url2, | 982 contents()->TestDidNavigate(pending_rfh, entry_id, true, url2, |
983 ui::PAGE_TRANSITION_TYPED); | 983 ui::PAGE_TRANSITION_TYPED); |
984 EXPECT_FALSE( | 984 EXPECT_FALSE( |
985 contents()->GetRenderManager()->GetRenderFrameProxyHost(instance)); | 985 contents()->GetRenderManager()->GetRenderFrameProxyHost(instance)); |
986 } | 986 } |
987 | 987 |
988 // Tests that WebContentsImpl uses the current URL, not the SiteInstance's site, | 988 // Tests that WebContentsImpl uses the current URL, not the SiteInstance's site, |
989 // to determine whether a navigation is cross-site. | 989 // to determine whether a navigation is cross-site. |
990 TEST_F(WebContentsImplTest, CrossSiteComparesAgainstCurrentPage) { | 990 TEST_F(WebContentsImplTest, CrossSiteComparesAgainstCurrentPage) { |
| 991 // The assumptions this test makes aren't valid with --site-per-process. For |
| 992 // example, a cross-site URL won't ever commit in the old RFH. |
| 993 if (AreAllSitesIsolatedForTesting()) |
| 994 return; |
| 995 |
991 TestRenderFrameHost* orig_rfh = main_test_rfh(); | 996 TestRenderFrameHost* orig_rfh = main_test_rfh(); |
992 SiteInstance* instance1 = contents()->GetSiteInstance(); | 997 SiteInstance* instance1 = contents()->GetSiteInstance(); |
993 | 998 |
994 // Navigate to URL. | 999 // Navigate to URL. |
995 const GURL url("http://www.google.com"); | 1000 const GURL url("http://www.google.com"); |
996 controller().LoadURL( | 1001 controller().LoadURL( |
997 url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); | 1002 url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); |
998 int entry_id = controller().GetPendingEntry()->GetUniqueID(); | 1003 int entry_id = controller().GetPendingEntry()->GetUniqueID(); |
999 main_test_rfh()->PrepareForCommit(); | 1004 main_test_rfh()->PrepareForCommit(); |
1000 contents()->TestDidNavigate(orig_rfh, entry_id, true, url, | 1005 contents()->TestDidNavigate(orig_rfh, entry_id, true, url, |
(...skipping 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3538 // An automatic navigation. | 3543 // An automatic navigation. |
3539 main_test_rfh()->SendNavigateWithModificationCallback( | 3544 main_test_rfh()->SendNavigateWithModificationCallback( |
3540 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); | 3545 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); |
3541 | 3546 |
3542 EXPECT_EQ(1u, dialog_manager.reset_count()); | 3547 EXPECT_EQ(1u, dialog_manager.reset_count()); |
3543 | 3548 |
3544 contents()->SetJavaScriptDialogManagerForTesting(nullptr); | 3549 contents()->SetJavaScriptDialogManagerForTesting(nullptr); |
3545 } | 3550 } |
3546 | 3551 |
3547 } // namespace content | 3552 } // namespace content |
OLD | NEW |