| OLD | NEW |
| 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/implicit_wait_command.h" | 5 #include "chrome/test/webdriver/commands/implicit_wait_command.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Validate the wait time before setting it to the session. | 47 // Validate the wait time before setting it to the session. |
| 48 if (ms_to_wait < 0) { | 48 if (ms_to_wait < 0) { |
| 49 SET_WEBDRIVER_ERROR(response, | 49 SET_WEBDRIVER_ERROR(response, |
| 50 base::StringPrintf("Wait must be non-negative: %d", ms_to_wait).c_str(), | 50 base::StringPrintf("Wait must be non-negative: %d", ms_to_wait).c_str(), |
| 51 kBadRequest); | 51 kBadRequest); |
| 52 return; | 52 return; |
| 53 } | 53 } |
| 54 | 54 |
| 55 session_->set_implicit_wait(ms_to_wait); | 55 session_->SetImplicitWait(ms_to_wait); |
| 56 LOG(INFO) << "Implicit wait set to: " << ms_to_wait << " ms"; | 56 LOG(INFO) << "Implicit wait set to: " << ms_to_wait << " ms"; |
| 57 | 57 |
| 58 response->SetValue(new StringValue("success")); | 58 response->SetValue(new StringValue("success")); |
| 59 response->SetStatus(kSuccess); | 59 response->SetStatus(kSuccess); |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool ImplicitWaitCommand::RequiresValidTab() { | 62 bool ImplicitWaitCommand::RequiresValidTab() { |
| 63 return true; | 63 return true; |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace webdriver | 66 } // namespace webdriver |
| 67 | 67 |
| OLD | NEW |