OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/keyboard_codes.h" | 5 #include "app/keyboard_codes.h" |
6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
9 #include "base/timer.h" | 9 #include "base/timer.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 view_->set_bounds(original_size); | 390 view_->set_bounds(original_size); |
391 host_->WasResized(); | 391 host_->WasResized(); |
392 EXPECT_TRUE(host_->resize_ack_pending_); | 392 EXPECT_TRUE(host_->resize_ack_pending_); |
393 EXPECT_EQ(original_size.size(), host_->in_flight_size_); | 393 EXPECT_EQ(original_size.size(), host_->in_flight_size_); |
394 EXPECT_TRUE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID)); | 394 EXPECT_TRUE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID)); |
395 | 395 |
396 // Simulate a renderer crash before the update message. Ensure all the | 396 // Simulate a renderer crash before the update message. Ensure all the |
397 // resize ack logic is cleared. Must clear the view first so it doesn't get | 397 // resize ack logic is cleared. Must clear the view first so it doesn't get |
398 // deleted. | 398 // deleted. |
399 host_->set_view(NULL); | 399 host_->set_view(NULL); |
400 host_->RendererExited(); | 400 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); |
401 EXPECT_FALSE(host_->resize_ack_pending_); | 401 EXPECT_FALSE(host_->resize_ack_pending_); |
402 EXPECT_EQ(gfx::Size(), host_->in_flight_size_); | 402 EXPECT_EQ(gfx::Size(), host_->in_flight_size_); |
403 | 403 |
404 // Reset the view so we can exit the test cleanly. | 404 // Reset the view so we can exit the test cleanly. |
405 host_->set_view(view_.get()); | 405 host_->set_view(view_.get()); |
406 } | 406 } |
407 | 407 |
408 // Tests setting custom background | 408 // Tests setting custom background |
409 TEST_F(RenderWidgetHostTest, Background) { | 409 TEST_F(RenderWidgetHostTest, Background) { |
410 #if defined(OS_WIN) || defined(OS_LINUX) | 410 #if defined(OS_WIN) || defined(OS_LINUX) |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 // Start it again to ensure it still works. | 704 // Start it again to ensure it still works. |
705 EXPECT_FALSE(host_->unresponsive_timer_fired()); | 705 EXPECT_FALSE(host_->unresponsive_timer_fired()); |
706 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); | 706 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); |
707 | 707 |
708 // Wait long enough for first timeout and see if it fired. | 708 // Wait long enough for first timeout and see if it fired. |
709 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 709 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
710 new MessageLoop::QuitTask(), 10); | 710 new MessageLoop::QuitTask(), 10); |
711 MessageLoop::current()->Run(); | 711 MessageLoop::current()->Run(); |
712 EXPECT_TRUE(host_->unresponsive_timer_fired()); | 712 EXPECT_TRUE(host_->unresponsive_timer_fired()); |
713 } | 713 } |
OLD | NEW |