summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-24 19:29:05 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-24 19:29:05 +0000
commit7aa4286f9a94b542e602ae08188c5dd4feb16880 (patch)
tree5f1f789dff9304403ded5ac4f07449a75295c4cd /chrome
parentac97c48bbe9ab3f77efcd4ec0fa51fc1628842f2 (diff)
downloadchromium_src-7aa4286f9a94b542e602ae08188c5dd4feb16880.zip
chromium_src-7aa4286f9a94b542e602ae08188c5dd4feb16880.tar.gz
chromium_src-7aa4286f9a94b542e602ae08188c5dd4feb16880.tar.bz2
Reverting 19131.
Review URL: http://codereview.chromium.org/147095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19154 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/webdata/web_database_unittest.cc20
1 files changed, 6 insertions, 14 deletions
diff --git a/chrome/browser/webdata/web_database_unittest.cc b/chrome/browser/webdata/web_database_unittest.cc
index a2ac50d..5076fc2 100644
--- a/chrome/browser/webdata/web_database_unittest.cc
+++ b/chrome/browser/webdata/web_database_unittest.cc
@@ -641,16 +641,8 @@ TEST_F(WebDatabaseTest, WebAppImages) {
image.setConfig(SkBitmap::kARGB_8888_Config, 16, 16);
image.allocPixels();
image.eraseColor(SK_ColorBLACK);
-
- // Set some random pixels so that we can identify the image. We don't use
- // transparent images because of pre-multiplication rounding errors.
- SkColor test_pixel_1 = 0xffccbbaa;
- SkColor test_pixel_2 = 0x00aabbaa;
- SkColor test_pixel_3 = 0xff339966;
- image.getAddr32(0, 1)[0] = test_pixel_1;
- image.getAddr32(0, 1)[1] = test_pixel_2;
- image.getAddr32(0, 1)[2] = test_pixel_3;
-
+ // Some random pixels so that we can identify the image.
+ *(reinterpret_cast<unsigned char*>(image.getPixels())) = 0xAB;
ASSERT_TRUE(db.SetWebAppImage(url, image));
images.clear();
ASSERT_TRUE(db.GetWebAppImages(url, &images));
@@ -658,10 +650,10 @@ TEST_F(WebDatabaseTest, WebAppImages) {
ASSERT_EQ(16, images[0].width());
ASSERT_EQ(16, images[0].height());
images[0].lockPixels();
- ASSERT_TRUE(images[0].getPixels() != NULL);
- ASSERT_EQ(test_pixel_1, images[0].getAddr32(0, 1)[0]);
- ASSERT_EQ(test_pixel_2, images[0].getAddr32(0, 1)[1]);
- ASSERT_EQ(test_pixel_3, images[0].getAddr32(0, 1)[2]);
+ unsigned char* pixels =
+ reinterpret_cast<unsigned char*>(images[0].getPixels());
+ ASSERT_TRUE(pixels != NULL);
+ ASSERT_EQ(0xAB, *pixels);
images[0].unlockPixels();
// Add another image at a bigger size.