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

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

Issue 8212006: base::Bind: Cleanup in automation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/logging.h" 10 #include "base/logging.h"
(...skipping 29 matching lines...) Expand all
40 40
41 void ClickOnView(const Browser* browser, ViewID vid) { 41 void ClickOnView(const Browser* browser, ViewID vid) {
42 NSWindow* window = browser->window()->GetNativeHandle(); 42 NSWindow* window = browser->window()->GetNativeHandle();
43 DCHECK(window); 43 DCHECK(window);
44 NSView* view = view_id_util::GetView(window, vid); 44 NSView* view = view_id_util::GetView(window, vid);
45 DCHECK(view); 45 DCHECK(view);
46 ui_controls::MoveMouseToCenterAndPress( 46 ui_controls::MoveMouseToCenterAndPress(
47 view, 47 view,
48 ui_controls::LEFT, 48 ui_controls::LEFT,
49 ui_controls::DOWN | ui_controls::UP, 49 ui_controls::DOWN | ui_controls::UP,
50 new MessageLoop::QuitTask()); 50 MessageLoop::QuitClosure());
51 RunMessageLoop(); 51 RunMessageLoop();
52 } 52 }
53 53
54 void HideNativeWindow(gfx::NativeWindow window) { 54 void HideNativeWindow(gfx::NativeWindow window) {
55 [window orderOut:nil]; 55 [window orderOut:nil];
56 } 56 }
57 57
58 void ShowAndFocusNativeWindow(gfx::NativeWindow window) { 58 void ShowAndFocusNativeWindow(gfx::NativeWindow window) {
59 // Make sure an unbundled program can get the input focus. 59 // Make sure an unbundled program can get the input focus.
60 ProcessSerialNumber psn = { 0, kCurrentProcess }; 60 ProcessSerialNumber psn = { 0, kCurrentProcess };
61 TransformProcessType(&psn,kProcessTransformToForegroundApplication); 61 TransformProcessType(&psn,kProcessTransformToForegroundApplication);
62 SetFrontProcess(&psn); 62 SetFrontProcess(&psn);
63 63
64 [window makeKeyAndOrderFront:nil]; 64 [window makeKeyAndOrderFront:nil];
65 } 65 }
66 66
67 } // namespace ui_test_utils 67 } // namespace ui_test_utils
OLDNEW
« chrome/browser/automation/ui_controls_mac.mm ('K') | « chrome/test/base/ui_test_utils_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698