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

Side by Side Diff: athena/input/input_manager_unittest.cc

Issue 641683003: C++11 override style change for athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebase Created 6 years, 2 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
« no previous file with comments | « athena/input/input_manager_impl.h ('k') | athena/input/power_button_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "athena/input/input_manager_impl.h" 5 #include "athena/input/input_manager_impl.h"
6 6
7 #include "athena/input/public/accelerator_manager.h" 7 #include "athena/input/public/accelerator_manager.h"
8 #include "athena/test/base/athena_test_base.h" 8 #include "athena/test/base/athena_test_base.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "ui/events/test/event_generator.h" 10 #include "ui/events/test/event_generator.h"
11 11
12 namespace athena { 12 namespace athena {
13 namespace { 13 namespace {
14 14
15 class TestPowerButtonObserver : public PowerButtonObserver { 15 class TestPowerButtonObserver : public PowerButtonObserver {
16 public: 16 public:
17 TestPowerButtonObserver() : count_(0), state_(RELEASED) { 17 TestPowerButtonObserver() : count_(0), state_(RELEASED) {
18 InputManager::Get()->AddPowerButtonObserver(this); 18 InputManager::Get()->AddPowerButtonObserver(this);
19 } 19 }
20 virtual ~TestPowerButtonObserver() { 20 ~TestPowerButtonObserver() override {
21 InputManager::Get()->RemovePowerButtonObserver(this); 21 InputManager::Get()->RemovePowerButtonObserver(this);
22 } 22 }
23 23
24 int count() const { return count_; } 24 int count() const { return count_; }
25 State state() const { return state_; } 25 State state() const { return state_; }
26 26
27 bool WaitForLongPress() { 27 bool WaitForLongPress() {
28 run_loop_.Run(); 28 run_loop_.Run();
29 return state_ == LONG_PRESSED; 29 return state_ == LONG_PRESSED;
30 } 30 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 EXPECT_TRUE(observer.WaitForLongPress()); 98 EXPECT_TRUE(observer.WaitForLongPress());
99 EXPECT_EQ(4, observer.count()); 99 EXPECT_EQ(4, observer.count());
100 EXPECT_EQ(PowerButtonObserver::LONG_PRESSED, observer.state()); 100 EXPECT_EQ(PowerButtonObserver::LONG_PRESSED, observer.state());
101 101
102 generator.ReleaseKey(ui::VKEY_P, ui::EF_ALT_DOWN); 102 generator.ReleaseKey(ui::VKEY_P, ui::EF_ALT_DOWN);
103 EXPECT_EQ(5, observer.count()); 103 EXPECT_EQ(5, observer.count());
104 EXPECT_EQ(PowerButtonObserver::RELEASED, observer.state()); 104 EXPECT_EQ(PowerButtonObserver::RELEASED, observer.state());
105 } 105 }
106 106
107 } // namespace athena 107 } // namespace athena
OLDNEW
« no previous file with comments | « athena/input/input_manager_impl.h ('k') | athena/input/power_button_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698