OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/commands.h" | 5 #include "chrome/test/chromedriver/commands.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 std::string script; | 98 std::string script; |
99 if (!params.GetString("script", &script)) | 99 if (!params.GetString("script", &script)) |
100 return Status(kUnknownError, "'script' must be a string"); | 100 return Status(kUnknownError, "'script' must be a string"); |
101 const base::ListValue* args; | 101 const base::ListValue* args; |
102 if (!params.GetList("args", &args)) | 102 if (!params.GetList("args", &args)) |
103 return Status(kUnknownError, "'args' must be a list"); | 103 return Status(kUnknownError, "'args' must be a list"); |
104 | 104 |
105 return session->chrome->CallFunction( | 105 return session->chrome->CallFunction( |
106 "function(){" + script + "}", *args, value); | 106 "function(){" + script + "}", *args, value); |
107 } | 107 } |
108 | |
109 Status ExecuteTitle( | |
110 Session* session, | |
111 const base::DictionaryValue& params, | |
112 scoped_ptr<base::Value>* value) { | |
113 base::ListValue args; | |
114 return session->chrome->CallFunction( | |
115 "function(){ return document.title; }", args, value); | |
kkania
2013/01/04 04:35:34
see how the old chromedriver does it webdriver::Se
chrisgao (Use stgao instead)
2013/01/05 01:19:09
Followed the approach of the old chromedriver.
Bu
| |
116 } | |
OLD | NEW |