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

Side by Side Diff: chrome/test/base/ui_test_utils.cc

Issue 10833029: Move ui_test_utils::CrashTab to browser_test_utils so that it can be reused by content_browsertests. (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
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 "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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } 353 }
354 354
355 AppModalDialog* WaitForAppModalDialog() { 355 AppModalDialog* WaitForAppModalDialog() {
356 content::WindowedNotificationObserver observer( 356 content::WindowedNotificationObserver observer(
357 chrome::NOTIFICATION_APP_MODAL_DIALOG_SHOWN, 357 chrome::NOTIFICATION_APP_MODAL_DIALOG_SHOWN,
358 content::NotificationService::AllSources()); 358 content::NotificationService::AllSources());
359 observer.Wait(); 359 observer.Wait();
360 return content::Source<AppModalDialog>(observer.source()).ptr(); 360 return content::Source<AppModalDialog>(observer.source()).ptr();
361 } 361 }
362 362
363 void CrashTab(WebContents* tab) {
364 content::RenderProcessHost* rph = tab->GetRenderProcessHost();
365 content::WindowedNotificationObserver observer(
366 content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
367 content::Source<content::RenderProcessHost>(rph));
368 base::KillProcess(rph->GetHandle(), 0, false);
369 observer.Wait();
370 }
371
372 int FindInPage(TabContents* tab_contents, const string16& search_string, 363 int FindInPage(TabContents* tab_contents, const string16& search_string,
373 bool forward, bool match_case, int* ordinal) { 364 bool forward, bool match_case, int* ordinal) {
374 tab_contents-> 365 tab_contents->
375 find_tab_helper()->StartFinding(search_string, forward, match_case); 366 find_tab_helper()->StartFinding(search_string, forward, match_case);
376 FindInPageNotificationObserver observer(tab_contents); 367 FindInPageNotificationObserver observer(tab_contents);
377 if (ordinal) 368 if (ordinal)
378 *ordinal = observer.active_match_ordinal(); 369 *ordinal = observer.active_match_ordinal();
379 return observer.number_of_matches(); 370 return observer.number_of_matches();
380 } 371 }
381 372
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 int state, 697 int state,
707 const base::Closure& followup) { 698 const base::Closure& followup) {
708 if (!followup.is_null()) 699 if (!followup.is_null())
709 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); 700 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup);
710 else 701 else
711 ui_controls::SendMouseEvents(button, state); 702 ui_controls::SendMouseEvents(button, state);
712 } 703 }
713 704
714 } // namespace internal 705 } // namespace internal
715 } // namespace ui_test_utils 706 } // namespace ui_test_utils
OLDNEW
« no previous file with comments | « chrome/test/base/ui_test_utils.h ('k') | content/browser/in_process_webkit/indexed_db_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698