| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/string16.h" | 5 #include "base/string16.h" |
| 6 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 6 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
| 7 #include "chrome/browser/renderer_host/render_view_host.h" | 7 #include "chrome/browser/renderer_host/render_view_host.h" |
| 8 #include "chrome/browser/tab_contents/navigation_entry.h" | 8 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 9 #include "chrome/browser/tab_contents/web_contents.h" | 9 #include "chrome/browser/tab_contents/web_contents.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 EXPECT_EQ(1, browsingDeleteCounter); | 102 EXPECT_EQ(1, browsingDeleteCounter); |
| 103 // browsing_instance is now deleted | 103 // browsing_instance is now deleted |
| 104 | 104 |
| 105 // Ensure that instances are deleted when their RenderViewHosts are gone. | 105 // Ensure that instances are deleted when their RenderViewHosts are gone. |
| 106 scoped_ptr<TestingProfile> profile(new TestingProfile()); | 106 scoped_ptr<TestingProfile> profile(new TestingProfile()); |
| 107 instance = | 107 instance = |
| 108 TestSiteInstance::CreateTestSiteInstance(profile.get(), | 108 TestSiteInstance::CreateTestSiteInstance(profile.get(), |
| 109 &siteDeleteCounter, | 109 &siteDeleteCounter, |
| 110 &browsingDeleteCounter); | 110 &browsingDeleteCounter); |
| 111 WebContents* contents = new WebContents( | 111 WebContents* contents = new WebContents( |
| 112 profile.get(), instance, NULL, MSG_ROUTING_NONE, NULL); | 112 profile.get(), instance, MSG_ROUTING_NONE, NULL); |
| 113 contents->SetupController(profile.get()); | 113 contents->SetupController(profile.get()); |
| 114 EXPECT_EQ(1, siteDeleteCounter); | 114 EXPECT_EQ(1, siteDeleteCounter); |
| 115 EXPECT_EQ(1, browsingDeleteCounter); | 115 EXPECT_EQ(1, browsingDeleteCounter); |
| 116 | 116 |
| 117 contents->CloseContents(); | 117 contents->CloseContents(); |
| 118 // Make sure that we flush any messages related to WebContents destruction. | 118 // Make sure that we flush any messages related to WebContents destruction. |
| 119 MessageLoop::current()->RunAllPending(); | 119 MessageLoop::current()->RunAllPending(); |
| 120 | 120 |
| 121 EXPECT_EQ(2, siteDeleteCounter); | 121 EXPECT_EQ(2, siteDeleteCounter); |
| 122 EXPECT_EQ(2, browsingDeleteCounter); | 122 EXPECT_EQ(2, browsingDeleteCounter); |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 GURL("http://www.yahoo.com"))); // different BI, but same profile | 388 GURL("http://www.yahoo.com"))); // different BI, but same profile |
| 389 | 389 |
| 390 // Should be able to see that we don't have SiteInstances. | 390 // Should be able to see that we don't have SiteInstances. |
| 391 EXPECT_FALSE(browsing_instance->HasSiteInstance( | 391 EXPECT_FALSE(browsing_instance->HasSiteInstance( |
| 392 GURL("https://www.google.com"))); // not visited before | 392 GURL("https://www.google.com"))); // not visited before |
| 393 EXPECT_FALSE(browsing_instance3->HasSiteInstance( | 393 EXPECT_FALSE(browsing_instance3->HasSiteInstance( |
| 394 GURL("http://www.yahoo.com"))); // different BI, different profile | 394 GURL("http://www.yahoo.com"))); // different BI, different profile |
| 395 | 395 |
| 396 // browsing_instances will be deleted when their SiteInstances are deleted | 396 // browsing_instances will be deleted when their SiteInstances are deleted |
| 397 } | 397 } |
| OLD | NEW |