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/guid.h" | 9 #include "base/guid.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 void Detach() override { recordEvent("Detach"); }; | 241 void Detach() override { recordEvent("Detach"); }; |
242 | 242 |
243 std::string GetType() override { return ""; } | 243 std::string GetType() override { return ""; } |
244 std::string GetTitle() override { return ""; } | 244 std::string GetTitle() override { return ""; } |
245 std::string GetDescription() override { return ""; } | 245 std::string GetDescription() override { return ""; } |
246 GURL GetURL() override { return GURL(); } | 246 GURL GetURL() override { return GURL(); } |
247 GURL GetFaviconURL() override { return GURL(); } | 247 GURL GetFaviconURL() override { return GURL(); } |
248 | 248 |
249 bool Activate() override { return false; }; | 249 bool Activate() override { return false; }; |
250 bool Inspect() override { return false; }; | 250 bool Inspect(BrowserContext* context) override { return false; }; |
251 void Reload() override { }; | 251 void Reload() override { }; |
252 bool Close() override { return false; }; | 252 bool Close() override { return false; }; |
253 | 253 |
254 void SendMessageToBackend(const std::string& message) override { | 254 void SendMessageToBackend(const std::string& message) override { |
255 recordEvent(std::string("SendMessageToBackend.") + message); | 255 recordEvent(std::string("SendMessageToBackend.") + message); |
256 }; | 256 }; |
257 | 257 |
258 }; | 258 }; |
259 | 259 |
260 TEST_F(DevToolsManagerTest, TestExternalProxy) { | 260 TEST_F(DevToolsManagerTest, TestExternalProxy) { |
261 std::unique_ptr<TestExternalAgentDelegate> delegate( | 261 std::unique_ptr<TestExternalAgentDelegate> delegate( |
262 new TestExternalAgentDelegate()); | 262 new TestExternalAgentDelegate()); |
263 | 263 |
264 scoped_refptr<DevToolsAgentHost> agent_host = | 264 scoped_refptr<DevToolsAgentHost> agent_host = |
265 DevToolsAgentHost::Forward(base::GenerateGUID(), std::move(delegate)); | 265 DevToolsAgentHost::Forward(base::GenerateGUID(), std::move(delegate)); |
266 EXPECT_EQ(agent_host, DevToolsAgentHost::GetForId(agent_host->GetId())); | 266 EXPECT_EQ(agent_host, DevToolsAgentHost::GetForId(agent_host->GetId())); |
267 | 267 |
268 TestDevToolsClientHost client_host; | 268 TestDevToolsClientHost client_host; |
269 client_host.InspectAgentHost(agent_host.get()); | 269 client_host.InspectAgentHost(agent_host.get()); |
270 agent_host->DispatchProtocolMessage(&client_host, "message1"); | 270 agent_host->DispatchProtocolMessage(&client_host, "message1"); |
271 agent_host->DispatchProtocolMessage(&client_host, "message2"); | 271 agent_host->DispatchProtocolMessage(&client_host, "message2"); |
272 agent_host->DispatchProtocolMessage(&client_host, "message2"); | 272 agent_host->DispatchProtocolMessage(&client_host, "message2"); |
273 | 273 |
274 client_host.Close(); | 274 client_host.Close(); |
275 } | 275 } |
276 | 276 |
277 } // namespace content | 277 } // namespace content |
OLD | NEW |