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 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 BrowserWindow* browser_window = browser->window(); | 68 BrowserWindow* browser_window = browser->window(); |
69 DCHECK(browser_window); | 69 DCHECK(browser_window); |
70 views::View* view = | 70 views::View* view = |
71 reinterpret_cast<BrowserView*>(browser_window)->GetViewByID(vid); | 71 reinterpret_cast<BrowserView*>(browser_window)->GetViewByID(vid); |
72 DCHECK(view); | 72 DCHECK(view); |
73 MoveMouseToCenterAndPress( | 73 MoveMouseToCenterAndPress( |
74 view, | 74 view, |
75 ui_controls::LEFT, | 75 ui_controls::LEFT, |
76 ui_controls::DOWN | ui_controls::UP, | 76 ui_controls::DOWN | ui_controls::UP, |
77 MessageLoop::QuitClosure()); | 77 MessageLoop::QuitClosure()); |
78 RunMessageLoop(); | 78 content::RunMessageLoop(); |
79 } | 79 } |
80 | 80 |
81 void HideNativeWindow(gfx::NativeWindow window) { | 81 void HideNativeWindow(gfx::NativeWindow window) { |
82 // TODO(jcampan): retrieve the NativeWidgetWin and show/hide on it instead of | 82 // TODO(jcampan): retrieve the NativeWidgetWin and show/hide on it instead of |
83 // using Windows API. | 83 // using Windows API. |
84 ::ShowWindow(window, SW_HIDE); | 84 ::ShowWindow(window, SW_HIDE); |
85 } | 85 } |
86 | 86 |
87 bool ShowAndFocusNativeWindow(gfx::NativeWindow window) { | 87 bool ShowAndFocusNativeWindow(gfx::NativeWindow window) { |
88 // TODO(jcampan): retrieve the NativeWidgetWin and show/hide on it instead of | 88 // TODO(jcampan): retrieve the NativeWidgetWin and show/hide on it instead of |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 | 143 |
144 bool SaveScreenSnapshotToDesktop(FilePath* screenshot_path) { | 144 bool SaveScreenSnapshotToDesktop(FilePath* screenshot_path) { |
145 FilePath desktop; | 145 FilePath desktop; |
146 | 146 |
147 return PathService::Get(chrome::DIR_USER_DESKTOP, &desktop) && | 147 return PathService::Get(chrome::DIR_USER_DESKTOP, &desktop) && |
148 SaveScreenSnapshotToDirectory(desktop, screenshot_path); | 148 SaveScreenSnapshotToDirectory(desktop, screenshot_path); |
149 } | 149 } |
150 | 150 |
151 } // namespace ui_test_utils | 151 } // namespace ui_test_utils |
OLD | NEW |