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

Unified Diff: ui/views/test/widget_test.h

Issue 334573008: MacViews: Encapsulate some Aura specifics in widget_unittest.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile Created 6 years, 6 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
« no previous file with comments | « no previous file | ui/views/test/widget_test.cc » ('j') | ui/views/test/widget_test_mac.mm » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/widget_test.h
diff --git a/ui/views/test/widget_test.h b/ui/views/test/widget_test.h
index dbb8abb53864d5ce1f97f33e8550c66d9ba9283a..2809458f9ce5c4a920663256a4c358beb7a12c83 100644
--- a/ui/views/test/widget_test.h
+++ b/ui/views/test/widget_test.h
@@ -7,13 +7,35 @@
#include "ui/gfx/native_widget_types.h"
#include "ui/views/test/views_test_base.h"
+
+#if defined(USE_AURA)
#include "ui/views/widget/native_widget_aura.h"
+# if !defined(OS_CHROMEOS)
sky 2014/06/18 17:12:48 no indentation of nested ifdefs.
tapted 2014/06/19 02:00:13 Done.
+# include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
+# endif
+#elif defined(OS_MACOSX)
+#include "ui/views/widget/native_widget_mac.h"
+#endif
+
+namespace ui {
+class EventProcessor;
+}
namespace views {
class NativeWidget;
class Widget;
+#if defined(USE_AURA)
+typedef NativeWidgetAura PlatformNativeWidget;
+# if !defined(OS_CHROMEOS)
+typedef DesktopNativeWidgetAura PlatformDesktopNativeWidget;
+# endif
+#elif defined(OS_MACOSX)
+typedef NativeWidgetMac PlatformNativeWidget;
+typedef NativeWidgetMac PlatformDesktopNativeWidget;
+#endif
+
namespace internal {
class RootView;
@@ -24,7 +46,7 @@ namespace test {
// A widget that assumes mouse capture always works. It won't on Aura in
// testing, so we mock it.
-class NativeWidgetCapture : public NativeWidgetAura {
+class NativeWidgetCapture : public PlatformNativeWidget {
public:
explicit NativeWidgetCapture(internal::NativeWidgetDelegate* delegate);
virtual ~NativeWidgetCapture();
@@ -65,6 +87,17 @@ class WidgetTest : public ViewsTestBase {
View* GetGestureHandler(internal::RootView* root_view);
+ // Simulate a OS-level destruction of the native widget held by |widget|.
+ static void SimulateNativeDestroy(Widget* widget);
+
+ // Return true if |window| is visible according to the native platform.
+ static bool IsNativeWindowVisible(gfx::NativeWindow window);
+
+ // Return the event processor for |widget|. On aura platforms, this is an
+ // aura::WindowEventDispatcher. Otherwise, it is a bridge to the OS event
+ // processor.
+ static ui::EventProcessor* GetEventProcessor(Widget* widget);
+
private:
DISALLOW_COPY_AND_ASSIGN(WidgetTest);
};
« no previous file with comments | « no previous file | ui/views/test/widget_test.cc » ('j') | ui/views/test/widget_test_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698