OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |