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

Unified Diff: chrome/test/base/interactive_test_utils_cocoa.mm

Issue 1669793002: mac_views_browser: fixed interactive_ui_tests compilation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/base/interactive_test_utils_cocoa.mm
diff --git a/chrome/test/base/interactive_test_utils_mac.mm b/chrome/test/base/interactive_test_utils_cocoa.mm
similarity index 68%
copy from chrome/test/base/interactive_test_utils_mac.mm
copy to chrome/test/base/interactive_test_utils_cocoa.mm
index c1c3b10f8681be79265ffc4cd35998adea9efd61..24535e24be2dfc79435b512829160c9adacc1e1c 100644
--- a/chrome/test/base/interactive_test_utils_mac.mm
+++ b/chrome/test/base/interactive_test_utils_cocoa.mm
@@ -8,14 +8,11 @@
#import <Cocoa/Cocoa.h>
#include "base/bind.h"
-#include "base/logging.h"
tapted 2016/02/05 05:11:11 nit: keep this -- there are still DCHECKs below an
kirr 2016/02/05 13:26:23 Done.
#include "base/message_loop/message_loop.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#import "chrome/browser/ui/cocoa/view_id_util.h"
-#include "ui/base/test/ui_controls.h"
-#import "ui/base/test/windowed_nsnotification_observer.h"
namespace ui_test_utils {
@@ -95,35 +92,5 @@ void FocusView(const Browser* browser, ViewID vid) {
[window makeFirstResponder:view];
}
-void HideNativeWindow(gfx::NativeWindow window) {
- [window orderOut:nil];
-}
-
-bool ShowAndFocusNativeWindow(gfx::NativeWindow window) {
- // Make sure an unbundled program can get the input focus.
- ProcessSerialNumber psn = { 0, kCurrentProcess };
- TransformProcessType(&psn,kProcessTransformToForegroundApplication);
- SetFrontProcess(&psn);
-
- base::scoped_nsobject<WindowedNSNotificationObserver> async_waiter;
- if (![window isKeyWindow]) {
- // Only wait when expecting a change to actually occur.
- async_waiter.reset([[WindowedNSNotificationObserver alloc]
- initForNotification:NSWindowDidBecomeKeyNotification
- object:window]);
- }
- [window makeKeyAndOrderFront:nil];
-
- // Wait until |window| becomes key window, then make sure the shortcuts for
- // "Close Window" and "Close Tab" are updated.
- // This is because normal AppKit menu updating does not get invoked when
- // events are sent via ui_test_utils::SendKeyPressSync.
- BOOL notification_observed = [async_waiter wait];
- base::RunLoop().RunUntilIdle(); // There may be other events queued. Flush.
- NSMenu* file_menu = [[[NSApp mainMenu] itemWithTag:IDC_FILE_MENU] submenu];
- [[file_menu delegate] menuNeedsUpdate:file_menu];
-
- return !async_waiter || notification_observed;
-}
-
} // namespace ui_test_utils
+
tapted 2016/02/05 05:11:11 nit: remove blank line
kirr 2016/02/05 13:26:23 Done.

Powered by Google App Engine
This is Rietveld 408576698