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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 void expectEvent(int count, const std::string& name) { | 220 void expectEvent(int count, const std::string& name) { |
221 EXPECT_EQ(count, event_counter_[name]); | 221 EXPECT_EQ(count, event_counter_[name]); |
222 } | 222 } |
223 | 223 |
224 void Attach(DevToolsExternalAgentProxy* proxy) override { | 224 void Attach(DevToolsExternalAgentProxy* proxy) override { |
225 recordEvent("Attach"); | 225 recordEvent("Attach"); |
226 }; | 226 }; |
227 | 227 |
228 void Detach() override { recordEvent("Detach"); }; | 228 void Detach() override { recordEvent("Detach"); }; |
229 | 229 |
| 230 std::string GetType() override { return ""; } |
| 231 std::string GetTitle() override { return ""; } |
| 232 std::string GetDescription() override { return ""; } |
| 233 GURL GetURL() override { return GURL(); } |
| 234 GURL GetFaviconURL() override { return GURL(); } |
| 235 |
| 236 bool Activate() override { return false; }; |
| 237 bool Inspect() override { return false; }; |
| 238 void Reload() override { }; |
| 239 bool Close() override { return false; }; |
| 240 |
230 void SendMessageToBackend(const std::string& message) override { | 241 void SendMessageToBackend(const std::string& message) override { |
231 recordEvent(std::string("SendMessageToBackend.") + message); | 242 recordEvent(std::string("SendMessageToBackend.") + message); |
232 }; | 243 }; |
233 | 244 |
234 public : | 245 public : |
235 ~TestExternalAgentDelegate() override { | 246 ~TestExternalAgentDelegate() override { |
236 expectEvent(1, "Attach"); | 247 expectEvent(1, "Attach"); |
237 expectEvent(1, "Detach"); | 248 expectEvent(1, "Detach"); |
238 expectEvent(0, "SendMessageToBackend.message0"); | 249 expectEvent(0, "SendMessageToBackend.message0"); |
239 expectEvent(1, "SendMessageToBackend.message1"); | 250 expectEvent(1, "SendMessageToBackend.message1"); |
(...skipping 11 matching lines...) Expand all Loading... |
251 TestDevToolsClientHost client_host; | 262 TestDevToolsClientHost client_host; |
252 client_host.InspectAgentHost(agent_host.get()); | 263 client_host.InspectAgentHost(agent_host.get()); |
253 agent_host->DispatchProtocolMessage(&client_host, "message1"); | 264 agent_host->DispatchProtocolMessage(&client_host, "message1"); |
254 agent_host->DispatchProtocolMessage(&client_host, "message2"); | 265 agent_host->DispatchProtocolMessage(&client_host, "message2"); |
255 agent_host->DispatchProtocolMessage(&client_host, "message2"); | 266 agent_host->DispatchProtocolMessage(&client_host, "message2"); |
256 | 267 |
257 client_host.Close(); | 268 client_host.Close(); |
258 } | 269 } |
259 | 270 |
260 } // namespace content | 271 } // namespace content |
OLD | NEW |