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

Side by Side Diff: ash/wm/user_activity_detector_unittest.cc

Issue 10831240: Remove TouchEvent interface, and rename TouchEventImpl to TouchEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge-tot Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/user_activity_detector.cc ('k') | ash/wm/window_cycle_controller.cc » ('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 (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/user_activity_detector.h" 5 #include "ash/wm/user_activity_detector.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "ash/wm/user_activity_observer.h" 9 #include "ash/wm/user_activity_observer.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 base::TimeDelta advance_delta = 90 base::TimeDelta advance_delta =
91 base::TimeDelta::FromSeconds(UserActivityDetector::kNotifyIntervalSec); 91 base::TimeDelta::FromSeconds(UserActivityDetector::kNotifyIntervalSec);
92 AdvanceTime(advance_delta); 92 AdvanceTime(advance_delta);
93 ui::MouseEvent mouse_event( 93 ui::MouseEvent mouse_event(
94 ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), ui::EF_NONE); 94 ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), ui::EF_NONE);
95 EXPECT_FALSE(detector_->PreHandleMouseEvent(window.get(), &mouse_event)); 95 EXPECT_FALSE(detector_->PreHandleMouseEvent(window.get(), &mouse_event));
96 EXPECT_EQ(1, observer_->num_invocations()); 96 EXPECT_EQ(1, observer_->num_invocations());
97 observer_->reset_stats(); 97 observer_->reset_stats();
98 98
99 AdvanceTime(advance_delta); 99 AdvanceTime(advance_delta);
100 ui::TouchEventImpl touch_event( 100 ui::TouchEvent touch_event(
101 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta()); 101 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta());
102 EXPECT_FALSE(detector_->PreHandleTouchEvent(window.get(), &touch_event)); 102 EXPECT_FALSE(detector_->PreHandleTouchEvent(window.get(), &touch_event));
103 EXPECT_EQ(1, observer_->num_invocations()); 103 EXPECT_EQ(1, observer_->num_invocations());
104 observer_->reset_stats(); 104 observer_->reset_stats();
105 105
106 AdvanceTime(advance_delta); 106 AdvanceTime(advance_delta);
107 ui::GestureEventImpl gesture_event( 107 ui::GestureEventImpl gesture_event(
108 ui::ET_GESTURE_TAP, 0, 0, ui::EF_NONE, base::Time(), 108 ui::ET_GESTURE_TAP, 0, 0, ui::EF_NONE, base::Time(),
109 ui::GestureEventDetails(ui::ET_GESTURE_TAP, 0, 0), 0U); 109 ui::GestureEventDetails(ui::ET_GESTURE_TAP, 0, 0), 0U);
110 EXPECT_FALSE(detector_->PreHandleGestureEvent(window.get(), &gesture_event)); 110 EXPECT_FALSE(detector_->PreHandleGestureEvent(window.get(), &gesture_event));
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 scoped_ptr<aura::Window> window( 148 scoped_ptr<aura::Window> window(
149 aura::test::CreateTestWindowWithId(12345, NULL)); 149 aura::test::CreateTestWindowWithId(12345, NULL));
150 ui::MouseEvent mouse_event( 150 ui::MouseEvent mouse_event(
151 ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), ui::EF_IS_SYNTHESIZED); 151 ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), ui::EF_IS_SYNTHESIZED);
152 EXPECT_FALSE(detector_->PreHandleMouseEvent(window.get(), &mouse_event)); 152 EXPECT_FALSE(detector_->PreHandleMouseEvent(window.get(), &mouse_event));
153 EXPECT_EQ(0, observer_->num_invocations()); 153 EXPECT_EQ(0, observer_->num_invocations());
154 } 154 }
155 155
156 } // namespace test 156 } // namespace test
157 } // namespace ash 157 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/user_activity_detector.cc ('k') | ash/wm/window_cycle_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698