summaryrefslogtreecommitdiffstats
path: root/chrome/browser/site_instance_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/site_instance_unittest.cc')
-rw-r--r--chrome/browser/site_instance_unittest.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/chrome/browser/site_instance_unittest.cc b/chrome/browser/site_instance_unittest.cc
index 83e3baf..92af43f 100644
--- a/chrome/browser/site_instance_unittest.cc
+++ b/chrome/browser/site_instance_unittest.cc
@@ -107,15 +107,11 @@ TEST_F(SiteInstanceTest, SiteInstanceDestructor) {
TestSiteInstance::CreateTestSiteInstance(profile.get(),
&siteDeleteCounter,
&browsingDeleteCounter);
- WebContents* contents = new WebContents(
- profile.get(), instance, MSG_ROUTING_NONE, NULL);
- contents->SetupController(profile.get());
- EXPECT_EQ(1, siteDeleteCounter);
- EXPECT_EQ(1, browsingDeleteCounter);
-
- contents->CloseContents();
- // Make sure that we flush any messages related to WebContents destruction.
- MessageLoop::current()->RunAllPending();
+ {
+ WebContents contents(profile.get(), instance, MSG_ROUTING_NONE, NULL);
+ EXPECT_EQ(1, siteDeleteCounter);
+ EXPECT_EQ(1, browsingDeleteCounter);
+ }
EXPECT_EQ(2, siteDeleteCounter);
EXPECT_EQ(2, browsingDeleteCounter);