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

Unified Diff: content/browser/renderer_host/render_widget_host_unittest.cc

Issue 10905036: Pepper Flash Mac: Fix crash when playing video on MB retina (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add test Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_unittest.cc
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index f6bb1084ff210c440c59a5a89af27a3a772275c5..e58133d150ef5e6c0fe661b8c6876e5081c99fd1 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -83,7 +83,7 @@ class RenderWidgetHostProcess : public MockRenderProcessHost {
// message reply. False implies timeout.
bool update_msg_should_reply_;
- // Indicates the flags that should be sent with a the repaint request. This
+ // Indicates the flags that should be sent with a repaint request. This
// only has an effect when update_msg_should_reply_ is true.
int update_msg_reply_flags_;
@@ -106,6 +106,7 @@ void RenderWidgetHostProcess::InitUpdateRectParams(
params->view_size = gfx::Size(w, h);
params->flags = update_msg_reply_flags_;
params->needs_ack = true;
+ params->scale_factor = 1;
}
bool RenderWidgetHostProcess::WaitForBackingStoreMsg(
@@ -1091,3 +1092,13 @@ TEST_F(RenderWidgetHostTest, MultipleInputEvents) {
MessageLoop::current()->Run();
EXPECT_TRUE(host_->unresponsive_timer_fired());
}
+
+TEST_F(RenderWidgetHostTest, IncorrectBitmapScaleFactor) {
+ ViewHostMsg_UpdateRect_Params params;
+ process_->InitUpdateRectParams(&params);
+ params.scale_factor = params.scale_factor * 2;
+
+ EXPECT_EQ(0, process_->bad_msg_count());
+ host_->OnMsgUpdateRect(params);
+ EXPECT_EQ(1, process_->bad_msg_count());
+}

Powered by Google App Engine
This is Rietveld 408576698