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

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

Issue 7648053: [chromedriver] Add chrome.detach option for configuring Chrome not to quit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win compile issue 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/response.h" 5 #include "chrome/test/webdriver/commands/response.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 << "Accessing unset response value."; // Should never happen. 52 << "Accessing unset response value."; // Should never happen.
53 return out; 53 return out;
54 } 54 }
55 55
56 void Response::SetValue(Value* value) { 56 void Response::SetValue(Value* value) {
57 data_.Set(kValueKey, value); 57 data_.Set(kValueKey, value);
58 } 58 }
59 59
60 void Response::SetError(Error* error) { 60 void Response::SetError(Error* error) {
61 DictionaryValue* error_dict = new DictionaryValue(); 61 DictionaryValue* error_dict = new DictionaryValue();
62 error_dict->SetString(kMessageKey, error->GetMessage()); 62 error_dict->SetString(kMessageKey, error->GetErrorMessage());
63 63
64 SetStatus(error->code()); 64 SetStatus(error->code());
65 SetValue(error_dict); 65 SetValue(error_dict);
66 delete error; 66 delete error;
67 } 67 }
68 68
69 void Response::SetField(const std::string& key, Value* value) { 69 void Response::SetField(const std::string& key, Value* value) {
70 data_.Set(key, value); 70 data_.Set(key, value);
71 } 71 }
72 72
73 std::string Response::ToJSON() const { 73 std::string Response::ToJSON() const {
74 std::string json; 74 std::string json;
75 base::JSONWriter::Write(&data_, false, &json); 75 base::JSONWriter::Write(&data_, false, &json);
76 return json; 76 return json;
77 } 77 }
78 78
79 } // namespace webdriver 79 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/commands/create_session.cc ('k') | chrome/test/webdriver/commands/webdriver_command.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698