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

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

Issue 10834004: Correct const accessors in base/values.(h|cc) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reverting webdriver:Command::parameters_ to const Created 8 years, 4 months 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/execute_async_script_command.h" 5 #include "chrome/test/webdriver/commands/execute_async_script_command.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/test/webdriver/commands/response.h" 8 #include "chrome/test/webdriver/commands/response.h"
9 #include "chrome/test/webdriver/webdriver_error.h" 9 #include "chrome/test/webdriver/webdriver_error.h"
10 #include "chrome/test/webdriver/webdriver_session.h" 10 #include "chrome/test/webdriver/webdriver_session.h"
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 24
25 void ExecuteAsyncScriptCommand::ExecutePost(Response* const response) { 25 void ExecuteAsyncScriptCommand::ExecutePost(Response* const response) {
26 std::string script; 26 std::string script;
27 if (!GetStringParameter("script", &script)) { 27 if (!GetStringParameter("script", &script)) {
28 response->SetError(new Error( 28 response->SetError(new Error(
29 kBadRequest, "No script to execute specified")); 29 kBadRequest, "No script to execute specified"));
30 return; 30 return;
31 } 31 }
32 32
33 ListValue* args; 33 const ListValue* args;
34 if (!GetListParameter("args", &args)) { 34 if (!GetListParameter("args", &args)) {
35 response->SetError(new Error( 35 response->SetError(new Error(
36 kBadRequest, "No script arguments specified")); 36 kBadRequest, "No script arguments specified"));
37 return; 37 return;
38 } 38 }
39 39
40 Value* result = NULL; 40 Value* result = NULL;
41 Error* error = session_->ExecuteAsyncScript( 41 Error* error = session_->ExecuteAsyncScript(
42 session_->current_target(), script, args, &result); 42 session_->current_target(), script, args, &result);
43 if (error) { 43 if (error) {
44 error->AddDetails("Script execution failed. Script: " + script); 44 error->AddDetails("Script execution failed. Script: " + script);
45 response->SetError(error); 45 response->SetError(error);
46 return; 46 return;
47 } 47 }
48 response->SetValue(result); 48 response->SetValue(result);
49 } 49 }
50 50
51 } // namspace webdriver 51 } // namspace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/commands/create_session.cc ('k') | chrome/test/webdriver/commands/execute_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698