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

Unified Diff: ash/wm/frame_painter_unittest.cc

Issue 11795004: Continue threading context through unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | « ash/wm/custom_frame_view_ash_unittest.cc ('k') | ash/wm/gestures/long_press_affordance_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/frame_painter_unittest.cc
diff --git a/ash/wm/frame_painter_unittest.cc b/ash/wm/frame_painter_unittest.cc
index 6ff1b5d8cd385fbdd3d1f787c0cf31191177a657..9839d5e3a2385af7b5f0900c9b25b2309b47ebd7 100644
--- a/ash/wm/frame_painter_unittest.cc
+++ b/ash/wm/frame_painter_unittest.cc
@@ -78,40 +78,44 @@ class WindowRepaintChecker : public aura::WindowObserver {
DISALLOW_COPY_AND_ASSIGN(WindowRepaintChecker);
};
-// Creates a test widget that owns its native widget.
-Widget* CreateTestWidget() {
- Widget* widget = new Widget;
- Widget::InitParams params;
- params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- widget->Init(params);
- return widget;
-}
-
-Widget* CreateAlwaysOnTopWidget() {
- Widget* widget = new Widget;
- Widget::InitParams params;
- params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- params.keep_on_top = true;
- widget->Init(params);
- return widget;
-}
-
-Widget* CreateResizableWidget() {
- Widget* widget = new Widget;
- Widget::InitParams params;
- params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- params.keep_on_top = true;
- params.delegate = new ResizableWidgetDelegate(widget);
- params.type = Widget::InitParams::TYPE_WINDOW;
- widget->Init(params);
- return widget;
-}
-
} // namespace
namespace ash {
-typedef ash::test::AshTestBase FramePainterTest;
+class FramePainterTest : public ash::test::AshTestBase {
+ public:
+ // Creates a test widget that owns its native widget.
+ Widget* CreateTestWidget() {
+ Widget* widget = new Widget;
+ Widget::InitParams params;
+ params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
+ params.context = CurrentContext();
+ widget->Init(params);
+ return widget;
+ }
+
+ Widget* CreateAlwaysOnTopWidget() {
+ Widget* widget = new Widget;
+ Widget::InitParams params;
+ params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
+ params.context = CurrentContext();
+ params.keep_on_top = true;
+ widget->Init(params);
+ return widget;
+ }
+
+ Widget* CreateResizableWidget() {
+ Widget* widget = new Widget;
+ Widget::InitParams params;
+ params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
+ params.context = CurrentContext();
+ params.keep_on_top = true;
+ params.delegate = new ResizableWidgetDelegate(widget);
+ params.type = Widget::InitParams::TYPE_WINDOW;
+ widget->Init(params);
+ return widget;
+ }
+};
TEST_F(FramePainterTest, Basics) {
// Other tests might have created a FramePainter, so we cannot assert that
« no previous file with comments | « ash/wm/custom_frame_view_ash_unittest.cc ('k') | ash/wm/gestures/long_press_affordance_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698