| Index: content/browser/site_instance_impl_unittest.cc
|
| diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc
|
| index be2a3eea4dc58d0a7749e8bf56afe1d02d7e3903..895d9f753d20212ca5fddaea806854f774aefea5 100644
|
| --- a/content/browser/site_instance_impl_unittest.cc
|
| +++ b/content/browser/site_instance_impl_unittest.cc
|
| @@ -122,23 +122,22 @@ class SiteInstanceTest : public testing::Test {
|
| // calls StoragePartitionImplMap::PostCreateInitialization(), which posts
|
| // a task to the IO thread to create the AppCacheDatabase. Since the
|
| // message loop is not running, the AppCacheDatabase ends up getting
|
| - // created when DrainMessageLoops() gets called at the end of a test case.
|
| + // created when DrainMessageLoop() gets called at the end of a test case.
|
| // Immediately after, the test case ends and the AppCacheDatabase gets
|
| - // scheduled for deletion. Here, call DrainMessageLoops() again so the
|
| + // scheduled for deletion. Here, call DrainMessageLoop() again so the
|
| // AppCacheDatabase actually gets deleted.
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
| }
|
|
|
| void set_privileged_process_id(int process_id) {
|
| browser_client_.set_privileged_process_id(process_id);
|
| }
|
|
|
| - void DrainMessageLoops() {
|
| + void DrainMessageLoop() {
|
| // We don't just do this in TearDown() because we create TestBrowserContext
|
| // objects in each test, which will be destructed before
|
| // TearDown() is called.
|
| base::RunLoop().RunUntilIdle();
|
| - message_loop_.RunUntilIdle();
|
| }
|
|
|
| SiteInstanceTestBrowserClient* browser_client() { return &browser_client_; }
|
| @@ -206,7 +205,7 @@ TEST_F(SiteInstanceTest, SiteInstanceDestructor) {
|
|
|
| // Make sure that we flush any messages related to the above WebContentsImpl
|
| // destruction.
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
|
|
| EXPECT_EQ(1, browser_client()->GetAndClearSiteInstanceDeleteCount());
|
| EXPECT_EQ(1, browser_client()->GetAndClearBrowsingInstanceDeleteCount());
|
| @@ -244,7 +243,7 @@ TEST_F(SiteInstanceTest, CloneNavigationEntry) {
|
| EXPECT_EQ(1, browser_client()->GetAndClearSiteInstanceDeleteCount());
|
| EXPECT_EQ(1, browser_client()->GetAndClearBrowsingInstanceDeleteCount());
|
|
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
| }
|
|
|
| // Test to ensure GetProcess returns and creates processes correctly.
|
| @@ -264,7 +263,7 @@ TEST_F(SiteInstanceTest, GetProcess) {
|
| EXPECT_TRUE(host2.get() != nullptr);
|
| EXPECT_NE(host1.get(), host2.get());
|
|
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
| }
|
|
|
| // Test to ensure SetSite and site() work properly.
|
| @@ -278,7 +277,7 @@ TEST_F(SiteInstanceTest, SetSite) {
|
|
|
| EXPECT_TRUE(instance->HasSite());
|
|
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
| }
|
|
|
| // Test to ensure GetSiteForURL properly returns sites for URLs.
|
| @@ -381,7 +380,7 @@ TEST_F(SiteInstanceTest, GetSiteForURL) {
|
| site_url = SiteInstanceImpl::GetSiteForURL(nullptr, test_url);
|
| EXPECT_EQ(test_url, site_url);
|
|
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
| }
|
|
|
| // Test of distinguishing URLs from different sites. Most of this logic is
|
| @@ -422,7 +421,7 @@ TEST_F(SiteInstanceTest, IsSameWebSite) {
|
| EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, url_blank, url_foo_https));
|
| EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, url_blank, url_foo_port));
|
|
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
| }
|
|
|
| // Test to ensure that there is only one SiteInstance per site in a given
|
| @@ -494,7 +493,7 @@ TEST_F(SiteInstanceTest, OneSiteInstancePerSite) {
|
| // browsing_instances will be deleted when their SiteInstances are deleted.
|
| // The processes will be unregistered when the RPH scoped_ptrs go away.
|
|
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
| }
|
|
|
| // Test to ensure that there is only one RenderProcessHost per site for an
|
| @@ -574,7 +573,7 @@ TEST_F(SiteInstanceTest, OneSiteInstancePerSiteInBrowserContext) {
|
| // browsing_instances will be deleted when their SiteInstances are deleted.
|
| // The processes will be unregistered when the RPH scoped_ptrs go away.
|
|
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
| }
|
|
|
| static scoped_refptr<SiteInstanceImpl> CreateSiteInstance(
|
| @@ -640,7 +639,7 @@ TEST_F(SiteInstanceTest, ProcessSharingByType) {
|
| EXPECT_NE(webui1_instance->GetProcess(), hosts[i]);
|
| }
|
|
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
|
|
| // Disable the process limit override.
|
| RenderProcessHost::SetMaxRendererProcessCount(0u);
|
| @@ -702,7 +701,7 @@ TEST_F(SiteInstanceTest, HasWrongProcessForURL) {
|
| EXPECT_TRUE(
|
| webui_instance2->HasWrongProcessForURL(GURL("http://google.com")));
|
|
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
| }
|
|
|
| // Test to ensure that HasWrongProcessForURL behaves properly even when
|
| @@ -734,7 +733,7 @@ TEST_F(SiteInstanceTest, HasWrongProcessForURLInSitePerProcess) {
|
|
|
| EXPECT_TRUE(instance->HasWrongProcessForURL(GURL("chrome://gpu")));
|
|
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
| }
|
|
|
| // Test that we do not reuse a process in process-per-site mode if it has the
|
| @@ -774,7 +773,7 @@ TEST_F(SiteInstanceTest, ProcessPerSiteWithWrongBindings) {
|
| EXPECT_TRUE(instance2->HasProcess());
|
| EXPECT_NE(host.get(), host2.get());
|
|
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
| }
|
|
|
| // Test that we do not register processes with empty sites for process-per-site
|
| @@ -795,7 +794,7 @@ TEST_F(SiteInstanceTest, NoProcessPerSiteForEmptySite) {
|
| EXPECT_FALSE(RenderProcessHostImpl::GetProcessHostForSite(
|
| browser_context.get(), GURL()));
|
|
|
| - DrainMessageLoops();
|
| + DrainMessageLoop();
|
| }
|
|
|
| TEST_F(SiteInstanceTest, DefaultSubframeSiteInstance) {
|
|
|