| Index: chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc
|
| diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc
|
| index ec4ef5ea09526a1b513cc9b218e628ce0fd3d19d..46de1bf2b7cb310acf0e5250eda3dfb8dcd69ff5 100644
|
| --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc
|
| +++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc
|
| @@ -16,6 +16,21 @@
|
| #include "ui/aura/test/event_generator.h"
|
| #include "ui/aura/window.h"
|
|
|
| +using aura::Window;
|
| +
|
| +namespace {
|
| +
|
| +bool HasChildWindowNamed(Window* window, const char* name) {
|
| + for (size_t i = 0; i < window->children().size(); ++i) {
|
| + Window* child = window->children()[i];
|
| + if (child->name() == name)
|
| + return true;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| class AppNonClientFrameViewAuraTest : public InProcessBrowserTest {
|
| public:
|
| AppNonClientFrameViewAuraTest() : InProcessBrowserTest(), app_browser_(NULL) {
|
| @@ -94,3 +109,23 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAuraTest, KeyboardClose) {
|
| // App browser is closed.
|
| EXPECT_EQ(1u, browser::GetBrowserCount(browser()->profile()));
|
| }
|
| +
|
| +// Ensure that snapping left with Alt-[ closes the control window.
|
| +IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAuraTest, SnapLeftClosesControls) {
|
| + aura::RootWindow* root_window = GetRootWindow();
|
| + aura::test::EventGenerator eg(root_window);
|
| + aura::Window* native_window = app_browser()->window()->GetNativeWindow();
|
| +
|
| + // Control window exists.
|
| + EXPECT_TRUE(HasChildWindowNamed(
|
| + native_window, AppNonClientFrameViewAura::kControlWindowName));
|
| +
|
| + // Send Alt-[
|
| + eg.PressKey(ui::VKEY_OEM_4, ui::EF_ALT_DOWN);
|
| + eg.ReleaseKey(ui::VKEY_OEM_4, ui::EF_ALT_DOWN);
|
| + content::RunAllPendingInMessageLoop();
|
| +
|
| + // Control window is gone.
|
| + EXPECT_FALSE(HasChildWindowNamed(
|
| + native_window, AppNonClientFrameViewAura::kControlWindowName));
|
| +}
|
|
|