| 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/devtools/devtools_manager.h" | 5 #include "content/browser/devtools/devtools_manager.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 TestDevToolsClientHost() | 37 TestDevToolsClientHost() |
| 38 : last_sent_message(NULL), | 38 : last_sent_message(NULL), |
| 39 closed_(false) { | 39 closed_(false) { |
| 40 } | 40 } |
| 41 | 41 |
| 42 ~TestDevToolsClientHost() override { EXPECT_TRUE(closed_); } | 42 ~TestDevToolsClientHost() override { EXPECT_TRUE(closed_); } |
| 43 | 43 |
| 44 void Close() { | 44 void Close() { |
| 45 EXPECT_FALSE(closed_); | 45 EXPECT_FALSE(closed_); |
| 46 close_counter++; | 46 close_counter++; |
| 47 agent_host_->DetachClient(); | 47 agent_host_->DetachClient(this); |
| 48 closed_ = true; | 48 closed_ = true; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override { | 51 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override { |
| 52 FAIL(); | 52 FAIL(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, | 55 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
| 56 const std::string& message) override { | 56 const std::string& message) override { |
| 57 last_sent_message = &message; | 57 last_sent_message = &message; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 TestDevToolsClientHost client_host; | 248 TestDevToolsClientHost client_host; |
| 249 client_host.InspectAgentHost(agent_host.get()); | 249 client_host.InspectAgentHost(agent_host.get()); |
| 250 agent_host->DispatchProtocolMessage("message1"); | 250 agent_host->DispatchProtocolMessage("message1"); |
| 251 agent_host->DispatchProtocolMessage("message2"); | 251 agent_host->DispatchProtocolMessage("message2"); |
| 252 agent_host->DispatchProtocolMessage("message2"); | 252 agent_host->DispatchProtocolMessage("message2"); |
| 253 | 253 |
| 254 client_host.Close(); | 254 client_host.Close(); |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace content | 257 } // namespace content |
| OLD | NEW |