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

Side by Side Diff: chrome/test/base/interactive_test_utils_mac.mm

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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/interactive_test_utils.h" 5 #include "chrome/test/base/interactive_test_utils.h"
6 6
7 #include <Carbon/Carbon.h> 7 #include <Carbon/Carbon.h>
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 void ClickOnView(const Browser* browser, ViewID vid) { 77 void ClickOnView(const Browser* browser, ViewID vid) {
78 NSWindow* window = browser->window()->GetNativeWindow(); 78 NSWindow* window = browser->window()->GetNativeWindow();
79 DCHECK(window); 79 DCHECK(window);
80 NSView* view = view_id_util::GetView(window, vid); 80 NSView* view = view_id_util::GetView(window, vid);
81 DCHECK(view); 81 DCHECK(view);
82 MoveMouseToNSViewCenterAndPress( 82 MoveMouseToNSViewCenterAndPress(
83 view, 83 view,
84 ui_controls::LEFT, 84 ui_controls::LEFT,
85 ui_controls::DOWN | ui_controls::UP, 85 ui_controls::DOWN | ui_controls::UP,
86 base::MessageLoop::QuitClosure()); 86 base::MessageLoop::QuitWhenIdleClosure());
87 content::RunMessageLoop(); 87 content::RunMessageLoop();
88 } 88 }
89 89
90 void FocusView(const Browser* browser, ViewID vid) { 90 void FocusView(const Browser* browser, ViewID vid) {
91 NSWindow* window = browser->window()->GetNativeWindow(); 91 NSWindow* window = browser->window()->GetNativeWindow();
92 DCHECK(window); 92 DCHECK(window);
93 NSView* view = view_id_util::GetView(window, vid); 93 NSView* view = view_id_util::GetView(window, vid);
94 DCHECK(view); 94 DCHECK(view);
95 [window makeFirstResponder:view]; 95 [window makeFirstResponder:view];
96 } 96 }
(...skipping 23 matching lines...) Expand all
120 // events are sent via ui_test_utils::SendKeyPressSync. 120 // events are sent via ui_test_utils::SendKeyPressSync.
121 BOOL notification_observed = [async_waiter wait]; 121 BOOL notification_observed = [async_waiter wait];
122 base::RunLoop().RunUntilIdle(); // There may be other events queued. Flush. 122 base::RunLoop().RunUntilIdle(); // There may be other events queued. Flush.
123 NSMenu* file_menu = [[[NSApp mainMenu] itemWithTag:IDC_FILE_MENU] submenu]; 123 NSMenu* file_menu = [[[NSApp mainMenu] itemWithTag:IDC_FILE_MENU] submenu];
124 [[file_menu delegate] menuNeedsUpdate:file_menu]; 124 [[file_menu delegate] menuNeedsUpdate:file_menu];
125 125
126 return !async_waiter || notification_observed; 126 return !async_waiter || notification_observed;
127 } 127 }
128 128
129 } // namespace ui_test_utils 129 } // namespace ui_test_utils
OLDNEW
« no previous file with comments | « chrome/test/base/in_process_browser_test.h ('k') | chrome/test/base/interactive_test_utils_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698