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

Side by Side Diff: ui/events/gestures/motion_event_aura_unittest.cc

Issue 567783002: Add modifier flags to MotionEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove MotionEvent modifiers Created 6 years, 3 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 | « ui/events/gestures/motion_event_aura.cc ('k') | no next file » | 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 // MSVC++ requires this to be set before any other includes to get M_PI. 5 // MSVC++ requires this to be set before any other includes to get M_PI.
6 #define _USE_MATH_DEFINES 6 #define _USE_MATH_DEFINES
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 MotionEventAura event; 398 MotionEventAura event;
399 399
400 // For now, all pointers have an unknown tool type. 400 // For now, all pointers have an unknown tool type.
401 // TODO(jdduke): Expand this test when ui::TouchEvent identifies the source 401 // TODO(jdduke): Expand this test when ui::TouchEvent identifies the source
402 // touch type, crbug.com/404128. 402 // touch type, crbug.com/404128.
403 event.OnTouch(TouchWithType(ET_TOUCH_PRESSED, 7)); 403 event.OnTouch(TouchWithType(ET_TOUCH_PRESSED, 7));
404 ASSERT_EQ(1U, event.GetPointerCount()); 404 ASSERT_EQ(1U, event.GetPointerCount());
405 EXPECT_EQ(MotionEvent::TOOL_TYPE_UNKNOWN, event.GetToolType(0)); 405 EXPECT_EQ(MotionEvent::TOOL_TYPE_UNKNOWN, event.GetToolType(0));
406 } 406 }
407 407
408 TEST(MotionEventAuraTest, Flags) {
409 int ids[] = {7, 11};
410 MotionEventAura event;
411
412 TouchEvent press0 = TouchWithType(ET_TOUCH_PRESSED, ids[0]);
413 press0.set_flags(EF_CONTROL_DOWN);
414 event.OnTouch(press0);
415 EXPECT_EQ(EF_CONTROL_DOWN, event.GetFlags());
416
417 TouchEvent press1 = TouchWithType(ET_TOUCH_PRESSED, ids[1]);
418 press1.set_flags(EF_CONTROL_DOWN | EF_CAPS_LOCK_DOWN);
419 event.OnTouch(press1);
420 EXPECT_EQ(EF_CONTROL_DOWN | EF_CAPS_LOCK_DOWN, event.GetFlags());
421 }
422
408 } // namespace ui 423 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gestures/motion_event_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698