Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 1874543002: Inside of content, prefer SiteInstanceImpl to SiteInstance. Base URL: https://chromium.googlesource.com/chromium/src.git@site_instance_unittest
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/test/test_render_frame_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698