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

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

Issue 11293121: Add latency measurement system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor input event changes Created 8 years 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
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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/shared_memory.h" 7 #include "base/shared_memory.h"
8 #include "base/timer.h" 8 #include "base/timer.h"
9 #include "content/browser/browser_thread_impl.h" 9 #include "content/browser/browser_thread_impl.h"
10 #include "content/browser/renderer_host/backing_store.h" 10 #include "content/browser/renderer_host/backing_store.h"
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 void ReleaseTouchPoint(int index) { 634 void ReleaseTouchPoint(int index) {
635 CHECK(index >= 0 && index < touch_event_.touchesLengthCap); 635 CHECK(index >= 0 && index < touch_event_.touchesLengthCap);
636 touch_event_.touches[index].state = WebKit::WebTouchPoint::StateReleased; 636 touch_event_.touches[index].state = WebKit::WebTouchPoint::StateReleased;
637 touch_event_.type = WebInputEvent::TouchEnd; 637 touch_event_.type = WebInputEvent::TouchEnd;
638 } 638 }
639 639
640 const WebInputEvent* GetInputEventFromMessage(const IPC::Message& message) { 640 const WebInputEvent* GetInputEventFromMessage(const IPC::Message& message) {
641 PickleIterator iter(message); 641 PickleIterator iter(message);
642 const char* data; 642 const char* data;
643 int data_length; 643 int data_length;
644 int64 input_number;
645 if (!message.ReadInt64(&iter, &input_number))
646 return NULL;
644 if (!message.ReadData(&iter, &data, &data_length)) 647 if (!message.ReadData(&iter, &data, &data_length))
645 return NULL; 648 return NULL;
646 return reinterpret_cast<const WebInputEvent*>(data); 649 return reinterpret_cast<const WebInputEvent*>(data);
647 } 650 }
648 651
649 MessageLoopForUI message_loop_; 652 MessageLoopForUI message_loop_;
650 653
651 scoped_ptr<TestBrowserContext> browser_context_; 654 scoped_ptr<TestBrowserContext> browser_context_;
652 RenderWidgetHostProcess* process_; // Deleted automatically by the widget. 655 RenderWidgetHostProcess* process_; // Deleted automatically by the widget.
653 scoped_ptr<MockRenderWidgetHostDelegate> delegate_; 656 scoped_ptr<MockRenderWidgetHostDelegate> delegate_;
(...skipping 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after
3101 EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize()); 3104 EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize());
3102 EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize()); 3105 EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize());
3103 3106
3104 SendInputEventACK(WebKit::WebInputEvent::GestureScrollEnd, false); 3107 SendInputEventACK(WebKit::WebInputEvent::GestureScrollEnd, false);
3105 EXPECT_EQ(0U, process_->sink().message_count()); 3108 EXPECT_EQ(0U, process_->sink().message_count());
3106 EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); 3109 EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize());
3107 EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize()); 3110 EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize());
3108 } 3111 }
3109 3112
3110 } // namespace content 3113 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698