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

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

Issue 9835004: Call SkBitmap::lockPixels() prior to SkPicture::getPixels() to ensure that correct pointer is retur… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b56d4fea2181f552dfb16361f227743852901d22..d4d7fdd3abe5fb7a93dd058fd170a4a4027141fd 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -467,9 +467,13 @@ TEST_F(RenderWidgetHostTest, Background) {
EXPECT_EQ(4, view->GetBackground().width());
EXPECT_EQ(4, view->GetBackground().height());
EXPECT_EQ(background.getSize(), view->GetBackground().getSize());
+ background.lockPixels();
+ view->GetBackground().lockPixels();
EXPECT_TRUE(0 == memcmp(background.getPixels(),
view->GetBackground().getPixels(),
background.getSize()));
+ view->GetBackground().unlockPixels();
+ background.unlockPixels();
const IPC::Message* set_background =
process_->sink().GetUniqueMessageMatching(ViewMsg_SetBackground::ID);
@@ -477,9 +481,13 @@ TEST_F(RenderWidgetHostTest, Background) {
Tuple1<SkBitmap> sent_background;
ViewMsg_SetBackground::Read(set_background, &sent_background);
EXPECT_EQ(background.getSize(), sent_background.a.getSize());
+ background.lockPixels();
+ sent_background.a.lockPixels();
EXPECT_TRUE(0 == memcmp(background.getPixels(),
sent_background.a.getPixels(),
background.getSize()));
+ sent_background.a.unlockPixels();
+ background.unlockPixels();
#if defined(OS_LINUX) || defined(USE_AURA)
// See the comment above |InitAsChild(NULL)|.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698