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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 orig_rfh->PrepareForCommit(); | 956 orig_rfh->PrepareForCommit(); |
957 contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url, | 957 contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url, |
958 ui::PAGE_TRANSITION_TYPED); | 958 ui::PAGE_TRANSITION_TYPED); |
959 | 959 |
960 // Start to navigate first tab to a new site, so that it has a pending RVH. | 960 // Start to navigate first tab to a new site, so that it has a pending RVH. |
961 const GURL url2("http://www.yahoo.com"); | 961 const GURL url2("http://www.yahoo.com"); |
962 controller().LoadURL( | 962 controller().LoadURL( |
963 url2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); | 963 url2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); |
964 orig_rfh->PrepareForCommit(); | 964 orig_rfh->PrepareForCommit(); |
965 TestRenderFrameHost* pending_rfh = contents()->GetPendingMainFrame(); | 965 TestRenderFrameHost* pending_rfh = contents()->GetPendingMainFrame(); |
966 SiteInstance* instance = pending_rfh->GetSiteInstance(); | 966 SiteInstanceImpl* instance = pending_rfh->GetSiteInstance(); |
967 | 967 |
968 // While it is still pending, simulate opening a new tab with the first tab | 968 // While it is still pending, simulate opening a new tab with the first tab |
969 // as its opener. This will call CreateOpenerProxies on the opener to ensure | 969 // as its opener. This will call CreateOpenerProxies on the opener to ensure |
970 // that an RVH exists. | 970 // that an RVH exists. |
971 scoped_ptr<TestWebContents> popup( | 971 scoped_ptr<TestWebContents> popup( |
972 TestWebContents::Create(browser_context(), instance)); | 972 TestWebContents::Create(browser_context(), instance)); |
973 popup->SetOpener(contents()); | 973 popup->SetOpener(contents()); |
974 contents()->GetRenderManager()->CreateOpenerProxies(instance, nullptr); | 974 contents()->GetRenderManager()->CreateOpenerProxies(instance, nullptr); |
975 | 975 |
976 // If swapped out is forbidden, a new proxy should be created for the opener | 976 // If swapped out is forbidden, a new proxy should be created for the opener |
(...skipping 2469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3446 // An automatic navigation. | 3446 // An automatic navigation. |
3447 contents()->GetMainFrame()->SendNavigateWithModificationCallback( | 3447 contents()->GetMainFrame()->SendNavigateWithModificationCallback( |
3448 2, 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); | 3448 2, 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); |
3449 | 3449 |
3450 EXPECT_EQ(1u, delegate->reset_count()); | 3450 EXPECT_EQ(1u, delegate->reset_count()); |
3451 | 3451 |
3452 contents()->SetJavaScriptDialogManagerForTesting(nullptr); | 3452 contents()->SetJavaScriptDialogManagerForTesting(nullptr); |
3453 } | 3453 } |
3454 | 3454 |
3455 } // namespace content | 3455 } // namespace content |
OLD | NEW |