#include "ash/test/ash_test_base.h"
#include "ash/wm/window_state.h"
#include "ash/wm/wm_event.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/window.h"
kWorkAreaBounds.height());
EXPECT_EQ(expected.ToString(), window->GetBoundsInScreen().ToString());
- // It should not be possible to snap a window with a maximum size.
- delegate.set_minimum_size(gfx::Size());
- delegate.set_maximum_size(gfx::Size(kWorkAreaBounds.width() - 1, INT_MAX));
+ // It should not be possible to snap a window with a maximum size, or if it
+ // cannot be maximized.
+ delegate.set_maximum_size(gfx::Size(kWorkAreaBounds.width() - 1, 0));
+ EXPECT_FALSE(window_state->CanSnap());
+ delegate.set_maximum_size(gfx::Size(0, kWorkAreaBounds.height() - 1));
+ EXPECT_FALSE(window_state->CanSnap());
+ delegate.set_maximum_size(gfx::Size());
+ window->SetProperty(aura::client::kCanMaximizeKey, false);
EXPECT_FALSE(window_state->CanSnap());
}