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

Side by Side Diff: chrome/test/webdriver/commands/webelement_commands.cc

Issue 6723004: ChromeDriver should be able to focus on a frame using its frame element, (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/webdriver/commands/webelement_commands.h" 5 #include "chrome/test/webdriver/commands/webelement_commands.h"
6 6
7 #include "base/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/third_party/icu/icu_utf.h" 9 #include "base/third_party/icu/icu_utf.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 if (path_segments_.size() < 7) { 212 if (path_segments_.size() < 7) {
213 SET_WEBDRIVER_ERROR(response, "Path segments is less than 7", 213 SET_WEBDRIVER_ERROR(response, "Path segments is less than 7",
214 kBadRequest); 214 kBadRequest);
215 return; 215 return;
216 } 216 }
217 217
218 std::string script = "return arguments[0] == arguments[1];"; 218 std::string script = "return arguments[0] == arguments[1];";
219 219
220 scoped_ptr<ListValue> args(new ListValue); 220 scoped_ptr<ListValue> args(new ListValue);
221 args->Append(element.ToValue()); 221 args->Append(element.ToValue());
222 args->Append(Value::CreateStringValue(path_segments_.at(6))); 222
223 WebElementId other_element(path_segments_.at(6));
224 args->Append(other_element.ToValue());
223 225
224 Value* result = NULL; 226 Value* result = NULL;
225 ErrorCode status = session_->ExecuteScript(script, args.get(), &result); 227 ErrorCode status = session_->ExecuteScript(script, args.get(), &result);
226 response->SetStatus(status); 228 response->SetStatus(status);
227 response->SetValue(result); 229 response->SetValue(result);
228 } 230 }
229 231
230 ///////////////////// ElementLocationCommand //////////////////// 232 ///////////////////// ElementLocationCommand ////////////////////
231 233
232 ElementLocationCommand::ElementLocationCommand( 234 ElementLocationCommand::ElementLocationCommand(
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 SET_WEBDRIVER_ERROR(response, 536 SET_WEBDRIVER_ERROR(response,
535 "Result is not string type", 537 "Result is not string type",
536 kInternalServerError); 538 kInternalServerError);
537 return; 539 return;
538 } 540 }
539 response->SetStatus(kSuccess); 541 response->SetStatus(kSuccess);
540 response->SetValue(result.release()); 542 response->SetValue(result.release());
541 } 543 }
542 544
543 } // namespace webdriver 545 } // namespace webdriver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698