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/window_commands.h" | 5 #include "chrome/test/chromedriver/window_commands.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 Session* session, | 240 Session* session, |
241 WebView* web_view, | 241 WebView* web_view, |
242 const base::DictionaryValue& params, | 242 const base::DictionaryValue& params, |
243 scoped_ptr<base::Value>* value) { | 243 scoped_ptr<base::Value>* value) { |
244 std::string url; | 244 std::string url; |
245 if (!params.GetString("url", &url)) | 245 if (!params.GetString("url", &url)) |
246 return Status(kUnknownError, "'url' must be a string"); | 246 return Status(kUnknownError, "'url' must be a string"); |
247 return web_view->Load(url); | 247 return web_view->Load(url); |
248 } | 248 } |
249 | 249 |
250 Status ExecuteLaunchApp( | |
chrisgao (Use stgao instead)
2014/01/07 23:36:36
Is the app always opened in the current target win
bustamante
2014/01/13 21:19:29
Depending on the app type there's different behavi
chrisgao (Use stgao instead)
2014/01/15 21:39:56
Sorry, I might mislead you on this.
After looking
bustamante
2014/01/15 23:51:38
Yeah that makes sense, if users won't mind switchi
| |
251 Session* session, | |
252 WebView* web_view, | |
253 const base::DictionaryValue& params, | |
254 scoped_ptr<base::Value>* value) { | |
255 std::string id; | |
256 if (!params.GetString("id", &id)) | |
257 return Status(kUnknownError, "'id' must be a string"); | |
258 | |
259 AutomationExtension* extension = NULL; | |
260 Status status = | |
261 session->chrome->GetAsDesktop()->GetAutomationExtension(&extension); | |
chrisgao (Use stgao instead)
2014/01/07 23:36:36
We may need to test whether we are on desktop or a
bustamante
2014/01/13 21:19:29
That's a great point, Done.
| |
262 | |
263 return extension->LaunchApp(id); | |
chrisgao (Use stgao instead)
2014/01/07 23:36:36
We may also need to check the returned status from
bustamante
2014/01/13 21:19:29
Done.
| |
264 } | |
265 | |
250 Status ExecuteExecuteScript( | 266 Status ExecuteExecuteScript( |
251 Session* session, | 267 Session* session, |
252 WebView* web_view, | 268 WebView* web_view, |
253 const base::DictionaryValue& params, | 269 const base::DictionaryValue& params, |
254 scoped_ptr<base::Value>* value) { | 270 scoped_ptr<base::Value>* value) { |
255 std::string script; | 271 std::string script; |
256 if (!params.GetString("script", &script)) | 272 if (!params.GetString("script", &script)) |
257 return Status(kUnknownError, "'script' must be a string"); | 273 return Status(kUnknownError, "'script' must be a string"); |
258 if (script == ":takeHeapSnapshot") { | 274 if (script == ":takeHeapSnapshot") { |
259 return web_view->TakeHeapSnapshot(value); | 275 return web_view->TakeHeapSnapshot(value); |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
864 return status; | 880 return status; |
865 } | 881 } |
866 | 882 |
867 Status ExecuteTakeHeapSnapshot( | 883 Status ExecuteTakeHeapSnapshot( |
868 Session* session, | 884 Session* session, |
869 WebView* web_view, | 885 WebView* web_view, |
870 const base::DictionaryValue& params, | 886 const base::DictionaryValue& params, |
871 scoped_ptr<base::Value>* value) { | 887 scoped_ptr<base::Value>* value) { |
872 return web_view->TakeHeapSnapshot(value); | 888 return web_view->TakeHeapSnapshot(value); |
873 } | 889 } |
OLD | NEW |