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

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

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.cc
diff --git a/chrome/test/chromedriver/session.cc b/chrome/test/chromedriver/session.cc
index d46918e0d0f0d6d6b0529ad87f6edf8aab11012d..63730fd3f245cbf2c9b9d208c2da346eaaceda5b 100644
--- a/chrome/test/chromedriver/session.cc
+++ b/chrome/test/chromedriver/session.cc
@@ -65,6 +65,19 @@ Status Session::GetTargetWindow(WebView** web_view) {
return status;
}
+Status Session::OnCommand(const std::string& command_name) {
+ // Notify listeners of the command.
+ for (ScopedVector<CommandListener>::const_iterator it =
+ command_listeners_.begin();
+ it != command_listeners_.end();
+ ++it) {
+ Status status = (*it)->OnCommand(command_name);
+ if (status.IsError())
+ return status;
+ }
+ return Status(kOk);
+}
+
void Session::SwitchToTopFrame() {
frames.clear();
}
@@ -82,6 +95,11 @@ void Session::SwitchToSubFrame(const std::string& frame_id,
frames.push_back(FrameInfo(parent_frame_id, frame_id, chromedriver_frame_id));
}
+void Session::AddListener(CommandListener* listener) {
+ CHECK(listener);
+ command_listeners_.push_back(listener);
+}
+
std::string Session::GetCurrentFrameId() const {
if (frames.empty())
return std::string();

Powered by Google App Engine
This is Rietveld 408576698