OLD | NEW |
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/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/ref_counted_memory.h" | 13 #include "base/memory/ref_counted_memory.h" |
14 #include "base/path_service.h" | |
15 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
16 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "third_party/skia/include/core/SkBitmap.h" | 17 #include "third_party/skia/include/core/SkBitmap.h" |
19 #include "ui/base/layout.h" | 18 #include "ui/base/layout.h" |
20 #include "ui/base/resource/data_pack.h" | 19 #include "ui/base/resource/data_pack.h" |
21 #include "ui/gfx/codec/png_codec.h" | 20 #include "ui/gfx/codec/png_codec.h" |
22 #include "ui/gfx/image/image_skia.h" | 21 #include "ui/gfx/image/image_skia.h" |
23 #include "ui/resources/grit/ui_resources.h" | 22 #include "ui/resources/grit/ui_resources.h" |
24 | 23 |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 resource_bundle->AddDataPackFromPath(data_default_path, SCALE_FACTOR_NONE); | 616 resource_bundle->AddDataPackFromPath(data_default_path, SCALE_FACTOR_NONE); |
618 | 617 |
619 gfx::ImageSkia* image_skia = resource_bundle->GetImageSkiaNamed(3); | 618 gfx::ImageSkia* image_skia = resource_bundle->GetImageSkiaNamed(3); |
620 EXPECT_EQ(1u, image_skia->image_reps().size()); | 619 EXPECT_EQ(1u, image_skia->image_reps().size()); |
621 EXPECT_TRUE(image_skia->image_reps()[0].unscaled()); | 620 EXPECT_TRUE(image_skia->image_reps()[0].unscaled()); |
622 EXPECT_EQ(ui::SCALE_FACTOR_100P, | 621 EXPECT_EQ(ui::SCALE_FACTOR_100P, |
623 GetSupportedScaleFactor(image_skia->image_reps()[0].scale())); | 622 GetSupportedScaleFactor(image_skia->image_reps()[0].scale())); |
624 } | 623 } |
625 | 624 |
626 } // namespace ui | 625 } // namespace ui |
OLD | NEW |