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

Unified Diff: chrome/test/chromedriver/session.h

Issue 331943003: [ChromeDriver] Added 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.h
diff --git a/chrome/test/chromedriver/session.h b/chrome/test/chromedriver/session.h
index fe837fbf061d252393742ef161326ad3cf8051fe..de01befa090371d847465228163d505cc315242e 100644
--- a/chrome/test/chromedriver/session.h
+++ b/chrome/test/chromedriver/session.h
@@ -16,6 +16,7 @@
#include "chrome/test/chromedriver/basic_types.h"
#include "chrome/test/chromedriver/chrome/device_metrics.h"
#include "chrome/test/chromedriver/chrome/geoposition.h"
+#include "chrome/test/chromedriver/command_listener.h"
namespace base {
class DictionaryValue;
@@ -36,7 +37,7 @@ struct FrameInfo {
std::string chromedriver_frame_id;
};
-struct Session {
+struct Session : public CommandListener {
stgao 2014/06/15 23:54:40 Composite pattern might not be good here. We'd bet
static const base::TimeDelta kDefaultPageLoadTimeout;
explicit Session(const std::string& id);
@@ -44,11 +45,13 @@ struct Session {
~Session();
Status GetTargetWindow(WebView** web_view);
+ virtual Status OnCommand(const std::string& command_name) OVERRIDE;
void SwitchToTopFrame();
void SwitchToParentFrame();
void SwitchToSubFrame(const std::string& frame_id,
const std::string& chromedriver_frame_id);
+ void AddListener(CommandListener* listener);
std::string GetCurrentFrameId() const;
std::vector<WebDriverLog*> GetAllLogs() const;
std::string GetFirstBrowserError() const;
@@ -77,6 +80,7 @@ struct Session {
base::ScopedTempDir temp_dir;
scoped_ptr<base::DictionaryValue> capabilities;
bool auto_reporting_enabled;
+ ScopedVector<CommandListener> command_listeners_;
};
Session* GetThreadLocalSession();

Powered by Google App Engine
This is Rietveld 408576698