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/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 } | 220 } |
221 } | 221 } |
222 | 222 |
223 void InjectRawKeyEvent(WebContents* web_contents, | 223 void InjectRawKeyEvent(WebContents* web_contents, |
224 blink::WebInputEvent::Type type, | 224 blink::WebInputEvent::Type type, |
225 ui::KeyboardCode key_code, | 225 ui::KeyboardCode key_code, |
226 int native_key_code, | 226 int native_key_code, |
227 int modifiers) { | 227 int modifiers) { |
228 NativeWebKeyboardEvent event; | 228 NativeWebKeyboardEvent event; |
229 BuildSimpleWebKeyEvent(type, key_code, native_key_code, modifiers, &event); | 229 BuildSimpleWebKeyEvent(type, key_code, native_key_code, modifiers, &event); |
230 web_contents->GetRenderViewHost()->GetWidget()->ForwardKeyboardEvent(event); | 230 static_cast<WebContentsImpl*>(web_contents) |
| 231 ->GetFocusedRenderWidgetHost() |
| 232 ->ForwardKeyboardEvent(event); |
231 } | 233 } |
232 | 234 |
233 void GetCookiesCallback(std::string* cookies_out, | 235 void GetCookiesCallback(std::string* cookies_out, |
234 base::WaitableEvent* event, | 236 base::WaitableEvent* event, |
235 const std::string& cookies) { | 237 const std::string& cookies) { |
236 *cookies_out = cookies; | 238 *cookies_out = cookies; |
237 event->Signal(); | 239 event->Signal(); |
238 } | 240 } |
239 | 241 |
240 void GetCookiesOnIOThread(const GURL& url, | 242 void GetCookiesOnIOThread(const GURL& url, |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 void FrameWatcher::WaitFrames(int frames_to_wait) { | 1093 void FrameWatcher::WaitFrames(int frames_to_wait) { |
1092 if (frames_to_wait <= 0) | 1094 if (frames_to_wait <= 0) |
1093 return; | 1095 return; |
1094 base::RunLoop run_loop; | 1096 base::RunLoop run_loop; |
1095 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); | 1097 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); |
1096 base::AutoReset<int> reset_frames_to_wait(&frames_to_wait_, frames_to_wait); | 1098 base::AutoReset<int> reset_frames_to_wait(&frames_to_wait_, frames_to_wait); |
1097 run_loop.Run(); | 1099 run_loop.Run(); |
1098 } | 1100 } |
1099 | 1101 |
1100 } // namespace content | 1102 } // namespace content |
OLD | NEW |