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

Side by Side Diff: ui/events/event_unittest.cc

Issue 822803005: Correct missing radius in ui::TouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix case. Created 5 years, 11 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/event.h ('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 (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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "ui/events/event.h" 7 #include "ui/events/event.h"
8 #include "ui/events/event_utils.h" 8 #include "ui/events/event_utils.h"
9 #include "ui/events/keycodes/dom3/dom_code.h" 9 #include "ui/events/keycodes/dom3/dom_code.h"
10 #include "ui/events/keycodes/dom4/keycode_converter.h" 10 #include "ui/events/keycodes/dom4/keycode_converter.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 EXPECT_FALSE(key_a4_pressed.IsRepeat()); 491 EXPECT_FALSE(key_a4_pressed.IsRepeat());
492 492
493 KeyEvent key_a4_pressed_nonstandard_state( 493 KeyEvent key_a4_pressed_nonstandard_state(
494 native_event_a_pressed_nonstandard_state); 494 native_event_a_pressed_nonstandard_state);
495 EXPECT_FALSE(key_a4_pressed_nonstandard_state.IsRepeat()); 495 EXPECT_FALSE(key_a4_pressed_nonstandard_state.IsRepeat());
496 } 496 }
497 #endif 497 #endif
498 } 498 }
499 #endif // USE_X11 || OS_WIN 499 #endif // USE_X11 || OS_WIN
500 500
501 TEST(EventTest, TouchEventRadiusDefaultsToOtherAxis) {
502 const base::TimeDelta time = base::TimeDelta::FromMilliseconds(0);
503 const float non_zero_length1 = 30;
504 const float non_zero_length2 = 46;
505
506 TouchEvent event1(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 0, 0, time,
507 non_zero_length1, 0, 0, 0);
508 DCHECK_EQ(non_zero_length1, event1.radius_x());
509 DCHECK_EQ(non_zero_length1, event1.radius_y());
510
511 TouchEvent event2(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 0, 0, time,
512 0, non_zero_length2, 0, 0);
513 DCHECK_EQ(non_zero_length2, event2.radius_x());
514 DCHECK_EQ(non_zero_length2, event2.radius_y());
515 }
516
501 } // namespace ui 517 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698