OLD | NEW |
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 "ui/wm/core/user_activity_detector.h" | 5 #include "ui/wm/core/user_activity_detector.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "ui/aura/test/aura_test_base.h" | 10 #include "ui/aura/test/aura_test_base.h" |
11 #include "ui/events/event.h" | 11 #include "ui/events/event.h" |
12 #include "ui/events/event_constants.h" | 12 #include "ui/events/event_constants.h" |
13 #include "ui/events/keycodes/keyboard_codes.h" | 13 #include "ui/events/keycodes/keyboard_codes.h" |
14 #include "ui/gfx/point.h" | 14 #include "ui/gfx/geometry/point.h" |
15 #include "ui/wm/core/user_activity_observer.h" | 15 #include "ui/wm/core/user_activity_observer.h" |
16 | 16 |
17 namespace wm { | 17 namespace wm { |
18 | 18 |
19 // Implementation that just counts the number of times we've been told that the | 19 // Implementation that just counts the number of times we've been told that the |
20 // user is active. | 20 // user is active. |
21 class TestUserActivityObserver : public UserActivityObserver { | 21 class TestUserActivityObserver : public UserActivityObserver { |
22 public: | 22 public: |
23 TestUserActivityObserver() : num_invocations_(0) {} | 23 TestUserActivityObserver() : num_invocations_(0) {} |
24 | 24 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), ui::EF_IS_SYNTHESIZED, | 191 ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), ui::EF_IS_SYNTHESIZED, |
192 ui::EF_NONE); | 192 ui::EF_NONE); |
193 detector_->OnMouseEvent(&mouse_event); | 193 detector_->OnMouseEvent(&mouse_event); |
194 EXPECT_FALSE(mouse_event.handled()); | 194 EXPECT_FALSE(mouse_event.handled()); |
195 EXPECT_EQ(base::TimeTicks().ToInternalValue(), | 195 EXPECT_EQ(base::TimeTicks().ToInternalValue(), |
196 detector_->last_activity_time().ToInternalValue()); | 196 detector_->last_activity_time().ToInternalValue()); |
197 EXPECT_EQ(0, observer_->num_invocations()); | 197 EXPECT_EQ(0, observer_->num_invocations()); |
198 } | 198 } |
199 | 199 |
200 } // namespace wm | 200 } // namespace wm |
OLD | NEW |