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

Unified Diff: content/browser/frame_host/navigator_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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigator_impl_unittest.cc
diff --git a/content/browser/frame_host/navigator_impl_unittest.cc b/content/browser/frame_host/navigator_impl_unittest.cc
index 97ae80f6f43f347af0cba8730284f4092aef956a..2fb5b6610ad007a58e5f2615561a5e97e5074f44 100644
--- a/content/browser/frame_host/navigator_impl_unittest.cc
+++ b/content/browser/frame_host/navigator_impl_unittest.cc
@@ -109,10 +109,10 @@ class NavigatorTestWithBrowserSideNavigation
return message && rfh->GetRoutingID() == message->routing_id();
}
- scoped_refptr<SiteInstance> ConvertToSiteInstance(
+ scoped_refptr<SiteInstanceImpl> ConvertToSiteInstance(
RenderFrameHostManager* rfhm,
const SiteInstanceDescriptor& descriptor,
- SiteInstance* candidate_instance) {
+ SiteInstanceImpl* candidate_instance) {
return rfhm->ConvertToSiteInstance(descriptor, candidate_instance);
}
};
@@ -1017,7 +1017,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
// Navigate to set a current SiteInstance on the RenderFrameHost.
GURL kUrl1("http://a.com");
contents()->NavigateAndCommit(kUrl1);
- SiteInstance* current_instance = main_test_rfh()->GetSiteInstance();
+ SiteInstanceImpl* current_instance = main_test_rfh()->GetSiteInstance();
ASSERT_TRUE(current_instance);
// 1) Convert a descriptor pointing to the current instance.
@@ -1025,7 +1025,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
main_test_rfh()->frame_tree_node()->render_manager();
{
SiteInstanceDescriptor descriptor(current_instance);
- scoped_refptr<SiteInstance> converted_instance =
+ scoped_refptr<SiteInstanceImpl> converted_instance =
ConvertToSiteInstance(rfhm, descriptor, nullptr);
EXPECT_EQ(current_instance, converted_instance);
}
@@ -1033,13 +1033,13 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
// 2) Convert a descriptor pointing an instance unrelated to the current one,
// with a different site.
GURL kUrl2("http://b.com");
- scoped_refptr<SiteInstance> unrelated_instance(
- SiteInstance::CreateForURL(browser_context(), kUrl2));
+ scoped_refptr<SiteInstanceImpl> unrelated_instance(
+ SiteInstanceImpl::CreateForURL(browser_context(), kUrl2));
EXPECT_FALSE(
current_instance->IsRelatedSiteInstance(unrelated_instance.get()));
{
SiteInstanceDescriptor descriptor(unrelated_instance.get());
- scoped_refptr<SiteInstance> converted_instance =
+ scoped_refptr<SiteInstanceImpl> converted_instance =
ConvertToSiteInstance(rfhm, descriptor, nullptr);
EXPECT_EQ(unrelated_instance.get(), converted_instance);
}
@@ -1050,7 +1050,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
{
SiteInstanceDescriptor descriptor(browser_context(), kUrlSameSiteAs1,
SiteInstanceRelation::RELATED);
- scoped_refptr<SiteInstance> converted_instance =
+ scoped_refptr<SiteInstanceImpl> converted_instance =
ConvertToSiteInstance(rfhm, descriptor, nullptr);
EXPECT_EQ(current_instance, converted_instance);
}
@@ -1058,7 +1058,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
// 4) Convert a descriptor of a related instance with a site different from
// the current one.
GURL kUrlSameSiteAs2("http://www.b.com/foo");
- scoped_refptr<SiteInstance> related_instance;
+ scoped_refptr<SiteInstanceImpl> related_instance;
{
SiteInstanceDescriptor descriptor(browser_context(), kUrlSameSiteAs2,
SiteInstanceRelation::RELATED);
@@ -1078,7 +1078,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
{
SiteInstanceDescriptor descriptor(browser_context(), kUrlSameSiteAs1,
SiteInstanceRelation::UNRELATED);
- scoped_refptr<SiteInstance> converted_instance_1 =
+ scoped_refptr<SiteInstanceImpl> converted_instance_1 =
ConvertToSiteInstance(rfhm, descriptor, nullptr);
// Should return a new instance, unrelated to the current one, set to the
// provided site URL.
@@ -1091,7 +1091,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
// Does the same but this time using unrelated_instance as a candidate,
// which has a different site.
- scoped_refptr<SiteInstance> converted_instance_2 =
+ scoped_refptr<SiteInstanceImpl> converted_instance_2 =
ConvertToSiteInstance(rfhm, descriptor, unrelated_instance.get());
// Should return yet another new instance, unrelated to the current one, set
// to the same site URL.
@@ -1104,7 +1104,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
converted_instance_2->GetSiteURL());
// Converts once more but with |converted_instance_1| as a candidate.
- scoped_refptr<SiteInstance> converted_instance_3 =
+ scoped_refptr<SiteInstanceImpl> converted_instance_3 =
ConvertToSiteInstance(rfhm, descriptor, converted_instance_1.get());
// Should return |converted_instance_1| because its site matches and it is
// unrelated to the current SiteInstance.
@@ -1116,7 +1116,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
{
SiteInstanceDescriptor descriptor(browser_context(), kUrlSameSiteAs2,
SiteInstanceRelation::UNRELATED);
- scoped_refptr<SiteInstance> converted_instance_1 =
+ scoped_refptr<SiteInstanceImpl> converted_instance_1 =
ConvertToSiteInstance(rfhm, descriptor, related_instance.get());
// Should return a new instance, unrelated to the current, set to the
// provided site URL.
@@ -1127,7 +1127,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
EXPECT_EQ(SiteInstance::GetSiteForURL(browser_context(), kUrlSameSiteAs2),
converted_instance_1->GetSiteURL());
- scoped_refptr<SiteInstance> converted_instance_2 =
+ scoped_refptr<SiteInstanceImpl> converted_instance_2 =
ConvertToSiteInstance(rfhm, descriptor, unrelated_instance.get());
// Should return |unrelated_instance| because its site matches and it is
// unrelated to the current SiteInstance.
« no previous file with comments | « content/browser/frame_host/interstitial_page_impl.cc ('k') | content/browser/frame_host/render_frame_host_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698