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

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

Issue 3643002: Implemnts the commands in webdriver to preform searching of elements on a page. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: fix for windows build Created 10 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 unified diff | Download patch
« no previous file with comments | « chrome/test/webdriver/commands/implicit_wait_command.h ('k') | chrome/test/webdriver/server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <string>
6
7 #include "base/utf_string_conversions.h"
8 #include "chrome/test/webdriver/commands/implicit_wait_command.h"
9
10 namespace webdriver {
11
12 bool ImplicitWaitCommand::Init(Response* const response) {
13 if (!(WebDriverCommand::Init(response))) {
14 SET_WEBDRIVER_ERROR(response, "Failure on Init for find element",
15 kInternalServerError);
16 return false;
17 }
18
19 // Record the requested wait time.
20 if (!GetIntegerParameter("ms", &ms_to_wait_)) {
21 SET_WEBDRIVER_ERROR(response, "Request missing ms parameter",
22 kBadRequest);
23 return false;
24 }
25
26 return true;
27 }
28
29 void ImplicitWaitCommand::ExecutePost(Response* const response) {
30 // Validate the wait time before setting it to the session.
31 if (ms_to_wait_ < 0) {
32 SET_WEBDRIVER_ERROR(response, "Wait must be non-negative",
33 kBadRequest);
34 return;
35 }
36
37 session_->set_implicit_wait(ms_to_wait_);
38 LOG(INFO) << "Implicit wait set to: " << ms_to_wait_ << " ms";
39
40 response->set_value(new StringValue("success"));
41 response->set_status(kSuccess);
42 }
43
44 } // namespace webdriver
45
OLDNEW
« no previous file with comments | « chrome/test/webdriver/commands/implicit_wait_command.h ('k') | chrome/test/webdriver/server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698