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 "chrome/test/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 } | 559 } |
560 | 560 |
561 AppModalDialog* WaitForAppModalDialog() { | 561 AppModalDialog* WaitForAppModalDialog() { |
562 content::WindowedNotificationObserver observer( | 562 content::WindowedNotificationObserver observer( |
563 chrome::NOTIFICATION_APP_MODAL_DIALOG_SHOWN, | 563 chrome::NOTIFICATION_APP_MODAL_DIALOG_SHOWN, |
564 content::NotificationService::AllSources()); | 564 content::NotificationService::AllSources()); |
565 observer.Wait(); | 565 observer.Wait(); |
566 return content::Source<AppModalDialog>(observer.source()).ptr(); | 566 return content::Source<AppModalDialog>(observer.source()).ptr(); |
567 } | 567 } |
568 | 568 |
569 void WaitForAppModalDialogAndCloseIt() { | |
570 AppModalDialog* dialog = WaitForAppModalDialog(); | |
571 dialog->CloseModalDialog(); | |
572 } | |
573 | |
574 void CrashTab(WebContents* tab) { | 569 void CrashTab(WebContents* tab) { |
575 content::RenderProcessHost* rph = tab->GetRenderProcessHost(); | 570 content::RenderProcessHost* rph = tab->GetRenderProcessHost(); |
576 content::WindowedNotificationObserver observer( | 571 content::WindowedNotificationObserver observer( |
577 content::NOTIFICATION_RENDERER_PROCESS_CLOSED, | 572 content::NOTIFICATION_RENDERER_PROCESS_CLOSED, |
578 content::Source<content::RenderProcessHost>(rph)); | 573 content::Source<content::RenderProcessHost>(rph)); |
579 base::KillProcess(rph->GetHandle(), 0, false); | 574 base::KillProcess(rph->GetHandle(), 0, false); |
580 observer.Wait(); | 575 observer.Wait(); |
581 } | 576 } |
582 | 577 |
583 int FindInPage(TabContents* tab_contents, const string16& search_string, | 578 int FindInPage(TabContents* tab_contents, const string16& search_string, |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 int state, | 1059 int state, |
1065 const base::Closure& followup) { | 1060 const base::Closure& followup) { |
1066 if (!followup.is_null()) | 1061 if (!followup.is_null()) |
1067 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); | 1062 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); |
1068 else | 1063 else |
1069 ui_controls::SendMouseEvents(button, state); | 1064 ui_controls::SendMouseEvents(button, state); |
1070 } | 1065 } |
1071 | 1066 |
1072 } // namespace internal | 1067 } // namespace internal |
1073 } // namespace ui_test_utils | 1068 } // namespace ui_test_utils |
OLD | NEW |