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

Unified Diff: ash/shell_unittest.cc

Issue 10857021: Prepare a bunch of ash tests for workspace2. With Workspace2 you can't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/launcher/launcher_context_menu_unittest.cc ('k') | ash/wm/activation_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell_unittest.cc
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index dce879c95231dc9e394f591f18bf8bc2da4de3c8..d6b0d5959122079dcc73a974f578b386a86a64c4 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();
}
« no previous file with comments | « ash/launcher/launcher_context_menu_unittest.cc ('k') | ash/wm/activation_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698