| 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");
|
|
|