| OLD | NEW |
| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 InitUpdateRectParams(¶ms); | 109 InitUpdateRectParams(¶ms); |
| 110 | 110 |
| 111 ViewHostMsg_UpdateRect message(render_widget_id, params); | 111 ViewHostMsg_UpdateRect message(render_widget_id, params); |
| 112 *msg = message; | 112 *msg = message; |
| 113 return true; | 113 return true; |
| 114 } | 114 } |
| 115 | 115 |
| 116 // TestView -------------------------------------------------------------------- | 116 // TestView -------------------------------------------------------------------- |
| 117 | 117 |
| 118 // This test view allows us to specify the size. | 118 // This test view allows us to specify the size. |
| 119 class TestView : public TestRenderWidgetHostView { | 119 class TestView : public content::TestRenderWidgetHostView { |
| 120 public: | 120 public: |
| 121 explicit TestView(RenderWidgetHost* rwh) : TestRenderWidgetHostView(rwh) {} | 121 explicit TestView(RenderWidgetHost* rwh) |
| 122 : content::TestRenderWidgetHostView(rwh) { |
| 123 } |
| 122 | 124 |
| 123 // Sets the bounds returned by GetViewBounds. | 125 // Sets the bounds returned by GetViewBounds. |
| 124 void set_bounds(const gfx::Rect& bounds) { | 126 void set_bounds(const gfx::Rect& bounds) { |
| 125 bounds_ = bounds; | 127 bounds_ = bounds; |
| 126 } | 128 } |
| 127 | 129 |
| 128 // RenderWidgetHostView override. | 130 // RenderWidgetHostView override. |
| 129 virtual gfx::Rect GetViewBounds() const { | 131 virtual gfx::Rect GetViewBounds() const { |
| 130 return bounds_; | 132 return bounds_; |
| 131 } | 133 } |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); | 761 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); |
| 760 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); | 762 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); |
| 761 SendInputEventACK(WebInputEvent::RawKeyDown, true); | 763 SendInputEventACK(WebInputEvent::RawKeyDown, true); |
| 762 | 764 |
| 763 // Wait long enough for first timeout and see if it fired. | 765 // Wait long enough for first timeout and see if it fired. |
| 764 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 766 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 765 MessageLoop::QuitClosure(), 40); | 767 MessageLoop::QuitClosure(), 40); |
| 766 MessageLoop::current()->Run(); | 768 MessageLoop::current()->Run(); |
| 767 EXPECT_TRUE(host_->unresponsive_timer_fired()); | 769 EXPECT_TRUE(host_->unresponsive_timer_fired()); |
| 768 } | 770 } |
| OLD | NEW |