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 | |
241 void SendMessageToBackend(const std::string& message) override { | 230 void SendMessageToBackend(const std::string& message) override { |
242 recordEvent(std::string("SendMessageToBackend.") + message); | 231 recordEvent(std::string("SendMessageToBackend.") + message); |
243 }; | 232 }; |
244 | 233 |
245 public : | 234 public : |
246 ~TestExternalAgentDelegate() override { | 235 ~TestExternalAgentDelegate() override { |
247 expectEvent(1, "Attach"); | 236 expectEvent(1, "Attach"); |
248 expectEvent(1, "Detach"); | 237 expectEvent(1, "Detach"); |
249 expectEvent(0, "SendMessageToBackend.message0"); | 238 expectEvent(0, "SendMessageToBackend.message0"); |
250 expectEvent(1, "SendMessageToBackend.message1"); | 239 expectEvent(1, "SendMessageToBackend.message1"); |
(...skipping 11 matching lines...) Expand all Loading... |
262 TestDevToolsClientHost client_host; | 251 TestDevToolsClientHost client_host; |
263 client_host.InspectAgentHost(agent_host.get()); | 252 client_host.InspectAgentHost(agent_host.get()); |
264 agent_host->DispatchProtocolMessage(&client_host, "message1"); | 253 agent_host->DispatchProtocolMessage(&client_host, "message1"); |
265 agent_host->DispatchProtocolMessage(&client_host, "message2"); | 254 agent_host->DispatchProtocolMessage(&client_host, "message2"); |
266 agent_host->DispatchProtocolMessage(&client_host, "message2"); | 255 agent_host->DispatchProtocolMessage(&client_host, "message2"); |
267 | 256 |
268 client_host.Close(); | 257 client_host.Close(); |
269 } | 258 } |
270 | 259 |
271 } // namespace content | 260 } // namespace content |
OLD | NEW |