| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/workspace/workspace_event_handler.h" | 5 #include "ash/wm/workspace/workspace_event_handler.h" |
| 6 | 6 |
| 7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 #include "ash/wm/window_state.h" | 10 #include "ash/wm/window_state.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 EXPECT_FALSE(window_state->IsMaximized()); | 268 EXPECT_FALSE(window_state->IsMaximized()); |
| 269 EXPECT_EQ("1,2 30x40", window->bounds().ToString()); | 269 EXPECT_EQ("1,2 30x40", window->bounds().ToString()); |
| 270 | 270 |
| 271 // Double-clicking the middle button shouldn't toggle the maximized state. | 271 // Double-clicking the middle button shouldn't toggle the maximized state. |
| 272 WindowPropertyObserver observer(window.get()); | 272 WindowPropertyObserver observer(window.get()); |
| 273 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, generator.current_location(), | 273 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, generator.current_location(), |
| 274 generator.current_location(), | 274 generator.current_location(), |
| 275 ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_IS_DOUBLE_CLICK, | 275 ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_IS_DOUBLE_CLICK, |
| 276 ui::EF_MIDDLE_MOUSE_BUTTON); | 276 ui::EF_MIDDLE_MOUSE_BUTTON); |
| 277 aura::WindowEventDispatcher* dispatcher = root->GetDispatcher(); | 277 aura::WindowEventDispatcher* dispatcher = root->GetDispatcher(); |
| 278 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&press); | 278 dispatcher->AsWindowTreeHostDelegate()->OnHostMouseEvent(&press); |
| 279 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, generator.current_location(), | 279 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, generator.current_location(), |
| 280 generator.current_location(), | 280 generator.current_location(), |
| 281 ui::EF_IS_DOUBLE_CLICK, | 281 ui::EF_IS_DOUBLE_CLICK, |
| 282 ui::EF_MIDDLE_MOUSE_BUTTON); | 282 ui::EF_MIDDLE_MOUSE_BUTTON); |
| 283 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&release); | 283 dispatcher->AsWindowTreeHostDelegate()->OnHostMouseEvent(&release); |
| 284 | 284 |
| 285 EXPECT_FALSE(window_state->IsMaximized()); | 285 EXPECT_FALSE(window_state->IsMaximized()); |
| 286 EXPECT_EQ("1,2 30x40", window->bounds().ToString()); | 286 EXPECT_EQ("1,2 30x40", window->bounds().ToString()); |
| 287 EXPECT_FALSE(observer.DidPropertyChange(aura::client::kShowStateKey)); | 287 EXPECT_FALSE(observer.DidPropertyChange(aura::client::kShowStateKey)); |
| 288 } | 288 } |
| 289 | 289 |
| 290 TEST_F(WorkspaceEventHandlerTest, DoubleTapCaptionTogglesMaximize) { | 290 TEST_F(WorkspaceEventHandlerTest, DoubleTapCaptionTogglesMaximize) { |
| 291 aura::test::TestWindowDelegate wd; | 291 aura::test::TestWindowDelegate wd; |
| 292 gfx::Rect bounds(10, 20, 30, 40); | 292 gfx::Rect bounds(10, 20, 30, 40); |
| 293 scoped_ptr<aura::Window> window(CreateTestWindow(&wd, bounds)); | 293 scoped_ptr<aura::Window> window(CreateTestWindow(&wd, bounds)); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 ASSERT_TRUE(aura::client::GetWindowMoveClient(window->GetRootWindow())); | 342 ASSERT_TRUE(aura::client::GetWindowMoveClient(window->GetRootWindow())); |
| 343 base::MessageLoop::current()->DeleteSoon(FROM_HERE, window.get()); | 343 base::MessageLoop::current()->DeleteSoon(FROM_HERE, window.get()); |
| 344 aura::client::GetWindowMoveClient(window->GetRootWindow()) | 344 aura::client::GetWindowMoveClient(window->GetRootWindow()) |
| 345 ->RunMoveLoop(window.release(), | 345 ->RunMoveLoop(window.release(), |
| 346 gfx::Vector2d(), | 346 gfx::Vector2d(), |
| 347 aura::client::WINDOW_MOVE_SOURCE_MOUSE); | 347 aura::client::WINDOW_MOVE_SOURCE_MOUSE); |
| 348 } | 348 } |
| 349 | 349 |
| 350 } // namespace internal | 350 } // namespace internal |
| 351 } // namespace ash | 351 } // namespace ash |
| OLD | NEW |