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

Unified Diff: chrome/test/webdriver/commands/target_locator_commands.cc

Issue 8806030: Add commands to Chrome WebDriver for installing and manipulating extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years 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/webdriver/commands/chrome_commands.cc ('k') | chrome/test/webdriver/test/chromedriver.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/webdriver/commands/target_locator_commands.cc
diff --git a/chrome/test/webdriver/commands/target_locator_commands.cc b/chrome/test/webdriver/commands/target_locator_commands.cc
index f554b70e23c406df60939b01a00c29a568439e83..72af50902c32492f33ad4d7590691827b76f3570 100644
--- a/chrome/test/webdriver/commands/target_locator_commands.cc
+++ b/chrome/test/webdriver/commands/target_locator_commands.cc
@@ -10,6 +10,9 @@
#include "chrome/test/webdriver/webdriver_element_id.h"
#include "chrome/test/webdriver/webdriver_error.h"
#include "chrome/test/webdriver/webdriver_session.h"
+#include "chrome/test/webdriver/webdriver_util.h"
+
+using base::Value;
namespace webdriver {
@@ -25,8 +28,8 @@ bool WindowHandleCommand::DoesGet() {
}
void WindowHandleCommand::ExecuteGet(Response* const response) {
- response->SetValue(new StringValue(
- base::IntToString(session_->current_target().window_id)));
+ response->SetValue(Value::CreateStringValue(
+ WebViewIdToString(session_->current_target().view_id)));
}
WindowHandlesCommand::WindowHandlesCommand(
@@ -41,15 +44,19 @@ bool WindowHandlesCommand::DoesGet() {
}
void WindowHandlesCommand::ExecuteGet(Response* const response) {
- std::vector<int> window_ids;
- Error* error = session_->GetWindowIds(&window_ids);
+ std::vector<WebViewInfo> views;
+ Error* error = session_->GetViews(&views);
if (error) {
response->SetError(error);
return;
}
- ListValue* id_list = new ListValue();
- for (size_t i = 0; i < window_ids.size(); ++i)
- id_list->Append(new StringValue(base::IntToString(window_ids[i])));
+ base::ListValue* id_list = new base::ListValue();
+ for (size_t i = 0; i < views.size(); ++i) {
+ if (!views[i].view_id.IsTab())
+ continue;
+ id_list->Append(Value::CreateStringValue(
+ WebViewIdToString(views[i].view_id)));
+ }
response->SetValue(id_list);
}
@@ -76,7 +83,7 @@ void WindowCommand::ExecutePost(Response* const response) {
return;
}
- Error* error = session_->SwitchToWindow(name);
+ Error* error = session_->SwitchToView(name);
if (error)
response->SetError(error);
}
« no previous file with comments | « chrome/test/webdriver/commands/chrome_commands.cc ('k') | chrome/test/webdriver/test/chromedriver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698