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

Side by Side Diff: chrome/browser/extensions/extension_icon_image_unittest.cc

Issue 263253003: Allows arbitrary scale factor in ImageSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 7 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 | « no previous file | ui/gfx/image/image_skia.h » ('j') | 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 "chrome/browser/extensions/extension_icon_image.h" 5 #include "chrome/browser/extensions/extension_icon_image.h"
6 6
7 #include "base/json/json_file_value_serializer.h" 7 #include "base/json/json_file_value_serializer.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "chrome/browser/extensions/image_loader.h" 10 #include "chrome/browser/extensions/image_loader.h"
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 image.reset(); 556 image.reset();
557 extension = NULL; 557 extension = NULL;
558 558
559 // Image skia should still be able to get previously loaded representation. 559 // Image skia should still be able to get previously loaded representation.
560 representation = image_skia.GetRepresentation(1.0f); 560 representation = image_skia.GetRepresentation(1.0f);
561 561
562 EXPECT_EQ(1.0f, representation.scale()); 562 EXPECT_EQ(1.0f, representation.scale());
563 EXPECT_EQ(16, representation.pixel_width()); 563 EXPECT_EQ(16, representation.pixel_width());
564 EXPECT_TRUE(gfx::BitmapsAreEqual(representation.sk_bitmap(), bitmap_16)); 564 EXPECT_TRUE(gfx::BitmapsAreEqual(representation.sk_bitmap(), bitmap_16));
565 565
566 // When requesting another representation, we should get blank image. 566 // When requesting another representation, we should not crash and return some
567 // image of the size. It could be blank or a rescale from the existing 1.0f
568 // icon.
567 representation = image_skia.GetRepresentation(2.0f); 569 representation = image_skia.GetRepresentation(2.0f);
568 570
569 EXPECT_TRUE(gfx::BitmapsAreEqual( 571 EXPECT_EQ(16, representation.GetWidth());
570 representation.sk_bitmap(), 572 EXPECT_EQ(16, representation.GetHeight());
571 CreateBlankBitmapForScale(16, ui::SCALE_FACTOR_200P))); 573 EXPECT_EQ(2.0f, representation.scale());
572 } 574 }
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/image/image_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698