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

Side by Side Diff: content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc

Issue 2814483002: Splitting up RenderWidgetHostLatencyTracker and some renames. (Closed)
Patch Set: [Moving OnGpuSwapBuffersCompleted() back up. Created 3 years, 8 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
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 #include "base/test/histogram_tester.h" 5 #include "base/test/histogram_tester.h"
6 #include "components/rappor/public/rappor_utils.h" 6 #include "components/rappor/public/rappor_utils.h"
7 #include "components/rappor/test_rappor_service.h" 7 #include "components/rappor/test_rappor_service.h"
8 #include "content/browser/renderer_host/input/render_widget_host_latency_tracker .h" 8 #include "content/browser/renderer_host/input/render_widget_host_latency_tracker .h"
9 #include "content/common/input/synthetic_web_input_event_builders.h" 9 #include "content/common/input/synthetic_web_input_event_builders.h"
10 #include "content/public/browser/native_web_keyboard_event.h" 10 #include "content/public/browser/native_web_keyboard_event.h"
(...skipping 17 matching lines...) Expand all
28 latency->AddLatencyNumberWithTimestamp(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 28 latency->AddLatencyNumberWithTimestamp(ui::INPUT_EVENT_LATENCY_UI_COMPONENT,
29 0, 0, time_stamp, 1); 29 0, 0, time_stamp, 1);
30 latency->AddLatencyNumberWithTimestamp( 30 latency->AddLatencyNumberWithTimestamp(
31 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, time_stamp, 31 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, time_stamp,
32 1); 32 1);
33 latency->AddLatencyNumberWithTimestamp( 33 latency->AddLatencyNumberWithTimestamp(
34 ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, time_stamp, 1); 34 ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, time_stamp, 1);
35 latency->AddLatencyNumberWithTimestamp( 35 latency->AddLatencyNumberWithTimestamp(
36 ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, 0, 0, time_stamp, 1); 36 ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, 0, 0, time_stamp, 1);
37 latency->AddLatencyNumberWithTimestamp( 37 latency->AddLatencyNumberWithTimestamp(
38 ui::INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT, 0, 0, 38 ui::DISPLAY_COMPOSITOR_RECEIVED_FRAME_COMPONENT, 0, 0, time_stamp, 1);
39 time_stamp, 1);
40 } 39 }
41 40
42 void AddFakeComponents(const RenderWidgetHostLatencyTracker& tracker, 41 void AddFakeComponents(const RenderWidgetHostLatencyTracker& tracker,
43 ui::LatencyInfo* latency) { 42 ui::LatencyInfo* latency) {
44 latency->AddLatencyNumberWithTimestamp( 43 latency->AddLatencyNumberWithTimestamp(
45 ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT, 44 ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT,
46 tracker.latency_component_id(), 0, base::TimeTicks::Now(), 1); 45 tracker.latency_component_id(), 0, base::TimeTicks::Now(), 1);
47 AddFakeComponentsWithTimeStamp(tracker, latency, base::TimeTicks::Now()); 46 AddFakeComponentsWithTimeStamp(tracker, latency, base::TimeTicks::Now());
48 } 47 }
49 48
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 1079
1081 tracker()->OnInputEventAck(wheel_event, &latency, ack_state); 1080 tracker()->OnInputEventAck(wheel_event, &latency, ack_state);
1082 } 1081 }
1083 1082
1084 EXPECT_THAT(histogram_tester().GetAllSamples( 1083 EXPECT_THAT(histogram_tester().GetAllSamples(
1085 "Event.Latency.QueueingTime.MouseWheelDefaultAllowed"), 1084 "Event.Latency.QueueingTime.MouseWheelDefaultAllowed"),
1086 ElementsAre(Bucket(14, 1))); 1085 ElementsAre(Bucket(14, 1)));
1087 } 1086 }
1088 1087
1089 } // namespace content 1088 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/render_widget_host_latency_tracker.cc ('k') | gpu/ipc/client/command_buffer_proxy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698