summaryrefslogtreecommitdiffstats
path: root/ash/root_window_controller_unittest.cc
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-26 03:58:37 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-26 03:58:37 +0000
commit8f2f15141bcd177e42d8ff69c13850d7f18e3b49 (patch)
treec65cef97b01f4b700d07d1226710b36b71c06dbf /ash/root_window_controller_unittest.cc
parent737ed650e86ac3bd52f3d47e77c11af627ce1a57 (diff)
downloadchromium_src-8f2f15141bcd177e42d8ff69c13850d7f18e3b49.zip
chromium_src-8f2f15141bcd177e42d8ff69c13850d7f18e3b49.tar.gz
chromium_src-8f2f15141bcd177e42d8ff69c13850d7f18e3b49.tar.bz2
Test to make sure a unparented control gets moved to another root window
when a display is disconnected. BUG=171908 TEST=coverted by test. Review URL: https://chromiumcodereview.appspot.com/12040086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179017 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/root_window_controller_unittest.cc')
-rw-r--r--ash/root_window_controller_unittest.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index 06d7a166..09af6d3 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -165,6 +165,17 @@ TEST_F(RootWindowControllerTest, MAYBE_MoveWindows_Basic) {
EXPECT_EQ("0,0 500x500",
fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString());
+ views::Widget* unparented_control = new Widget;
+ Widget::InitParams params;
+ params.bounds = gfx::Rect(650, 10, 100, 100);
+ params.context = CurrentContext();
+ params.type = Widget::InitParams::TYPE_CONTROL;
+ unparented_control->Init(params);
+ EXPECT_EQ(root_windows[1],
+ unparented_control->GetNativeView()->GetRootWindow());
+ EXPECT_EQ(internal::kShellWindowId_UnparentedControlContainer,
+ unparented_control->GetNativeView()->parent()->id());
+
// Make sure a window that will delete itself when losing focus
// will not crash.
aura::WindowTracker tracker;
@@ -215,6 +226,12 @@ TEST_F(RootWindowControllerTest, MAYBE_MoveWindows_Basic) {
fullscreen->GetWindowBoundsInScreen().ToString());
EXPECT_EQ("300,10 100x100",
fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString());
+
+ // Test if the unparented widget has moved.
+ EXPECT_EQ(root_windows[0],
+ unparented_control->GetNativeView()->GetRootWindow());
+ EXPECT_EQ(internal::kShellWindowId_UnparentedControlContainer,
+ unparented_control->GetNativeView()->parent()->id());
}
#if defined(OS_WIN)