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

Unified Diff: chrome/test/chromedriver/session_commands.cc

Issue 353063005: [ChromeDriver] Subscribe PerformanceLogger to CommandListener interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/chromedriver/session_commands.cc
diff --git a/chrome/test/chromedriver/session_commands.cc b/chrome/test/chromedriver/session_commands.cc
index 864ffd7fa53459f950b43927aced3df20eac65ca..ae02b9ab10788c7dadcac723da4b62fdd37411c9 100644
--- a/chrome/test/chromedriver/session_commands.cc
+++ b/chrome/test/chromedriver/session_commands.cc
@@ -28,6 +28,7 @@
#include "chrome/test/chromedriver/chrome/version.h"
#include "chrome/test/chromedriver/chrome/web_view.h"
#include "chrome/test/chromedriver/chrome_launcher.h"
+#include "chrome/test/chromedriver/command_listener.h"
#include "chrome/test/chromedriver/logging.h"
#include "chrome/test/chromedriver/net/url_request_context_getter.h"
#include "chrome/test/chromedriver/session.h"
@@ -124,13 +125,23 @@ Status InitSessionHelper(
// Create Log's and DevToolsEventListener's for ones that are DevTools-based.
// Session will own the Log's, Chrome will own the listeners.
+ // Also create CommandListeners for the appropriate logs.
ScopedVector<DevToolsEventListener> devtools_event_listeners;
+ std::list<CommandListener*> command_listeners;
stgao 2014/06/27 16:48:25 Is it possible to use ScopedVector here and assign
johnmoore 2014/06/27 21:58:03 Done.
status = CreateLogs(capabilities,
&session->devtools_logs,
- &devtools_event_listeners);
+ &devtools_event_listeners, &command_listeners);
if (status.IsError())
return status;
+ // session will own the CommandListeners after they are added.
+ for (std::list<CommandListener*>::const_iterator it =
+ command_listeners.begin();
+ it != command_listeners.end();
+ ++it) {
+ session->AddListener(*it);
+ }
+
status = LaunchChrome(bound_params.context_getter.get(),
bound_params.socket_factory,
bound_params.device_manager,

Powered by Google App Engine
This is Rietveld 408576698