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

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

Issue 9021046: Pass const gfx::Rect& as the first parameter to FillRect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: one more fix Created 8 years, 10 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/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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 scoped_ptr<RenderWidgetHostView> view( 431 scoped_ptr<RenderWidgetHostView> view(
432 RenderWidgetHostView::CreateViewForWidget(host_.get())); 432 RenderWidgetHostView::CreateViewForWidget(host_.get()));
433 #if defined(USE_AURA) 433 #if defined(USE_AURA)
434 // TODO(derat): Call this on all platforms: http://crbug.com/102450. 434 // TODO(derat): Call this on all platforms: http://crbug.com/102450.
435 static_cast<RenderWidgetHostViewAura*>(view.get())->InitAsChild(NULL); 435 static_cast<RenderWidgetHostViewAura*>(view.get())->InitAsChild(NULL);
436 #endif 436 #endif
437 host_->SetView(view.get()); 437 host_->SetView(view.get());
438 438
439 // Create a checkerboard background to test with. 439 // Create a checkerboard background to test with.
440 gfx::CanvasSkia canvas(gfx::Size(4, 4), true); 440 gfx::CanvasSkia canvas(gfx::Size(4, 4), true);
441 canvas.FillRect(SK_ColorBLACK, gfx::Rect(0, 0, 2, 2)); 441 canvas.FillRect(gfx::Rect(0, 0, 2, 2), SK_ColorBLACK);
442 canvas.FillRect(SK_ColorWHITE, gfx::Rect(2, 0, 2, 2)); 442 canvas.FillRect(gfx::Rect(2, 0, 2, 2), SK_ColorWHITE);
443 canvas.FillRect(SK_ColorWHITE, gfx::Rect(0, 2, 2, 2)); 443 canvas.FillRect(gfx::Rect(0, 2, 2, 2), SK_ColorWHITE);
444 canvas.FillRect(SK_ColorBLACK, gfx::Rect(2, 2, 2, 2)); 444 canvas.FillRect(gfx::Rect(2, 2, 2, 2), SK_ColorBLACK);
445 const SkBitmap& background = 445 const SkBitmap& background =
446 canvas.sk_canvas()->getDevice()->accessBitmap(false); 446 canvas.sk_canvas()->getDevice()->accessBitmap(false);
447 447
448 // Set the background and make sure we get back a copy. 448 // Set the background and make sure we get back a copy.
449 view->SetBackground(background); 449 view->SetBackground(background);
450 EXPECT_EQ(4, view->background().width()); 450 EXPECT_EQ(4, view->background().width());
451 EXPECT_EQ(4, view->background().height()); 451 EXPECT_EQ(4, view->background().height());
452 EXPECT_EQ(background.getSize(), view->background().getSize()); 452 EXPECT_EQ(background.getSize(), view->background().getSize());
453 EXPECT_TRUE(0 == memcmp(background.getPixels(), 453 EXPECT_TRUE(0 == memcmp(background.getPixels(),
454 view->background().getPixels(), 454 view->background().getPixels(),
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); 759 SimulateKeyboardEvent(WebInputEvent::RawKeyDown);
760 SimulateKeyboardEvent(WebInputEvent::RawKeyDown); 760 SimulateKeyboardEvent(WebInputEvent::RawKeyDown);
761 SendInputEventACK(WebInputEvent::RawKeyDown, true); 761 SendInputEventACK(WebInputEvent::RawKeyDown, true);
762 762
763 // Wait long enough for first timeout and see if it fired. 763 // Wait long enough for first timeout and see if it fired.
764 MessageLoop::current()->PostDelayedTask(FROM_HERE, 764 MessageLoop::current()->PostDelayedTask(FROM_HERE,
765 MessageLoop::QuitClosure(), 40); 765 MessageLoop::QuitClosure(), 40);
766 MessageLoop::current()->Run(); 766 MessageLoop::current()->Run();
767 EXPECT_TRUE(host_->unresponsive_timer_fired()); 767 EXPECT_TRUE(host_->unresponsive_timer_fired());
768 } 768 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/wrench_menu.cc ('k') | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698