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

Side by Side Diff: ui/aura/gestures/gesture_recognizer_unittest.cc

Issue 11591006: Track input latency with UMA stats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added per event type histograms Created 7 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_widget.cc ('k') | ui/aura/test/event_generator.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 "base/memory/scoped_vector.h" 5 #include "base/memory/scoped_vector.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/timer.h" 8 #include "base/timer.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
11 #include "ui/aura/root_window.h" 11 #include "ui/aura/root_window.h"
12 #include "ui/aura/test/aura_test_base.h" 12 #include "ui/aura/test/aura_test_base.h"
13 #include "ui/aura/test/event_generator.h" 13 #include "ui/aura/test/event_generator.h"
14 #include "ui/aura/test/test_window_delegate.h" 14 #include "ui/aura/test/test_window_delegate.h"
15 #include "ui/aura/test/test_windows.h" 15 #include "ui/aura/test/test_windows.h"
16 #include "ui/base/events/event.h" 16 #include "ui/base/events/event.h"
17 #include "ui/base/events/event_utils.h"
17 #include "ui/base/gestures/gesture_configuration.h" 18 #include "ui/base/gestures/gesture_configuration.h"
18 #include "ui/base/gestures/gesture_recognizer_impl.h" 19 #include "ui/base/gestures/gesture_recognizer_impl.h"
19 #include "ui/base/gestures/gesture_sequence.h" 20 #include "ui/base/gestures/gesture_sequence.h"
20 #include "ui/base/gestures/gesture_types.h" 21 #include "ui/base/gestures/gesture_types.h"
21 #include "ui/base/hit_test.h" 22 #include "ui/base/hit_test.h"
22 #include "ui/gfx/point.h" 23 #include "ui/gfx/point.h"
23 #include "ui/gfx/rect.h" 24 #include "ui/gfx/rect.h"
24 25
25 #include <queue> 26 #include <queue>
26 27
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 virtual ui::GestureSequence* CreateSequence( 471 virtual ui::GestureSequence* CreateSequence(
471 ui::GestureEventHelper* helper) OVERRIDE { 472 ui::GestureEventHelper* helper) OVERRIDE {
472 return new TimerTestGestureSequence(helper); 473 return new TimerTestGestureSequence(helper);
473 } 474 }
474 475
475 private: 476 private:
476 DISALLOW_COPY_AND_ASSIGN(TimerTestGestureRecognizer); 477 DISALLOW_COPY_AND_ASSIGN(TimerTestGestureRecognizer);
477 }; 478 };
478 479
479 base::TimeDelta GetTime() { 480 base::TimeDelta GetTime() {
480 return base::Time::NowFromSystemTime() - base::Time(); 481 return ui::EventTimeForNow();
481 } 482 }
482 483
483 class TimedEvents { 484 class TimedEvents {
484 private: 485 private:
485 int simulated_now_; 486 int simulated_now_;
486 487
487 public: 488 public:
488 TimedEvents() : simulated_now_(0) { 489 TimedEvents() : simulated_now_(0) {
489 } 490 }
490 491
(...skipping 2555 matching lines...) Expand 10 before | Expand all | Expand 10 after
3046 tes.LeapForward(40)); 3047 tes.LeapForward(40));
3047 root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4); 3048 root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4);
3048 EXPECT_TRUE(delegate->scroll_update()); 3049 EXPECT_TRUE(delegate->scroll_update());
3049 EXPECT_EQ(-1, delegate->scroll_y()); 3050 EXPECT_EQ(-1, delegate->scroll_y());
3050 3051
3051 delegate->Reset(); 3052 delegate->Reset();
3052 } 3053 }
3053 3054
3054 } // namespace test 3055 } // namespace test
3055 } // namespace aura 3056 } // namespace aura
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | ui/aura/test/event_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698