OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/icon_util.h" | 5 #include "ui/gfx/icon_util.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 HMODULE module = GetModuleHandle(NULL); | 410 HMODULE module = GetModuleHandle(NULL); |
411 scoped_ptr<gfx::ImageFamily> family( | 411 scoped_ptr<gfx::ImageFamily> family( |
412 IconUtil::CreateImageFamilyFromIconResource(module, IDR_MAINFRAME)); | 412 IconUtil::CreateImageFamilyFromIconResource(module, IDR_MAINFRAME)); |
413 ASSERT_TRUE(family.get()); | 413 ASSERT_TRUE(family.get()); |
414 EXPECT_FALSE(family->empty()); | 414 EXPECT_FALSE(family->empty()); |
415 std::vector<gfx::Image> images; | 415 std::vector<gfx::Image> images; |
416 for (const auto& image : *family) | 416 for (const auto& image : *family) |
417 images.push_back(image); | 417 images.push_back(image); |
418 | 418 |
419 // Assert that the family contains all of the images from the icon resource. | 419 // Assert that the family contains all of the images from the icon resource. |
420 EXPECT_EQ(5, images.size()); | 420 EXPECT_EQ(5u, images.size()); |
421 EXPECT_EQ(16, images[0].Width()); | 421 EXPECT_EQ(16, images[0].Width()); |
422 EXPECT_EQ(24, images[1].Width()); | 422 EXPECT_EQ(24, images[1].Width()); |
423 EXPECT_EQ(32, images[2].Width()); | 423 EXPECT_EQ(32, images[2].Width()); |
424 EXPECT_EQ(48, images[3].Width()); | 424 EXPECT_EQ(48, images[3].Width()); |
425 EXPECT_EQ(256, images[4].Width()); | 425 EXPECT_EQ(256, images[4].Width()); |
426 } | 426 } |
427 | 427 |
428 // This tests that kNumIconDimensionsUpToMediumSize has the correct value. | 428 // This tests that kNumIconDimensionsUpToMediumSize has the correct value. |
429 TEST_F(IconUtilTest, TestNumIconDimensionsUpToMediumSize) { | 429 TEST_F(IconUtilTest, TestNumIconDimensionsUpToMediumSize) { |
430 ASSERT_LE(IconUtil::kNumIconDimensionsUpToMediumSize, | 430 ASSERT_LE(IconUtil::kNumIconDimensionsUpToMediumSize, |
431 IconUtil::kNumIconDimensions); | 431 IconUtil::kNumIconDimensions); |
432 EXPECT_EQ(IconUtil::kMediumIconSize, | 432 EXPECT_EQ(IconUtil::kMediumIconSize, |
433 IconUtil::kIconDimensions[ | 433 IconUtil::kIconDimensions[ |
434 IconUtil::kNumIconDimensionsUpToMediumSize - 1]); | 434 IconUtil::kNumIconDimensionsUpToMediumSize - 1]); |
435 } | 435 } |
OLD | NEW |