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

Side by Side Diff: content/browser/renderer_host/render_widget_host_unittest.cc

Issue 2756893002: Add Keyboard Latency UMA Metrics. (Closed)
Patch Set: Restrict to RawKeyDown and Char events on Android & Mac Created 3 years, 7 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 (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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <memory> 8 #include <memory>
9 #include <tuple> 9 #include <tuple>
10 10
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 NativeWebKeyboardEvent native_event(type, modifiers, 631 NativeWebKeyboardEvent native_event(type, modifiers,
632 GetNextSimulatedEventTimeSeconds()); 632 GetNextSimulatedEventTimeSeconds());
633 host_->ForwardKeyboardEvent(native_event); 633 host_->ForwardKeyboardEvent(native_event);
634 } 634 }
635 635
636 void SimulateKeyboardEventWithCommands(WebInputEvent::Type type) { 636 void SimulateKeyboardEventWithCommands(WebInputEvent::Type type) {
637 NativeWebKeyboardEvent native_event(type, 0, 637 NativeWebKeyboardEvent native_event(type, 0,
638 GetNextSimulatedEventTimeSeconds()); 638 GetNextSimulatedEventTimeSeconds());
639 EditCommands commands; 639 EditCommands commands;
640 commands.emplace_back("name", "value"); 640 commands.emplace_back("name", "value");
641 host_->ForwardKeyboardEventWithCommands(native_event, &commands, nullptr); 641 host_->ForwardKeyboardEventWithCommands(native_event, ui::LatencyInfo(),
642 &commands, nullptr);
642 } 643 }
643 644
644 void SimulateMouseEvent(WebInputEvent::Type type) { 645 void SimulateMouseEvent(WebInputEvent::Type type) {
645 host_->ForwardMouseEvent(SyntheticWebMouseEventBuilder::Build(type)); 646 host_->ForwardMouseEvent(SyntheticWebMouseEventBuilder::Build(type));
646 } 647 }
647 648
648 void SimulateMouseEventWithLatencyInfo(WebInputEvent::Type type, 649 void SimulateMouseEventWithLatencyInfo(WebInputEvent::Type type,
649 const ui::LatencyInfo& ui_latency) { 650 const ui::LatencyInfo& ui_latency) {
650 host_->ForwardMouseEventWithLatencyInfo( 651 host_->ForwardMouseEventWithLatencyInfo(
651 SyntheticWebMouseEventBuilder::Build(type), 652 SyntheticWebMouseEventBuilder::Build(type),
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after
2154 EXPECT_EQ(0u, host_->processed_frame_messages_count()); 2155 EXPECT_EQ(0u, host_->processed_frame_messages_count());
2155 2156
2156 frame = MakeCompositorFrame(1.f, frame_size); 2157 frame = MakeCompositorFrame(1.f, frame_size);
2157 frame.metadata.frame_token = frame_token3; 2158 frame.metadata.frame_token = frame_token3;
2158 host_->SubmitCompositorFrame(local_surface_id, std::move(frame)); 2159 host_->SubmitCompositorFrame(local_surface_id, std::move(frame));
2159 EXPECT_EQ(0u, host_->queued_messages_.size()); 2160 EXPECT_EQ(0u, host_->queued_messages_.size());
2160 EXPECT_EQ(1u, host_->processed_frame_messages_count()); 2161 EXPECT_EQ(1u, host_->processed_frame_messages_count());
2161 } 2162 }
2162 2163
2163 } // namespace content 2164 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698