| 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/time.h" | 6 #include "base/time.h" |
| 7 #include "content/browser/debugger/devtools_manager_impl.h" | 7 #include "content/browser/debugger/devtools_manager_impl.h" |
| 8 #include "content/browser/debugger/render_view_devtools_agent_host.h" | 8 #include "content/browser/debugger/render_view_devtools_agent_host.h" |
| 9 #include "content/browser/mock_content_browser_client.h" | 9 #include "content/browser/mock_content_browser_client.h" |
| 10 #include "content/browser/renderer_host/test_render_view_host.h" | 10 #include "content/browser/renderer_host/test_render_view_host.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 std::string m = "test message"; | 173 std::string m = "test message"; |
| 174 agent_host = DevToolsAgentHostRegistry::GetDevToolsAgentHost(rvh()); | 174 agent_host = DevToolsAgentHostRegistry::GetDevToolsAgentHost(rvh()); |
| 175 manager.DispatchOnInspectorFrontend(agent_host, m); | 175 manager.DispatchOnInspectorFrontend(agent_host, m); |
| 176 EXPECT_TRUE(&m == client_host.last_sent_message); | 176 EXPECT_TRUE(&m == client_host.last_sent_message); |
| 177 | 177 |
| 178 client_host.Close(&manager); | 178 client_host.Close(&manager); |
| 179 EXPECT_EQ(1, TestDevToolsClientHost::close_counter); | 179 EXPECT_EQ(1, TestDevToolsClientHost::close_counter); |
| 180 } | 180 } |
| 181 | 181 |
| 182 TEST_F(DevToolsManagerTest, NoUnresponsiveDialogInInspectedTab) { | 182 TEST_F(DevToolsManagerTest, NoUnresponsiveDialogInInspectedTab) { |
| 183 TestRenderViewHost* inspected_rvh = rvh(); | 183 content::TestRenderViewHost* inspected_rvh = rvh(); |
| 184 inspected_rvh->set_render_view_created(true); | 184 inspected_rvh->set_render_view_created(true); |
| 185 EXPECT_FALSE(contents()->GetDelegate()); | 185 EXPECT_FALSE(contents()->GetDelegate()); |
| 186 TestWebContentsDelegate delegate; | 186 TestWebContentsDelegate delegate; |
| 187 contents()->SetDelegate(&delegate); | 187 contents()->SetDelegate(&delegate); |
| 188 | 188 |
| 189 TestDevToolsClientHost client_host; | 189 TestDevToolsClientHost client_host; |
| 190 DevToolsAgentHost* agent_host = | 190 DevToolsAgentHost* agent_host = |
| 191 DevToolsAgentHostRegistry::GetDevToolsAgentHost(inspected_rvh); | 191 DevToolsAgentHostRegistry::GetDevToolsAgentHost(inspected_rvh); |
| 192 DevToolsManager::GetInstance()-> | 192 DevToolsManager::GetInstance()-> |
| 193 RegisterDevToolsClientHostFor(agent_host, &client_host); | 193 RegisterDevToolsClientHostFor(agent_host, &client_host); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 // Interrupt pending navigation and navigate back to the original site. | 239 // Interrupt pending navigation and navigate back to the original site. |
| 240 controller().LoadURL( | 240 controller().LoadURL( |
| 241 url, content::Referrer(), content::PAGE_TRANSITION_TYPED, std::string()); | 241 url, content::Referrer(), content::PAGE_TRANSITION_TYPED, std::string()); |
| 242 contents()->TestDidNavigate(rvh(), 1, url, content::PAGE_TRANSITION_TYPED); | 242 contents()->TestDidNavigate(rvh(), 1, url, content::PAGE_TRANSITION_TYPED); |
| 243 EXPECT_FALSE(contents()->cross_navigation_pending()); | 243 EXPECT_FALSE(contents()->cross_navigation_pending()); |
| 244 EXPECT_EQ(&client_host, devtools_manager->GetDevToolsClientHostFor( | 244 EXPECT_EQ(&client_host, devtools_manager->GetDevToolsClientHostFor( |
| 245 DevToolsAgentHostRegistry::GetDevToolsAgentHost(rvh()))); | 245 DevToolsAgentHostRegistry::GetDevToolsAgentHost(rvh()))); |
| 246 client_host.Close(DevToolsManager::GetInstance()); | 246 client_host.Close(DevToolsManager::GetInstance()); |
| 247 } | 247 } |
| OLD | NEW |