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

Side by Side Diff: ui/base/resource/resource_bundle_unittest.cc

Issue 277773002: Add ImageSkiaRep::unscaled that tells if the image is for unscaled image. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « ui/base/resource/resource_bundle.cc ('k') | ui/gfx/image/image_skia.cc » ('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 "ui/base/resource/resource_bundle.h" 5 #include "ui/base/resource/resource_bundle.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/big_endian.h" 8 #include "base/big_endian.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 572
573 // Create the pak files. 573 // Create the pak files.
574 CreateDataPackWithSingleBitmap(data_default_path, 10, base::StringPiece()); 574 CreateDataPackWithSingleBitmap(data_default_path, 10, base::StringPiece());
575 575
576 // Load the regular pak files only. 576 // Load the regular pak files only.
577 ResourceBundle* resource_bundle = CreateResourceBundleWithEmptyLocalePak(); 577 ResourceBundle* resource_bundle = CreateResourceBundleWithEmptyLocalePak();
578 resource_bundle->AddDataPackFromPath(data_default_path, SCALE_FACTOR_NONE); 578 resource_bundle->AddDataPackFromPath(data_default_path, SCALE_FACTOR_NONE);
579 579
580 gfx::ImageSkia* image_skia = resource_bundle->GetImageSkiaNamed(3); 580 gfx::ImageSkia* image_skia = resource_bundle->GetImageSkiaNamed(3);
581 EXPECT_EQ(1u, image_skia->image_reps().size()); 581 EXPECT_EQ(1u, image_skia->image_reps().size());
582 EXPECT_TRUE(image_skia->image_reps()[0].unscaled());
582 EXPECT_EQ(ui::SCALE_FACTOR_100P, 583 EXPECT_EQ(ui::SCALE_FACTOR_100P,
583 GetSupportedScaleFactor(image_skia->image_reps()[0].scale())); 584 GetSupportedScaleFactor(image_skia->image_reps()[0].scale()));
584 } 585 }
585 586
586 } // namespace ui 587 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | ui/gfx/image/image_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698