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 "content/browser/renderer_host/render_process_host_browsertest.h" | 5 #include "content/browser/renderer_host/render_process_host_browsertest.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/debugger/devtools_window.h" | 8 #include "chrome/browser/debugger/devtools_window.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 if (!render_process_host->HasConnection()) | 25 if (!render_process_host->HasConnection()) |
26 continue; | 26 continue; |
27 content::RenderProcessHost::listeners_iterator iter( | 27 content::RenderProcessHost::listeners_iterator iter( |
28 render_process_host->ListenersIterator()); | 28 render_process_host->ListenersIterator()); |
29 for (; !iter.IsAtEnd(); iter.Advance()) { | 29 for (; !iter.IsAtEnd(); iter.Advance()) { |
30 const RenderWidgetHost* widget = | 30 const RenderWidgetHost* widget = |
31 RenderWidgetHostImpl::FromIPCChannelListener(iter.GetCurrentValue()); | 31 RenderWidgetHostImpl::FromIPCChannelListener(iter.GetCurrentValue()); |
32 DCHECK(widget); | 32 DCHECK(widget); |
33 if (!widget || !widget->IsRenderView()) | 33 if (!widget || !widget->IsRenderView()) |
34 continue; | 34 continue; |
35 RenderViewHost* host = const_cast<RenderViewHost*>( | 35 RenderViewHost* host = static_cast<RenderViewHostImpl*>( |
36 static_cast<const RenderViewHost*>(widget)); | 36 RenderWidgetHostImpl::From(const_cast<RenderWidgetHost*>(widget))); |
37 content::RenderViewHostDelegate* host_delegate = host->delegate(); | 37 |
| 38 content::RenderViewHostDelegate* host_delegate = host->GetDelegate(); |
38 GURL url = host_delegate->GetURL(); | 39 GURL url = host_delegate->GetURL(); |
39 if (url.SchemeIs(chrome::kChromeDevToolsScheme)) | 40 if (url.SchemeIs(chrome::kChromeDevToolsScheme)) |
40 return host; | 41 return host; |
41 } | 42 } |
42 } | 43 } |
43 return NULL; | 44 return NULL; |
44 } | 45 } |
45 | 46 |
46 } // namespace | 47 } // namespace |
47 | 48 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 RenderViewHost* devtools = FindFirstDevToolsHost(); | 113 RenderViewHost* devtools = FindFirstDevToolsHost(); |
113 DCHECK(devtools); | 114 DCHECK(devtools); |
114 | 115 |
115 // DevTools start in a separate process. | 116 // DevTools start in a separate process. |
116 DevToolsWindow::ToggleDevToolsWindow( | 117 DevToolsWindow::ToggleDevToolsWindow( |
117 devtools, DEVTOOLS_TOGGLE_ACTION_INSPECT); | 118 devtools, DEVTOOLS_TOGGLE_ACTION_INSPECT); |
118 host_count++; | 119 host_count++; |
119 EXPECT_EQ(tab_count, browser()->tab_count()); | 120 EXPECT_EQ(tab_count, browser()->tab_count()); |
120 EXPECT_EQ(host_count, RenderProcessHostCount()); | 121 EXPECT_EQ(host_count, RenderProcessHostCount()); |
121 } | 122 } |
OLD | NEW |