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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 // TODO(derat): Call this on all platforms: http://crbug.com/102450. | 481 // TODO(derat): Call this on all platforms: http://crbug.com/102450. |
482 // InitAsChild doesn't seem to work if NULL parent is passed on Windows, | 482 // InitAsChild doesn't seem to work if NULL parent is passed on Windows, |
483 // which leads to DCHECK failure in RenderWidgetHostView::Destroy. | 483 // which leads to DCHECK failure in RenderWidgetHostView::Destroy. |
484 // When you enable this for OS_WIN, enable |view.release()->Destroy()| | 484 // When you enable this for OS_WIN, enable |view.release()->Destroy()| |
485 // below. | 485 // below. |
486 view->InitAsChild(NULL); | 486 view->InitAsChild(NULL); |
487 #endif | 487 #endif |
488 host_->SetView(view.get()); | 488 host_->SetView(view.get()); |
489 | 489 |
490 // Create a checkerboard background to test with. | 490 // Create a checkerboard background to test with. |
491 gfx::Canvas canvas(gfx::Size(4, 4), true); | 491 gfx::Canvas canvas(gfx::Size(4, 4), ui::SCALE_FACTOR_100P, true); |
492 canvas.FillRect(gfx::Rect(0, 0, 2, 2), SK_ColorBLACK); | 492 canvas.FillRect(gfx::Rect(0, 0, 2, 2), SK_ColorBLACK); |
493 canvas.FillRect(gfx::Rect(2, 0, 2, 2), SK_ColorWHITE); | 493 canvas.FillRect(gfx::Rect(2, 0, 2, 2), SK_ColorWHITE); |
494 canvas.FillRect(gfx::Rect(0, 2, 2, 2), SK_ColorWHITE); | 494 canvas.FillRect(gfx::Rect(0, 2, 2, 2), SK_ColorWHITE); |
495 canvas.FillRect(gfx::Rect(2, 2, 2, 2), SK_ColorBLACK); | 495 canvas.FillRect(gfx::Rect(2, 2, 2, 2), SK_ColorBLACK); |
496 const SkBitmap& background = | 496 const SkBitmap& background = |
497 canvas.sk_canvas()->getDevice()->accessBitmap(false); | 497 canvas.sk_canvas()->getDevice()->accessBitmap(false); |
498 | 498 |
499 // Set the background and make sure we get back a copy. | 499 // Set the background and make sure we get back a copy. |
500 view->SetBackground(background); | 500 view->SetBackground(background); |
501 EXPECT_EQ(4, view->GetBackground().width()); | 501 EXPECT_EQ(4, view->GetBackground().width()); |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); | 917 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); |
918 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); | 918 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); |
919 SendInputEventACK(WebInputEvent::RawKeyDown, true); | 919 SendInputEventACK(WebInputEvent::RawKeyDown, true); |
920 | 920 |
921 // Wait long enough for first timeout and see if it fired. | 921 // Wait long enough for first timeout and see if it fired. |
922 MessageLoop::current()->PostDelayedTask( | 922 MessageLoop::current()->PostDelayedTask( |
923 FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(40)); | 923 FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(40)); |
924 MessageLoop::current()->Run(); | 924 MessageLoop::current()->Run(); |
925 EXPECT_TRUE(host_->unresponsive_timer_fired()); | 925 EXPECT_TRUE(host_->unresponsive_timer_fired()); |
926 } | 926 } |
OLD | NEW |