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

Side by Side Diff: content/browser/speech/speech_recognition_browsertest.cc

Issue 10807047: Create content\public\test\test_utils.h to hold common test classes that are used by unit and brows… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « content/browser/session_history_browsertest.cc ('k') | content/content_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 ui_test_utils::NavigateToURL(browser(), test_url); 202 ui_test_utils::NavigateToURL(browser(), test_url);
203 203
204 WebKit::WebMouseEvent mouse_event; 204 WebKit::WebMouseEvent mouse_event;
205 mouse_event.type = WebKit::WebInputEvent::MouseDown; 205 mouse_event.type = WebKit::WebInputEvent::MouseDown;
206 mouse_event.button = WebKit::WebMouseEvent::ButtonLeft; 206 mouse_event.button = WebKit::WebMouseEvent::ButtonLeft;
207 mouse_event.x = 0; 207 mouse_event.x = 0;
208 mouse_event.y = 0; 208 mouse_event.y = 0;
209 mouse_event.clickCount = 1; 209 mouse_event.clickCount = 1;
210 WebContents* web_contents = chrome::GetActiveWebContents(browser()); 210 WebContents* web_contents = chrome::GetActiveWebContents(browser());
211 211
212 ui_test_utils::WindowedNotificationObserver observer( 212 content::WindowedNotificationObserver observer(
213 content::NOTIFICATION_LOAD_STOP, 213 content::NOTIFICATION_LOAD_STOP,
214 content::Source<NavigationController>(&web_contents->GetController())); 214 content::Source<NavigationController>(&web_contents->GetController()));
215 web_contents->GetRenderViewHost()->ForwardMouseEvent(mouse_event); 215 web_contents->GetRenderViewHost()->ForwardMouseEvent(mouse_event);
216 mouse_event.type = WebKit::WebInputEvent::MouseUp; 216 mouse_event.type = WebKit::WebInputEvent::MouseUp;
217 web_contents->GetRenderViewHost()->ForwardMouseEvent(mouse_event); 217 web_contents->GetRenderViewHost()->ForwardMouseEvent(mouse_event);
218 fake_speech_recognition_manager_.recognition_started_event().Wait(); 218 fake_speech_recognition_manager_.recognition_started_event().Wait();
219 219
220 // We should wait for a navigation event, raised by the test page JS code 220 // We should wait for a navigation event, raised by the test page JS code
221 // upon the onwebkitspeechchange event, in all cases except when the 221 // upon the onwebkitspeechchange event, in all cases except when the
222 // speech response is inhibited. 222 // speech response is inhibited.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 290
291 // Make the renderer crash. This should trigger 291 // Make the renderer crash. This should trigger
292 // InputTagSpeechDispatcherHost to cancel all pending sessions. 292 // InputTagSpeechDispatcherHost to cancel all pending sessions.
293 GURL test_url("about:crash"); 293 GURL test_url("about:crash");
294 ui_test_utils::NavigateToURL(browser(), test_url); 294 ui_test_utils::NavigateToURL(browser(), test_url);
295 295
296 EXPECT_TRUE(fake_speech_recognition_manager_.did_cancel_all()); 296 EXPECT_TRUE(fake_speech_recognition_manager_.did_cancel_all());
297 } 297 }
298 298
299 } // namespace speech 299 } // namespace speech
OLDNEW
« no previous file with comments | « content/browser/session_history_browsertest.cc ('k') | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698