OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 11 #include "content/browser/renderer_host/render_view_host.h" |
12 #include "content/browser/renderer_host/render_view_host_observer.h" | 12 #include "content/browser/renderer_host/render_view_host_observer.h" |
13 #include "content/browser/site_instance.h" | 13 #include "content/browser/site_instance.h" |
14 #include "content/browser/tab_contents/tab_contents.h" | 14 #include "content/browser/tab_contents/tab_contents.h" |
15 #include "content/common/content_notification_types.h" | 15 #include "content/common/content_notification_types.h" |
16 #include "content/common/notification_details.h" | 16 #include "content/common/notification_details.h" |
17 #include "content/common/notification_observer.h" | 17 #include "content/common/notification_observer.h" |
18 #include "content/common/notification_registrar.h" | 18 #include "content/common/notification_registrar.h" |
19 #include "content/common/url_constants.h" | 19 #include "content/public/common/url_constants.h" |
20 #include "net/base/net_util.h" | 20 #include "net/base/net_util.h" |
21 #include "net/test/test_server.h" | 21 #include "net/test/test_server.h" |
22 | 22 |
23 class RenderViewHostManagerTest : public InProcessBrowserTest { | 23 class RenderViewHostManagerTest : public InProcessBrowserTest { |
24 public: | 24 public: |
25 RenderViewHostManagerTest() { | 25 RenderViewHostManagerTest() { |
26 EnableDOMAutomation(); | 26 EnableDOMAutomation(); |
27 } | 27 } |
28 | 28 |
29 static bool GetFilePathWithHostAndPortReplacement( | 29 static bool GetFilePathWithHostAndPortReplacement( |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 // Now navigate to a different instance so that we swap out again. | 328 // Now navigate to a different instance so that we swap out again. |
329 ui_test_utils::NavigateToURL(browser(), | 329 ui_test_utils::NavigateToURL(browser(), |
330 https_server.GetURL("files/title2.html")); | 330 https_server.GetURL("files/title2.html")); |
331 rvh_observers.AddObserverToRVH(browser()->GetSelectedTabContents()-> | 331 rvh_observers.AddObserverToRVH(browser()->GetSelectedTabContents()-> |
332 render_view_host()); | 332 render_view_host()); |
333 | 333 |
334 // This used to leak a render view host. | 334 // This used to leak a render view host. |
335 browser()->CloseTabContents(browser()->GetSelectedTabContents()); | 335 browser()->CloseTabContents(browser()->GetSelectedTabContents()); |
336 EXPECT_EQ(0U, rvh_observers.GetNumObservers()); | 336 EXPECT_EQ(0U, rvh_observers.GetNumObservers()); |
337 } | 337 } |
OLD | NEW |