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

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

Issue 7649006: more changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another typo Created 9 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 | Annotate | Revision Log
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/alert_commands.h" 5 #include "chrome/test/webdriver/commands/alert_commands.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/session.h" 9 #include "chrome/test/webdriver/session.h"
10 #include "chrome/test/webdriver/webdriver_error.h" 10 #include "chrome/test/webdriver/webdriver_error.h"
(...skipping 17 matching lines...) Expand all
28 return true; 28 return true;
29 } 29 }
30 30
31 void AlertTextCommand::ExecuteGet(Response* const response) { 31 void AlertTextCommand::ExecuteGet(Response* const response) {
32 std::string text; 32 std::string text;
33 Error* error = session_->GetAlertMessage(&text); 33 Error* error = session_->GetAlertMessage(&text);
34 if (error) { 34 if (error) {
35 response->SetError(error); 35 response->SetError(error);
36 return; 36 return;
37 } 37 }
38 response->SetValue(Value::CreateStringValue(text)); 38 response->SetValue(base::StringValue::New(text));
39 } 39 }
40 40
41 void AlertTextCommand::ExecutePost(Response* const response) { 41 void AlertTextCommand::ExecutePost(Response* const response) {
42 std::string text; 42 std::string text;
43 if (!GetStringParameter("text", &text)) { 43 if (!GetStringParameter("text", &text)) {
44 response->SetError(new Error( 44 response->SetError(new Error(
45 kBadRequest, "'text' is missing or invalid")); 45 kBadRequest, "'text' is missing or invalid"));
46 return; 46 return;
47 } 47 }
48 Error* error = session_->SetAlertPromptText(text); 48 Error* error = session_->SetAlertPromptText(text);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return true; 82 return true;
83 } 83 }
84 84
85 void DismissAlertCommand::ExecutePost(Response* const response) { 85 void DismissAlertCommand::ExecutePost(Response* const response) {
86 Error* error = session_->AcceptOrDismissAlert(false); 86 Error* error = session_->AcceptOrDismissAlert(false);
87 if (error) 87 if (error)
88 response->SetError(error); 88 response->SetError(error);
89 } 89 }
90 90
91 } // namespace webdriver 91 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/live_sync/two_client_preferences_sync_test.cc ('k') | chrome/test/webdriver/commands/appcache_status_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698