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

Side by Side Diff: ash/wm/workspace/workspace_event_handler_unittest.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse event constructor Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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/common/wm/workspace/workspace_event_handler.h" 5 #include "ash/common/wm/workspace/workspace_event_handler.h"
6 6
7 #include "ash/common/wm/window_state.h" 7 #include "ash/common/wm/window_state.h"
8 #include "ash/common/wm/wm_event.h" 8 #include "ash/common/wm/wm_event.h"
9 #include "ash/common/wm/workspace_controller.h" 9 #include "ash/common/wm/workspace_controller.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 19 matching lines...) Expand all
30 30
31 namespace ash { 31 namespace ash {
32 32
33 namespace { 33 namespace {
34 34
35 // Clicks |button| with |flags|. 35 // Clicks |button| with |flags|.
36 void ClickButtonWithFlags(ui::test::EventGenerator* generator, 36 void ClickButtonWithFlags(ui::test::EventGenerator* generator,
37 int button, 37 int button,
38 int flags) { 38 int flags) {
39 gfx::Point location = generator->current_location(); 39 gfx::Point location = generator->current_location();
40 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, location, location, 40 ui::MouseEvent press(
41 ui::EventTimeForNow(), button | flags, button); 41 ui::ET_MOUSE_PRESSED, location, location, ui::EventTimeForNow(),
42 button | flags, button,
43 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
42 generator->Dispatch(&press); 44 generator->Dispatch(&press);
43 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, location, location, 45 ui::MouseEvent release(
44 ui::EventTimeForNow(), button | flags, button); 46 ui::ET_MOUSE_RELEASED, location, location, ui::EventTimeForNow(),
47 button | flags, button,
48 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
45 generator->Dispatch(&release); 49 generator->Dispatch(&release);
46 } 50 }
47 51
48 } // namespace 52 } // namespace
49 53
50 class WorkspaceEventHandlerTest : public test::AshTestBase { 54 class WorkspaceEventHandlerTest : public test::AshTestBase {
51 public: 55 public:
52 WorkspaceEventHandlerTest() {} 56 WorkspaceEventHandlerTest() {}
53 ~WorkspaceEventHandlerTest() override {} 57 ~WorkspaceEventHandlerTest() override {}
54 58
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 delegate.set_window_component(HTCAPTION); 548 delegate.set_window_component(HTCAPTION);
545 generator.PressRightButton(); 549 generator.PressRightButton();
546 generator.ReleaseRightButton(); 550 generator.ReleaseRightButton();
547 EXPECT_FALSE(window_state->IsMaximized()); 551 EXPECT_FALSE(window_state->IsMaximized());
548 ClickButtonWithFlags(&generator, ui::EF_LEFT_MOUSE_BUTTON, 552 ClickButtonWithFlags(&generator, ui::EF_LEFT_MOUSE_BUTTON,
549 ui::EF_IS_DOUBLE_CLICK); 553 ui::EF_IS_DOUBLE_CLICK);
550 EXPECT_FALSE(window_state->IsMaximized()); 554 EXPECT_FALSE(window_state->IsMaximized());
551 } 555 }
552 556
553 } // namespace ash 557 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698