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

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

Issue 10822030: Move ui_test_utils::RunMessageLoop to 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
« no previous file with comments | « chrome/test/base/ui_test_utils_gtk.cc ('k') | chrome/test/base/ui_test_utils_win.cc » ('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 "chrome/test/base/ui_test_utils.h" 5 #include "chrome/test/base/ui_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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 void ClickOnView(const Browser* browser, ViewID vid) { 42 void ClickOnView(const Browser* browser, ViewID vid) {
43 NSWindow* window = browser->window()->GetNativeWindow(); 43 NSWindow* window = browser->window()->GetNativeWindow();
44 DCHECK(window); 44 DCHECK(window);
45 NSView* view = view_id_util::GetView(window, vid); 45 NSView* view = view_id_util::GetView(window, vid);
46 DCHECK(view); 46 DCHECK(view);
47 MoveMouseToCenterAndPress( 47 MoveMouseToCenterAndPress(
48 view, 48 view,
49 ui_controls::LEFT, 49 ui_controls::LEFT,
50 ui_controls::DOWN | ui_controls::UP, 50 ui_controls::DOWN | ui_controls::UP,
51 MessageLoop::QuitClosure()); 51 MessageLoop::QuitClosure());
52 RunMessageLoop(); 52 content::RunMessageLoop();
53 } 53 }
54 54
55 void HideNativeWindow(gfx::NativeWindow window) { 55 void HideNativeWindow(gfx::NativeWindow window) {
56 [window orderOut:nil]; 56 [window orderOut:nil];
57 } 57 }
58 58
59 bool ShowAndFocusNativeWindow(gfx::NativeWindow window) { 59 bool ShowAndFocusNativeWindow(gfx::NativeWindow window) {
60 // Make sure an unbundled program can get the input focus. 60 // Make sure an unbundled program can get the input focus.
61 ProcessSerialNumber psn = { 0, kCurrentProcess }; 61 ProcessSerialNumber psn = { 0, kCurrentProcess };
62 TransformProcessType(&psn,kProcessTransformToForegroundApplication); 62 TransformProcessType(&psn,kProcessTransformToForegroundApplication);
(...skipping 21 matching lines...) Expand all
84 center = [view convertPoint:center toView:nil]; 84 center = [view convertPoint:center toView:nil];
85 center = [window convertBaseToScreen:center]; 85 center = [window convertBaseToScreen:center];
86 center = NSMakePoint(center.x, [screen frame].size.height - center.y); 86 center = NSMakePoint(center.x, [screen frame].size.height - center.y);
87 87
88 ui_controls::SendMouseMoveNotifyWhenDone( 88 ui_controls::SendMouseMoveNotifyWhenDone(
89 center.x, center.y, 89 center.x, center.y,
90 base::Bind(&internal::ClickTask, button, state, task)); 90 base::Bind(&internal::ClickTask, button, state, task));
91 } 91 }
92 92
93 } // namespace ui_test_utils 93 } // namespace ui_test_utils
OLDNEW
« no previous file with comments | « chrome/test/base/ui_test_utils_gtk.cc ('k') | chrome/test/base/ui_test_utils_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698