| 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 "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/test/testing_profile.h" | 10 #include "chrome/test/testing_profile.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); | 420 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); |
| 421 EXPECT_FALSE(host_->resize_ack_pending_); | 421 EXPECT_FALSE(host_->resize_ack_pending_); |
| 422 EXPECT_EQ(gfx::Size(), host_->in_flight_size_); | 422 EXPECT_EQ(gfx::Size(), host_->in_flight_size_); |
| 423 | 423 |
| 424 // Reset the view so we can exit the test cleanly. | 424 // Reset the view so we can exit the test cleanly. |
| 425 host_->set_view(view_.get()); | 425 host_->set_view(view_.get()); |
| 426 } | 426 } |
| 427 | 427 |
| 428 // Tests setting custom background | 428 // Tests setting custom background |
| 429 TEST_F(RenderWidgetHostTest, Background) { | 429 TEST_F(RenderWidgetHostTest, Background) { |
| 430 #if defined(OS_WIN) || defined(OS_LINUX) | 430 #if !defined(OS_MACOSX) |
| 431 scoped_ptr<RenderWidgetHostView> view( | 431 scoped_ptr<RenderWidgetHostView> view( |
| 432 RenderWidgetHostView::CreateViewForWidget(host_.get())); | 432 RenderWidgetHostView::CreateViewForWidget(host_.get())); |
| 433 host_->set_view(view.get()); | 433 host_->set_view(view.get()); |
| 434 | 434 |
| 435 // Create a checkerboard background to test with. | 435 // Create a checkerboard background to test with. |
| 436 gfx::CanvasSkia canvas(4, 4, true); | 436 gfx::CanvasSkia canvas(4, 4, true); |
| 437 canvas.FillRectInt(SK_ColorBLACK, 0, 0, 2, 2); | 437 canvas.FillRectInt(SK_ColorBLACK, 0, 0, 2, 2); |
| 438 canvas.FillRectInt(SK_ColorWHITE, 2, 0, 2, 2); | 438 canvas.FillRectInt(SK_ColorWHITE, 2, 0, 2, 2); |
| 439 canvas.FillRectInt(SK_ColorWHITE, 0, 2, 2, 2); | 439 canvas.FillRectInt(SK_ColorWHITE, 0, 2, 2, 2); |
| 440 canvas.FillRectInt(SK_ColorBLACK, 2, 2, 2, 2); | 440 canvas.FillRectInt(SK_ColorBLACK, 2, 2, 2, 2); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 // Start it again to ensure it still works. | 728 // Start it again to ensure it still works. |
| 729 EXPECT_FALSE(host_->unresponsive_timer_fired()); | 729 EXPECT_FALSE(host_->unresponsive_timer_fired()); |
| 730 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); | 730 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); |
| 731 | 731 |
| 732 // Wait long enough for first timeout and see if it fired. | 732 // Wait long enough for first timeout and see if it fired. |
| 733 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 733 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 734 new MessageLoop::QuitTask(), 10); | 734 new MessageLoop::QuitTask(), 10); |
| 735 MessageLoop::current()->Run(); | 735 MessageLoop::current()->Run(); |
| 736 EXPECT_TRUE(host_->unresponsive_timer_fired()); | 736 EXPECT_TRUE(host_->unresponsive_timer_fired()); |
| 737 } | 737 } |
| OLD | NEW |