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