summaryrefslogtreecommitdiffstats
path: root/ash/shell_unittest.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-16 04:28:37 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-16 04:28:37 +0000
commit932cf113991a891486faaba65f2d266afa023906 (patch)
tree414e932123fb1ba19e287f1c404c1a2562e1c3e6 /ash/shell_unittest.cc
parentff5692ed360a1e71ca3ba7d3be29a930f7e25dec (diff)
downloadchromium_src-932cf113991a891486faaba65f2d266afa023906.zip
chromium_src-932cf113991a891486faaba65f2d266afa023906.tar.gz
chromium_src-932cf113991a891486faaba65f2d266afa023906.tar.bz2
Prepare a bunch of ash tests for workspace2. With Workspace2 you can't
add to the default container, instead you need to go through the StackingClient. BUG=137342 TEST=none R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10857021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151848 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell_unittest.cc')
-rw-r--r--ash/shell_unittest.cc23
1 files changed, 15 insertions, 8 deletions
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index dce879c..d6b0d59 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -85,7 +85,8 @@ void TestCreateWindow(views::Widget::InitParams::Type type,
views::Widget* widget = CreateTestWindow(widget_params);
widget->Show();
- EXPECT_EQ(expected_container, widget->GetNativeWindow()->parent()) <<
+ EXPECT_TRUE(expected_container->Contains(
+ widget->GetNativeWindow()->parent())) <<
"TestCreateWindow: type=" << type << ", always_on_top=" << always_on_top;
widget->Close();
@@ -145,7 +146,8 @@ TEST_F(ShellTest, ChangeAlwaysOnTop) {
widget->Show();
// It should be in default container.
- EXPECT_EQ(GetDefaultContainer(), widget->GetNativeWindow()->parent());
+ EXPECT_TRUE(GetDefaultContainer()->Contains(
+ widget->GetNativeWindow()->parent()));
// Flip always-on-top flag.
widget->SetAlwaysOnTop(true);
@@ -155,12 +157,14 @@ TEST_F(ShellTest, ChangeAlwaysOnTop) {
// Flip always-on-top flag.
widget->SetAlwaysOnTop(false);
// It should go back to default container.
- EXPECT_EQ(GetDefaultContainer(), widget->GetNativeWindow()->parent());
+ EXPECT_TRUE(GetDefaultContainer()->Contains(
+ widget->GetNativeWindow()->parent()));
// Set the same always-on-top flag again.
widget->SetAlwaysOnTop(false);
// Should have no effect and we are still in the default container.
- EXPECT_EQ(GetDefaultContainer(), widget->GetNativeWindow()->parent());
+ EXPECT_TRUE(GetDefaultContainer()->Contains(
+ widget->GetNativeWindow()->parent()));
widget->Close();
}
@@ -174,7 +178,8 @@ TEST_F(ShellTest, CreateModalWindow) {
widget->Show();
// It should be in default container.
- EXPECT_EQ(GetDefaultContainer(), widget->GetNativeWindow()->parent());
+ EXPECT_TRUE(GetDefaultContainer()->Contains(
+ widget->GetNativeWindow()->parent()));
// Create a modal window.
views::Widget* modal_widget = views::Widget::CreateWindowWithParent(
@@ -200,7 +205,8 @@ TEST_F(ShellTest, CreateLockScreenModalWindow) {
widget->Show();
// It should be in default container.
- EXPECT_EQ(GetDefaultContainer(), widget->GetNativeWindow()->parent());
+ EXPECT_TRUE(GetDefaultContainer()->Contains(
+ widget->GetNativeWindow()->parent()));
// Create a LockScreen window.
views::Widget* lock_widget = CreateTestWindow(widget_params);
@@ -264,8 +270,6 @@ TEST_F(ShellTest, MAYBE_ManagedWindowModeBasics) {
// We start with the usual window containers.
ExpectAllContainers();
- // We have a default container event filter (for window drags).
- EXPECT_TRUE(GetDefaultContainer()->event_filter());
// Launcher is visible.
views::Widget* launcher_widget = shell->launcher()->widget();
EXPECT_TRUE(launcher_widget->IsVisible());
@@ -290,6 +294,9 @@ TEST_F(ShellTest, MAYBE_ManagedWindowModeBasics) {
widget->Show();
EXPECT_FALSE(widget->IsMaximized());
+ // We have a default container event filter (for window drags).
+ EXPECT_TRUE(widget->GetNativeWindow()->parent()->event_filter());
+
// Clean up.
widget->Close();
}