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

Side by Side Diff: content/public/test/browser_test_utils.cc

Issue 1124223012: Change JSONReader::ReadToValue to return a scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: chromedriver Created 5 years, 7 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) 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 "content/public/test/browser_test_utils.h" 5 #include "content/public/test/browser_test_utils.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/process/kill.h" 10 #include "base/process/kill.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 if (!dom_op_observer.WaitAndGetResponse(&json)) { 143 if (!dom_op_observer.WaitAndGetResponse(&json)) {
144 DLOG(ERROR) << "Cannot communicate with DOMOperationObserver."; 144 DLOG(ERROR) << "Cannot communicate with DOMOperationObserver.";
145 return false; 145 return false;
146 } 146 }
147 147
148 // Nothing more to do for callers that ignore the returned JS value. 148 // Nothing more to do for callers that ignore the returned JS value.
149 if (!result) 149 if (!result)
150 return true; 150 return true;
151 151
152 base::JSONReader reader(base::JSON_ALLOW_TRAILING_COMMAS); 152 base::JSONReader reader(base::JSON_ALLOW_TRAILING_COMMAS);
153 result->reset(reader.ReadToValue(json)); 153 *result = reader.ReadToValue(json);
154 if (!result->get()) { 154 if (!*result) {
155 DLOG(ERROR) << reader.GetErrorMessage(); 155 DLOG(ERROR) << reader.GetErrorMessage();
156 return false; 156 return false;
157 } 157 }
158 158
159 return true; 159 return true;
160 } 160 }
161 161
162 void BuildSimpleWebKeyEvent(blink::WebInputEvent::Type type, 162 void BuildSimpleWebKeyEvent(blink::WebInputEvent::Type type,
163 ui::KeyboardCode key_code, 163 ui::KeyboardCode key_code,
164 int native_key_code, 164 int native_key_code,
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 953
954 bool WebContentsAddedObserver::RenderViewCreatedCalled() { 954 bool WebContentsAddedObserver::RenderViewCreatedCalled() {
955 if (child_observer_) { 955 if (child_observer_) {
956 return child_observer_->render_view_created_called_ && 956 return child_observer_->render_view_created_called_ &&
957 child_observer_->main_frame_created_called_; 957 child_observer_->main_frame_created_called_;
958 } 958 }
959 return false; 959 return false;
960 } 960 }
961 961
962 } // namespace content 962 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/nacl/nacl_browsertest_util.cc ('k') | extensions/browser/value_store/leveldb_value_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698