| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/test/chromedriver/session.h" | 5 #include "chrome/test/chromedriver/session.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/test/chromedriver/chrome/chrome.h" | 10 #include "chrome/test/chromedriver/chrome/chrome.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 void Session::SwitchToSubFrame(const std::string& frame_id, | 60 void Session::SwitchToSubFrame(const std::string& frame_id, |
| 61 const std::string& chromedriver_frame_id) { | 61 const std::string& chromedriver_frame_id) { |
| 62 std::string parent_frame_id; | 62 std::string parent_frame_id; |
| 63 if (!frames.empty()) | 63 if (!frames.empty()) |
| 64 parent_frame_id = frames.back().frame_id; | 64 parent_frame_id = frames.back().frame_id; |
| 65 frames.push_back(FrameInfo(parent_frame_id, frame_id, chromedriver_frame_id)); | 65 frames.push_back(FrameInfo(parent_frame_id, frame_id, chromedriver_frame_id)); |
| 66 } | 66 } |
| 67 | 67 |
| 68 std::string Session::GetCurrentFrameId() const { | 68 std::string Session::GetCurrentFrameId() const { |
| 69 if (frames.empty()) | 69 if (frames.empty()) |
| 70 return ""; | 70 return std::string(); |
| 71 return frames.back().frame_id; | 71 return frames.back().frame_id; |
| 72 } | 72 } |
| 73 | 73 |
| 74 scoped_ptr<base::DictionaryValue> Session::CreateCapabilities() { | 74 scoped_ptr<base::DictionaryValue> Session::CreateCapabilities() { |
| 75 scoped_ptr<base::DictionaryValue> caps(new base::DictionaryValue()); | 75 scoped_ptr<base::DictionaryValue> caps(new base::DictionaryValue()); |
| 76 caps->SetString("browserName", "chrome"); | 76 caps->SetString("browserName", "chrome"); |
| 77 caps->SetString("version", chrome->GetVersion()); | 77 caps->SetString("version", chrome->GetVersion()); |
| 78 caps->SetString("driverVersion", kChromeDriverVersion); | 78 caps->SetString("driverVersion", kChromeDriverVersion); |
| 79 caps->SetString("platform", chrome->GetOperatingSystemName()); | 79 caps->SetString("platform", chrome->GetOperatingSystemName()); |
| 80 caps->SetBoolean("javascriptEnabled", true); | 80 caps->SetBoolean("javascriptEnabled", true); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 98 Session* SessionAccessorImpl::Access(scoped_ptr<base::AutoLock>* lock) { | 98 Session* SessionAccessorImpl::Access(scoped_ptr<base::AutoLock>* lock) { |
| 99 lock->reset(new base::AutoLock(session_lock_)); | 99 lock->reset(new base::AutoLock(session_lock_)); |
| 100 return session_.get(); | 100 return session_.get(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void SessionAccessorImpl::DeleteSession() { | 103 void SessionAccessorImpl::DeleteSession() { |
| 104 session_.reset(); | 104 session_.reset(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 SessionAccessorImpl::~SessionAccessorImpl() {} | 107 SessionAccessorImpl::~SessionAccessorImpl() {} |
| OLD | NEW |