| 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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 | 742 |
| 743 // Wait long enough for first timeout and see if it fired. | 743 // Wait long enough for first timeout and see if it fired. |
| 744 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 744 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 745 MessageLoop::QuitClosure(), 40); | 745 MessageLoop::QuitClosure(), 40); |
| 746 MessageLoop::current()->Run(); | 746 MessageLoop::current()->Run(); |
| 747 EXPECT_TRUE(host_->unresponsive_timer_fired()); | 747 EXPECT_TRUE(host_->unresponsive_timer_fired()); |
| 748 } | 748 } |
| 749 | 749 |
| 750 // Test that the hang monitor catches two input events but only one ack. | 750 // Test that the hang monitor catches two input events but only one ack. |
| 751 // This can happen if the second input event causes the renderer to hang. | 751 // This can happen if the second input event causes the renderer to hang. |
| 752 // This test will catch a regression of crbug.com/111185 and will only | 752 // This test will catch a regression of crbug.com/111185. |
| 753 // pass when the compositor thread is being used. | 753 TEST_F(RenderWidgetHostTest, MultipleInputEvents) { |
| 754 TEST_F(RenderWidgetHostTest, FAILS_MultipleInputEvents) { | |
| 755 // Configure the host to wait 10ms before considering | 754 // Configure the host to wait 10ms before considering |
| 756 // the renderer hung. | 755 // the renderer hung. |
| 757 host_->set_hung_renderer_delay_ms(10); | 756 host_->set_hung_renderer_delay_ms(10); |
| 758 | 757 |
| 759 // Send two events but only one ack. | 758 // Send two events but only one ack. |
| 760 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); | 759 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); |
| 761 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); | 760 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); |
| 762 SendInputEventACK(WebInputEvent::RawKeyDown, true); | 761 SendInputEventACK(WebInputEvent::RawKeyDown, true); |
| 763 | 762 |
| 764 // Wait long enough for first timeout and see if it fired. | 763 // Wait long enough for first timeout and see if it fired. |
| 765 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 764 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 766 MessageLoop::QuitClosure(), 40); | 765 MessageLoop::QuitClosure(), 40); |
| 767 MessageLoop::current()->Run(); | 766 MessageLoop::current()->Run(); |
| 768 EXPECT_TRUE(host_->unresponsive_timer_fired()); | 767 EXPECT_TRUE(host_->unresponsive_timer_fired()); |
| 769 } | 768 } |
| OLD | NEW |