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

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

Issue 2756893002: Add Keyboard Latency UMA Metrics. (Closed)
Patch Set: Fix test issue 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 (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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 return last_simulated_event_time_seconds_; 563 return last_simulated_event_time_seconds_;
564 } 564 }
565 565
566 void SimulateKeyboardEvent(WebInputEvent::Type type) { 566 void SimulateKeyboardEvent(WebInputEvent::Type type) {
567 SimulateKeyboardEvent(type, 0); 567 SimulateKeyboardEvent(type, 0);
568 } 568 }
569 569
570 void SimulateKeyboardEvent(WebInputEvent::Type type, int modifiers) { 570 void SimulateKeyboardEvent(WebInputEvent::Type type, int modifiers) {
571 NativeWebKeyboardEvent native_event(type, modifiers, 571 NativeWebKeyboardEvent native_event(type, modifiers,
572 GetNextSimulatedEventTimeSeconds()); 572 GetNextSimulatedEventTimeSeconds());
573 host_->ForwardKeyboardEvent(native_event); 573 host_->ForwardKeyboardEventWithLatencyInfo(native_event, ui::LatencyInfo());
574 } 574 }
575 575
576 void SimulateKeyboardEventWithCommands(WebInputEvent::Type type) { 576 void SimulateKeyboardEventWithCommands(WebInputEvent::Type type) {
577 NativeWebKeyboardEvent native_event(type, 0, 577 NativeWebKeyboardEvent native_event(type, 0,
578 GetNextSimulatedEventTimeSeconds()); 578 GetNextSimulatedEventTimeSeconds());
579 EditCommands commands; 579 EditCommands commands;
580 commands.emplace_back("name", "value"); 580 commands.emplace_back("name", "value");
581 host_->ForwardKeyboardEventWithCommands(native_event, &commands, nullptr); 581 host_->ForwardKeyboardEventWithCommands(native_event, ui::LatencyInfo(),
582 &commands, nullptr);
582 } 583 }
583 584
584 void SimulateMouseEvent(WebInputEvent::Type type) { 585 void SimulateMouseEvent(WebInputEvent::Type type) {
585 host_->ForwardMouseEvent(SyntheticWebMouseEventBuilder::Build(type)); 586 host_->ForwardMouseEvent(SyntheticWebMouseEventBuilder::Build(type));
586 } 587 }
587 588
588 void SimulateMouseEventWithLatencyInfo(WebInputEvent::Type type, 589 void SimulateMouseEventWithLatencyInfo(WebInputEvent::Type type,
589 const ui::LatencyInfo& ui_latency) { 590 const ui::LatencyInfo& ui_latency) {
590 host_->ForwardMouseEventWithLatencyInfo( 591 host_->ForwardMouseEventWithLatencyInfo(
591 SyntheticWebMouseEventBuilder::Build(type), 592 SyntheticWebMouseEventBuilder::Build(type),
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1907 const IPC::Message* msg = sink_->GetMessageAt(0); 1908 const IPC::Message* msg = sink_->GetMessageAt(0);
1908 EXPECT_EQ(ViewMsg_ReclaimCompositorResources::ID, msg->type()); 1909 EXPECT_EQ(ViewMsg_ReclaimCompositorResources::ID, msg->type());
1909 ViewMsg_ReclaimCompositorResources::Param params; 1910 ViewMsg_ReclaimCompositorResources::Param params;
1910 ViewMsg_ReclaimCompositorResources::Read(msg, &params); 1911 ViewMsg_ReclaimCompositorResources::Read(msg, &params);
1911 EXPECT_EQ(2u, std::get<0>(params)); // compositor_frame_sink_id 1912 EXPECT_EQ(2u, std::get<0>(params)); // compositor_frame_sink_id
1912 } 1913 }
1913 sink_->ClearMessages(); 1914 sink_->ClearMessages();
1914 } 1915 }
1915 1916
1916 } // namespace content 1917 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698