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

Side by Side Diff: ash/autoclick/autoclick_unittest.cc

Issue 2713923002: chromeos: moves a bunch of tests to common_unittests (Closed)
Patch Set: feedback Created 3 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/autoclick/autoclick_controller.h" 5 #include "ash/autoclick/autoclick_controller.h"
6 #include "ash/common/wm_shell.h"
6 #include "ash/shell.h" 7 #include "ash/shell.h"
7 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
8 #include "ui/aura/test/test_window_delegate.h" 9 #include "ui/aura/test/test_window_delegate.h"
9 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
10 #include "ui/aura/window_event_dispatcher.h" 11 #include "ui/aura/window_event_dispatcher.h"
11 #include "ui/display/manager/display_manager.h" 12 #include "ui/display/manager/display_manager.h"
12 #include "ui/events/event.h" 13 #include "ui/events/event.h"
13 #include "ui/events/event_constants.h" 14 #include "ui/events/event_constants.h"
14 #include "ui/events/event_handler.h" 15 #include "ui/events/event_handler.h"
15 #include "ui/events/event_utils.h" 16 #include "ui/events/event_utils.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 void SetUp() override { 64 void SetUp() override {
64 test::AshTestBase::SetUp(); 65 test::AshTestBase::SetUp();
65 Shell::GetInstance()->AddPreTargetHandler(&mouse_event_capturer_); 66 Shell::GetInstance()->AddPreTargetHandler(&mouse_event_capturer_);
66 GetAutoclickController()->SetAutoclickDelay(base::TimeDelta()); 67 GetAutoclickController()->SetAutoclickDelay(base::TimeDelta());
67 68
68 // Move mouse to deterministic location at the start of each test. 69 // Move mouse to deterministic location at the start of each test.
69 GetEventGenerator().MoveMouseTo(100, 100); 70 GetEventGenerator().MoveMouseTo(100, 100);
70 71
71 // Make sure the display is initialized so we don't fail the test due to any 72 // Make sure the display is initialized so we don't fail the test due to any
72 // input events caused from creating the display. 73 // input events caused from creating the display.
73 Shell::GetInstance()->display_manager()->UpdateDisplays(); 74 if (!WmShell::Get()->IsRunningInMash())
75 Shell::GetInstance()->display_manager()->UpdateDisplays();
74 RunAllPendingInMessageLoop(); 76 RunAllPendingInMessageLoop();
75 } 77 }
76 78
77 void TearDown() override { 79 void TearDown() override {
78 Shell::GetInstance()->RemovePreTargetHandler(&mouse_event_capturer_); 80 Shell::GetInstance()->RemovePreTargetHandler(&mouse_event_capturer_);
79 test::AshTestBase::TearDown(); 81 test::AshTestBase::TearDown();
80 } 82 }
81 83
82 void MoveMouseWithFlagsTo(int x, int y, ui::EventFlags flags) { 84 void MoveMouseWithFlagsTo(int x, int y, ui::EventFlags flags) {
83 GetEventGenerator().set_flags(flags); 85 GetEventGenerator().set_flags(flags);
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 aura::test::EventCountDelegate delegate; 285 aura::test::EventCountDelegate delegate;
284 std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithDelegate( 286 std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithDelegate(
285 &delegate, 123, gfx::Rect(50, 50, 100, 100))); 287 &delegate, 123, gfx::Rect(50, 50, 100, 100)));
286 window->Show(); 288 window->Show();
287 events = WaitForMouseEvents(); 289 events = WaitForMouseEvents();
288 EXPECT_EQ(0u, events.size()); 290 EXPECT_EQ(0u, events.size());
289 EXPECT_EQ("1 1 0", delegate.GetMouseMotionCountsAndReset()); 291 EXPECT_EQ("1 1 0", delegate.GetMouseMotionCountsAndReset());
290 } 292 }
291 293
292 } // namespace ash 294 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_filter_unittest.cc ('k') | ash/common/shelf/shelf_button_pressed_metric_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698