| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/manifest/manifest_icon_downloader.h" | 5 #include "chrome/browser/manifest/manifest_icon_downloader.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 12 |
| 12 class ManifestIconDownloaderTest : public testing::Test { | 13 class ManifestIconDownloaderTest : public testing::Test { |
| 13 protected: | 14 protected: |
| 14 ManifestIconDownloaderTest() = default; | 15 ManifestIconDownloaderTest() = default; |
| 15 ~ManifestIconDownloaderTest() override = default; | 16 ~ManifestIconDownloaderTest() override = default; |
| 16 | 17 |
| 17 int FindBitmap(const int ideal_icon_size_in_px, | 18 int FindBitmap(const int ideal_icon_size_in_px, |
| 18 const int minimum_icon_size_in_px, | 19 const int minimum_icon_size_in_px, |
| 19 const std::vector<SkBitmap>& bitmaps) { | 20 const std::vector<SkBitmap>& bitmaps) { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 ASSERT_EQ(1, FindBitmap(35, 0, bitmaps)); | 132 ASSERT_EQ(1, FindBitmap(35, 0, bitmaps)); |
| 132 } | 133 } |
| 133 | 134 |
| 134 TEST_F(ManifestIconDownloaderTest, NonSquareBelowMinimumIsNotPicked) { | 135 TEST_F(ManifestIconDownloaderTest, NonSquareBelowMinimumIsNotPicked) { |
| 135 std::vector<SkBitmap> bitmaps; | 136 std::vector<SkBitmap> bitmaps; |
| 136 bitmaps.push_back(CreateDummyBitmap(10, 15)); | 137 bitmaps.push_back(CreateDummyBitmap(10, 15)); |
| 137 bitmaps.push_back(CreateDummyBitmap(15, 10)); | 138 bitmaps.push_back(CreateDummyBitmap(15, 10)); |
| 138 | 139 |
| 139 ASSERT_EQ(-1, FindBitmap(15, 11, bitmaps)); | 140 ASSERT_EQ(-1, FindBitmap(15, 11, bitmaps)); |
| 140 } | 141 } |
| OLD | NEW |