Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: trunk/src/content/browser/renderer_host/render_widget_host_unittest.cc

Issue 24262008: Revert 224473 "Remove dependency on ui::ScaleFactor from ui/gfx" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/bind.h" 6 #include "base/bind.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "content/browser/browser_thread_impl.h" 10 #include "content/browser/browser_thread_impl.h"
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 // TODO(derat): Call this on all platforms: http://crbug.com/102450. 983 // TODO(derat): Call this on all platforms: http://crbug.com/102450.
984 // InitAsChild doesn't seem to work if NULL parent is passed on Windows, 984 // InitAsChild doesn't seem to work if NULL parent is passed on Windows,
985 // which leads to DCHECK failure in RenderWidgetHostView::Destroy. 985 // which leads to DCHECK failure in RenderWidgetHostView::Destroy.
986 // When you enable this for OS_WIN, enable |view.release()->Destroy()| 986 // When you enable this for OS_WIN, enable |view.release()->Destroy()|
987 // below. 987 // below.
988 view->InitAsChild(NULL); 988 view->InitAsChild(NULL);
989 #endif 989 #endif
990 host_->SetView(view.get()); 990 host_->SetView(view.get());
991 991
992 // Create a checkerboard background to test with. 992 // Create a checkerboard background to test with.
993 gfx::Canvas canvas(gfx::Size(4, 4), 1.0f, true); 993 gfx::Canvas canvas(gfx::Size(4, 4), ui::SCALE_FACTOR_100P, true);
994 canvas.FillRect(gfx::Rect(0, 0, 2, 2), SK_ColorBLACK); 994 canvas.FillRect(gfx::Rect(0, 0, 2, 2), SK_ColorBLACK);
995 canvas.FillRect(gfx::Rect(2, 0, 2, 2), SK_ColorWHITE); 995 canvas.FillRect(gfx::Rect(2, 0, 2, 2), SK_ColorWHITE);
996 canvas.FillRect(gfx::Rect(0, 2, 2, 2), SK_ColorWHITE); 996 canvas.FillRect(gfx::Rect(0, 2, 2, 2), SK_ColorWHITE);
997 canvas.FillRect(gfx::Rect(2, 2, 2, 2), SK_ColorBLACK); 997 canvas.FillRect(gfx::Rect(2, 2, 2, 2), SK_ColorBLACK);
998 const SkBitmap& background = 998 const SkBitmap& background =
999 canvas.sk_canvas()->getDevice()->accessBitmap(false); 999 canvas.sk_canvas()->getDevice()->accessBitmap(false);
1000 1000
1001 // Set the background and make sure we get back a copy. 1001 // Set the background and make sure we get back a copy.
1002 view->SetBackground(background); 1002 view->SetBackground(background);
1003 EXPECT_EQ(4, view->GetBackground().width()); 1003 EXPECT_EQ(4, view->GetBackground().width());
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
2581 2581
2582 TEST_F(RenderWidgetHostTest, InputRouterReceivesHasTouchEventHandlers) { 2582 TEST_F(RenderWidgetHostTest, InputRouterReceivesHasTouchEventHandlers) {
2583 host_->SetupForInputRouterTest(); 2583 host_->SetupForInputRouterTest();
2584 2584
2585 host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, true)); 2585 host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, true));
2586 2586
2587 EXPECT_TRUE(host_->mock_input_router()->message_received_); 2587 EXPECT_TRUE(host_->mock_input_router()->message_received_);
2588 } 2588 }
2589 2589
2590 } // namespace content 2590 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698