| OLD | NEW |
| 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
| 10 #include "chrome/test/base/ui_test_utils.h" | 10 #include "chrome/test/base/ui_test_utils.h" |
| 11 #include "content/browser/renderer_host/render_view_host_impl.h" | 11 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 12 #include "content/browser/site_instance_impl.h" | 12 #include "content/browser/site_instance_impl.h" |
| 13 #include "content/browser/tab_contents/tab_contents.h" | 13 #include "content/browser/tab_contents/tab_contents.h" |
| 14 #include "content/public/browser/navigation_controller.h" | 14 #include "content/public/browser/navigation_controller.h" |
| 15 #include "content/public/browser/notification_details.h" | 15 #include "content/public/browser/notification_details.h" |
| 16 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 18 #include "content/public/browser/notification_types.h" | 18 #include "content/public/browser/notification_types.h" |
| 19 #include "content/public/browser/render_view_host_observer.h" | 19 #include "content/public/browser/render_view_host_observer.h" |
| 20 #include "content/public/common/url_constants.h" | 20 #include "content/public/common/url_constants.h" |
| 21 #include "net/base/net_util.h" | 21 #include "net/base/net_util.h" |
| 22 #include "net/test/test_server.h" | 22 #include "net/test/test_server.h" |
| 23 | 23 |
| 24 using content::RenderViewHost; |
| 24 using content::SiteInstance; | 25 using content::SiteInstance; |
| 25 | 26 |
| 26 class RenderViewHostManagerTest : public InProcessBrowserTest { | 27 class RenderViewHostManagerTest : public InProcessBrowserTest { |
| 27 public: | 28 public: |
| 28 RenderViewHostManagerTest() { | 29 RenderViewHostManagerTest() { |
| 29 EnableDOMAutomation(); | 30 EnableDOMAutomation(); |
| 30 } | 31 } |
| 31 | 32 |
| 32 static bool GetFilePathWithHostAndPortReplacement( | 33 static bool GetFilePathWithHostAndPortReplacement( |
| 33 const std::string& original_file_path, | 34 const std::string& original_file_path, |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 // Now navigate to a different instance so that we swap out again. | 465 // Now navigate to a different instance so that we swap out again. |
| 465 ui_test_utils::NavigateToURL(browser(), | 466 ui_test_utils::NavigateToURL(browser(), |
| 466 https_server.GetURL("files/title2.html")); | 467 https_server.GetURL("files/title2.html")); |
| 467 rvh_observers.AddObserverToRVH(browser()->GetSelectedWebContents()-> | 468 rvh_observers.AddObserverToRVH(browser()->GetSelectedWebContents()-> |
| 468 GetRenderViewHost()); | 469 GetRenderViewHost()); |
| 469 | 470 |
| 470 // This used to leak a render view host. | 471 // This used to leak a render view host. |
| 471 browser()->CloseTabContents(browser()->GetSelectedWebContents()); | 472 browser()->CloseTabContents(browser()->GetSelectedWebContents()); |
| 472 EXPECT_EQ(0U, rvh_observers.GetNumObservers()); | 473 EXPECT_EQ(0U, rvh_observers.GetNumObservers()); |
| 473 } | 474 } |
| OLD | NEW |