| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 protected: | 139 protected: |
| 140 gfx::Rect bounds_; | 140 gfx::Rect bounds_; |
| 141 DISALLOW_COPY_AND_ASSIGN(TestView); | 141 DISALLOW_COPY_AND_ASSIGN(TestView); |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 // MockRenderWidgetHost ---------------------------------------------------- | 144 // MockRenderWidgetHost ---------------------------------------------------- |
| 145 | 145 |
| 146 class MockRenderWidgetHost : public RenderWidgetHost { | 146 class MockRenderWidgetHost : public RenderWidgetHost { |
| 147 public: | 147 public: |
| 148 MockRenderWidgetHost(RenderProcessHost* process, int routing_id) | 148 MockRenderWidgetHost(content::RenderProcessHost* process, int routing_id) |
| 149 : RenderWidgetHost(process, routing_id), | 149 : RenderWidgetHost(process, routing_id), |
| 150 prehandle_keyboard_event_(false), | 150 prehandle_keyboard_event_(false), |
| 151 prehandle_keyboard_event_called_(false), | 151 prehandle_keyboard_event_called_(false), |
| 152 prehandle_keyboard_event_type_(WebInputEvent::Undefined), | 152 prehandle_keyboard_event_type_(WebInputEvent::Undefined), |
| 153 unhandled_keyboard_event_called_(false), | 153 unhandled_keyboard_event_called_(false), |
| 154 unhandled_keyboard_event_type_(WebInputEvent::Undefined), | 154 unhandled_keyboard_event_type_(WebInputEvent::Undefined), |
| 155 unresponsive_timer_fired_(false) { | 155 unresponsive_timer_fired_(false) { |
| 156 } | 156 } |
| 157 | 157 |
| 158 // Tests that make sure we ignore keyboard event acknowledgments to events we | 158 // Tests that make sure we ignore keyboard event acknowledgments to events we |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 // Start it again to ensure it still works. | 746 // Start it again to ensure it still works. |
| 747 EXPECT_FALSE(host_->unresponsive_timer_fired()); | 747 EXPECT_FALSE(host_->unresponsive_timer_fired()); |
| 748 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); | 748 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); |
| 749 | 749 |
| 750 // Wait long enough for first timeout and see if it fired. | 750 // Wait long enough for first timeout and see if it fired. |
| 751 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 751 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 752 new MessageLoop::QuitTask(), 40); | 752 new MessageLoop::QuitTask(), 40); |
| 753 MessageLoop::current()->Run(); | 753 MessageLoop::current()->Run(); |
| 754 EXPECT_TRUE(host_->unresponsive_timer_fired()); | 754 EXPECT_TRUE(host_->unresponsive_timer_fired()); |
| 755 } | 755 } |
| OLD | NEW |