Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Side by Side Diff: content/browser/devtools/devtools_manager_unittest.cc

Issue 2678783005: DevTools: return remote debugging targets sorted by last active time (as it was long ago). (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 244
245 std::string GetType() override { return std::string(); } 245 std::string GetType() override { return std::string(); }
246 std::string GetTitle() override { return std::string(); } 246 std::string GetTitle() override { return std::string(); }
247 std::string GetDescription() override { return std::string(); } 247 std::string GetDescription() override { return std::string(); }
248 GURL GetURL() override { return GURL(); } 248 GURL GetURL() override { return GURL(); }
249 GURL GetFaviconURL() override { return GURL(); } 249 GURL GetFaviconURL() override { return GURL(); }
250 std::string GetFrontendURL() override { return std::string(); } 250 std::string GetFrontendURL() override { return std::string(); }
251 bool Activate() override { return false; }; 251 bool Activate() override { return false; };
252 void Reload() override { }; 252 void Reload() override { };
253 bool Close() override { return false; }; 253 bool Close() override { return false; };
254 base::TimeTicks GetLastActivityTime() override { return base::TimeTicks(); }
254 255
255 void SendMessageToBackend(const std::string& message) override { 256 void SendMessageToBackend(const std::string& message) override {
256 recordEvent(std::string("SendMessageToBackend.") + message); 257 recordEvent(std::string("SendMessageToBackend.") + message);
257 }; 258 };
258 259
259 }; 260 };
260 261
261 TEST_F(DevToolsManagerTest, TestExternalProxy) { 262 TEST_F(DevToolsManagerTest, TestExternalProxy) {
262 std::unique_ptr<TestExternalAgentDelegate> delegate( 263 std::unique_ptr<TestExternalAgentDelegate> delegate(
263 new TestExternalAgentDelegate()); 264 new TestExternalAgentDelegate());
264 265
265 scoped_refptr<DevToolsAgentHost> agent_host = 266 scoped_refptr<DevToolsAgentHost> agent_host =
266 DevToolsAgentHost::Forward(base::GenerateGUID(), std::move(delegate)); 267 DevToolsAgentHost::Forward(base::GenerateGUID(), std::move(delegate));
267 EXPECT_EQ(agent_host, DevToolsAgentHost::GetForId(agent_host->GetId())); 268 EXPECT_EQ(agent_host, DevToolsAgentHost::GetForId(agent_host->GetId()));
268 269
269 TestDevToolsClientHost client_host; 270 TestDevToolsClientHost client_host;
270 client_host.InspectAgentHost(agent_host.get()); 271 client_host.InspectAgentHost(agent_host.get());
271 agent_host->DispatchProtocolMessage(&client_host, "message1"); 272 agent_host->DispatchProtocolMessage(&client_host, "message1");
272 agent_host->DispatchProtocolMessage(&client_host, "message2"); 273 agent_host->DispatchProtocolMessage(&client_host, "message2");
273 agent_host->DispatchProtocolMessage(&client_host, "message2"); 274 agent_host->DispatchProtocolMessage(&client_host, "message2");
274 275
275 client_host.Close(); 276 client_host.Close();
276 } 277 }
277 278
278 } // namespace content 279 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/devtools/device/devtools_device_discovery.cc ('k') | content/browser/devtools/forwarding_agent_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698