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

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

Issue 12978003: [chromedriver] Fix 3 bugs about web view, window handle and target window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chrome/test/chromedriver/session.cc
diff --git a/chrome/test/chromedriver/session.cc b/chrome/test/chromedriver/session.cc
index 996b205a127edf8fc9e066212cf939b4c50f9a7e..7358d6792c35c43cc3f745a4e64ff9452baecc01 100644
--- a/chrome/test/chromedriver/session.cc
+++ b/chrome/test/chromedriver/session.cc
@@ -43,19 +43,10 @@ Status Session::GetTargetWindow(WebView** web_view) {
if (!chrome)
return Status(kNoSuchWindow, "no chrome started in this session");
- std::list<WebView*> web_views;
- Status status = chrome->GetWebViews(&web_views);
+ Status status = chrome->GetWebViewById(window, web_view);
if (status.IsError())
- return status;
-
- for (std::list<WebView*>::const_iterator it = web_views.begin();
- it != web_views.end(); ++it) {
- if ((*it)->GetId() == window) {
- *web_view = *it;
- return Status(kOk);
- }
- }
- return Status(kNoSuchWindow, "target window already closed");
+ status = Status(kNoSuchWindow, "target window already closed", status);
+ return status;
}
void Session::SwitchToTopFrame() {

Powered by Google App Engine
This is Rietveld 408576698