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 static_cast<WebContentsImpl*>(web_contents) | 230 web_contents->GetRenderViewHost()->GetWidget()->ForwardKeyboardEvent(event); |
231 ->GetFocusedRenderWidgetHost() | |
232 ->ForwardKeyboardEvent(event); | |
233 } | 231 } |
234 | 232 |
235 void GetCookiesCallback(std::string* cookies_out, | 233 void GetCookiesCallback(std::string* cookies_out, |
236 base::WaitableEvent* event, | 234 base::WaitableEvent* event, |
237 const std::string& cookies) { | 235 const std::string& cookies) { |
238 *cookies_out = cookies; | 236 *cookies_out = cookies; |
239 event->Signal(); | 237 event->Signal(); |
240 } | 238 } |
241 | 239 |
242 void GetCookiesOnIOThread(const GURL& url, | 240 void GetCookiesOnIOThread(const GURL& url, |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 void FrameWatcher::WaitFrames(int frames_to_wait) { | 1091 void FrameWatcher::WaitFrames(int frames_to_wait) { |
1094 if (frames_to_wait <= 0) | 1092 if (frames_to_wait <= 0) |
1095 return; | 1093 return; |
1096 base::RunLoop run_loop; | 1094 base::RunLoop run_loop; |
1097 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); | 1095 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); |
1098 base::AutoReset<int> reset_frames_to_wait(&frames_to_wait_, frames_to_wait); | 1096 base::AutoReset<int> reset_frames_to_wait(&frames_to_wait_, frames_to_wait); |
1099 run_loop.Run(); | 1097 run_loop.Run(); |
1100 } | 1098 } |
1101 | 1099 |
1102 } // namespace content | 1100 } // namespace content |
OLD | NEW |