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

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

Issue 12764021: [chromedriver] Support clicking an element in sub frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error. Created 7 years, 9 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
« no previous file with comments | « chrome/test/chromedriver/session.h ('k') | chrome/test/chromedriver/session_commands.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/session.cc
diff --git a/chrome/test/chromedriver/session.cc b/chrome/test/chromedriver/session.cc
index a442cca568413edfeabf65b8f570e79f17229a3d..fd039b8c100c1150893a4098e516ccba12c54b45 100644
--- a/chrome/test/chromedriver/session.cc
+++ b/chrome/test/chromedriver/session.cc
@@ -12,6 +12,13 @@
#include "chrome/test/chromedriver/version.h"
#include "chrome/test/chromedriver/web_view.h"
+FrameInfo::FrameInfo(const std::string& parent_frame_id,
+ const std::string& frame_id,
+ const std::string& chromedriver_frame_id)
+ : parent_frame_id(parent_frame_id),
+ frame_id(frame_id),
+ chromedriver_frame_id(chromedriver_frame_id) {}
+
Session::Session(const std::string& id)
: id(id),
mouse_position(0, 0),
@@ -51,6 +58,24 @@ Status Session::GetTargetWindow(WebView** web_view) {
return Status(kNoSuchWindow, "target window already closed");
}
+void Session::SwitchToTopFrame() {
+ frames.clear();
+}
+
+void Session::SwitchToSubFrame(const std::string& frame_id,
+ const std::string& chromedriver_frame_id) {
+ std::string parent_frame_id;
+ if (!frames.empty())
+ parent_frame_id = frames.back().frame_id;
+ frames.push_back(FrameInfo(parent_frame_id, frame_id, chromedriver_frame_id));
+}
+
+std::string Session::GetCurrentFrameId() const {
+ if (frames.empty())
+ return "";
+ return frames.back().frame_id;
+}
+
scoped_ptr<base::DictionaryValue> Session::CreateCapabilities() {
scoped_ptr<base::DictionaryValue> caps(new base::DictionaryValue());
caps->SetString("browserName", "chrome");
« no previous file with comments | « chrome/test/chromedriver/session.h ('k') | chrome/test/chromedriver/session_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698