| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromedriver/session_commands.h" | 5 #include "chrome/test/chromedriver/session_commands.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 base::TimeDelta timeout = | 215 base::TimeDelta timeout = |
| 216 base::TimeDelta::FromMilliseconds(static_cast<int>(ms_double)); | 216 base::TimeDelta::FromMilliseconds(static_cast<int>(ms_double)); |
| 217 // TODO(frankf): implicit and script timeout should be cleared | 217 // TODO(frankf): implicit and script timeout should be cleared |
| 218 // if negative timeout is specified. | 218 // if negative timeout is specified. |
| 219 if (type == "implicit") { | 219 if (type == "implicit") { |
| 220 session->implicit_wait = timeout; | 220 session->implicit_wait = timeout; |
| 221 } else if (type == "script") { | 221 } else if (type == "script") { |
| 222 session->script_timeout = timeout; | 222 session->script_timeout = timeout; |
| 223 } else if (type == "page load") { | 223 } else if (type == "page load") { |
| 224 session->page_load_timeout = | 224 session->page_load_timeout = |
| 225 ((timeout < base::TimeDelta()) ? base::TimeDelta::FromMilliseconds( | 225 ((timeout < base::TimeDelta()) ? Session::kDefaultPageLoadTimeout |
| 226 Session::kDefaultPageLoadTimeoutMs) | |
| 227 : timeout); | 226 : timeout); |
| 228 } else { | 227 } else { |
| 229 return Status(kUnknownError, "unknown type of timeout:" + type); | 228 return Status(kUnknownError, "unknown type of timeout:" + type); |
| 230 } | 229 } |
| 231 return Status(kOk); | 230 return Status(kOk); |
| 232 } | 231 } |
| 233 | 232 |
| 234 Status ExecuteSetScriptTimeout( | 233 Status ExecuteSetScriptTimeout( |
| 235 Session* session, | 234 Session* session, |
| 236 const base::DictionaryValue& params, | 235 const base::DictionaryValue& params, |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 } | 437 } |
| 439 std::string error_msg; | 438 std::string error_msg; |
| 440 base::FilePath upload; | 439 base::FilePath upload; |
| 441 Status status = UnzipSoleFile(upload_dir, zip_data, &upload); | 440 Status status = UnzipSoleFile(upload_dir, zip_data, &upload); |
| 442 if (status.IsError()) | 441 if (status.IsError()) |
| 443 return Status(kUnknownError, "unable to unzip 'file'", status); | 442 return Status(kUnknownError, "unable to unzip 'file'", status); |
| 444 | 443 |
| 445 value->reset(new base::StringValue(upload.value())); | 444 value->reset(new base::StringValue(upload.value())); |
| 446 return Status(kOk); | 445 return Status(kOk); |
| 447 } | 446 } |
| OLD | NEW |