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

Side by Side Diff: chrome/test/chromedriver/session.cc

Issue 12226026: [ChromeDriver] Select the main frame if a non-existant child frame is targeted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/chromedriver/session.h ('k') | chrome/test/chromedriver/session_command.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/test/chromedriver/chrome.h" 7 #include "chrome/test/chromedriver/chrome.h"
8 #include "chrome/test/chromedriver/status.h"
8 9
9 Session::Session(const std::string& id) 10 Session::Session(const std::string& id)
10 : id(id), mouse_position(0, 0), implicit_wait(0), page_load_timeout(0), 11 : id(id), mouse_position(0, 0), implicit_wait(0), page_load_timeout(0),
11 script_timeout(0) {} 12 script_timeout(0) {}
12 13
13 Session::Session(const std::string& id, scoped_ptr<Chrome> chrome) 14 Session::Session(const std::string& id, scoped_ptr<Chrome> chrome)
14 : id(id), chrome(chrome.Pass()), mouse_position(0, 0), implicit_wait(0), 15 : id(id), chrome(chrome.Pass()), mouse_position(0, 0), implicit_wait(0),
15 page_load_timeout(0), script_timeout(0) {} 16 page_load_timeout(0), script_timeout(0) {}
16 17
17 Session::~Session() {} 18 Session::~Session() {}
18 19
20 Status Session::WaitForPendingNavigations() {
21 if (!chrome)
22 return Status(kOk);
23 std::string full_frame_id(frame);
24 if (full_frame_id == "") {
25 Status status = chrome->GetMainFrame(&full_frame_id);
26 if (status.IsError())
27 return status;
28 }
29 return chrome->WaitForPendingNavigations(full_frame_id);
30 }
31
19 SessionAccessorImpl::SessionAccessorImpl(scoped_ptr<Session> session) 32 SessionAccessorImpl::SessionAccessorImpl(scoped_ptr<Session> session)
20 : session_(session.Pass()) {} 33 : session_(session.Pass()) {}
21 34
22 Session* SessionAccessorImpl::Access(scoped_ptr<base::AutoLock>* lock) { 35 Session* SessionAccessorImpl::Access(scoped_ptr<base::AutoLock>* lock) {
23 lock->reset(new base::AutoLock(session_lock_)); 36 lock->reset(new base::AutoLock(session_lock_));
24 return session_.get(); 37 return session_.get();
25 } 38 }
26 39
27 SessionAccessorImpl::~SessionAccessorImpl() {} 40 SessionAccessorImpl::~SessionAccessorImpl() {}
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/session.h ('k') | chrome/test/chromedriver/session_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698