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

Unified Diff: ui/aura/window_unittest.cc

Issue 8194004: change the way windows are parented when their parent is set to NULL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/window_types.h ('k') | ui/aura_shell/aura_shell.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_unittest.cc
===================================================================
--- ui/aura/window_unittest.cc (revision 104542)
+++ ui/aura/window_unittest.cc (working copy)
@@ -10,6 +10,7 @@
#include "ui/aura/event.h"
#include "ui/aura/focus_manager.h"
#include "ui/aura/root_window.h"
+#include "ui/aura/test_desktop_delegate.h"
#include "ui/aura/window_delegate.h"
#include "ui/gfx/canvas_skia.h"
#include "ui/gfx/compositor/layer.h"
@@ -177,8 +178,6 @@
WindowTest() : main_message_loop(MessageLoop::TYPE_UI) {
Desktop::GetInstance()->Show();
Desktop::GetInstance()->SetSize(gfx::Size(500, 500));
- if (!Desktop::GetInstance()->default_parent())
- Desktop::GetInstance()->CreateDefaultParentForTesting();
}
virtual ~WindowTest() {}
@@ -214,8 +213,14 @@
return window;
}
+ protected:
+ Window* toplevel_container() {
+ return desktop_delegate_.default_container();
+ }
+
private:
MessageLoop main_message_loop;
+ TestDesktopDelegate desktop_delegate_;
DISALLOW_COPY_AND_ASSIGN(WindowTest);
};
@@ -266,7 +271,7 @@
CreateTestWindow(SK_ColorGRAY, 13, gfx::Rect(5, 470, 50, 50), w1.get()));
Window* desktop = Desktop::GetInstance()->window();
- Desktop::GetInstance()->default_parent()->SetBounds(gfx::Rect(500, 500));
+ toplevel_container()->SetBounds(gfx::Rect(500, 500));
EXPECT_EQ(NULL, desktop->GetEventHandlerForPoint(gfx::Point(5, 5)));
EXPECT_EQ(w1.get(), desktop->GetEventHandlerForPoint(gfx::Point(11, 11)));
EXPECT_EQ(w11.get(), desktop->GetEventHandlerForPoint(gfx::Point(16, 16)));
« no previous file with comments | « ui/aura/window_types.h ('k') | ui/aura_shell/aura_shell.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698