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

Side by Side Diff: ui/gfx/image/image_skia_unittest.cc

Issue 10824296: Enables HiDPI favicon to be displayed in tab strip on CrOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/image/image_skia.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/gfx/image/image_skia.h" 5 #include "ui/gfx/image/image_skia.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "third_party/skia/include/core/SkBitmap.h" 8 #include "third_party/skia/include/core/SkBitmap.h"
9 #include "ui/base/layout.h" 9 #include "ui/base/layout.h"
10 #include "ui/gfx/image/image_skia_rep.h" 10 #include "ui/gfx/image/image_skia_rep.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 190
191 TEST(ImageSkiaTest, OperatorBitmapFromSource) { 191 TEST(ImageSkiaTest, OperatorBitmapFromSource) {
192 ImageSkia image_skia(new DynamicSource(Size(100, 200)), Size(100, 200)); 192 ImageSkia image_skia(new DynamicSource(Size(100, 200)), Size(100, 200));
193 // ImageSkia should use the source to create the bitmap. 193 // ImageSkia should use the source to create the bitmap.
194 const SkBitmap& bitmap = image_skia; 194 const SkBitmap& bitmap = image_skia;
195 ASSERT_NE(static_cast<SkBitmap*>(NULL), &bitmap); 195 ASSERT_NE(static_cast<SkBitmap*>(NULL), &bitmap);
196 EXPECT_FALSE(bitmap.isNull()); 196 EXPECT_FALSE(bitmap.isNull());
197 } 197 }
198 198
199 TEST(ImageSkiaTest, BackedBySameObjectAs) {
200 // Null images should all be backed by the same object (NULL).
201 ImageSkia image;
202 ImageSkia unrelated;
203 EXPECT_TRUE(image.BackedBySameObjectAs(unrelated));
204
205 image.AddRepresentation(gfx::ImageSkiaRep(gfx::Size(10, 10),
206 ui::SCALE_FACTOR_100P));
207 ImageSkia copy = image;
208 copy.AddRepresentation(gfx::ImageSkiaRep(gfx::Size(10, 10),
209 ui::SCALE_FACTOR_200P));
210 unrelated.AddRepresentation(gfx::ImageSkiaRep(gfx::Size(10, 10),
211 ui::SCALE_FACTOR_100P));
212 EXPECT_TRUE(image.BackedBySameObjectAs(copy));
213 EXPECT_FALSE(image.BackedBySameObjectAs(unrelated));
214 EXPECT_FALSE(copy.BackedBySameObjectAs(unrelated));
215 }
216
199 } // namespace gfx 217 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/image/image_skia.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698