Chromium Code Reviews| Index: chrome/browser/extensions/extension_icon_manager_unittest.cc |
| diff --git a/chrome/browser/extensions/extension_icon_manager_unittest.cc b/chrome/browser/extensions/extension_icon_manager_unittest.cc |
| index 623ae0b0877f067a36c699ab587734d4d252f000..e297ffcd75efee614f7728664c1205789e624404 100644 |
| --- a/chrome/browser/extensions/extension_icon_manager_unittest.cc |
| +++ b/chrome/browser/extensions/extension_icon_manager_unittest.cc |
| @@ -2,6 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "base/command_line.h" |
| #include "base/json/json_file_value_serializer.h" |
| #include "base/macros.h" |
| #include "base/memory/ptr_util.h" |
| @@ -18,6 +19,8 @@ |
| #include "extensions/common/extension.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| #include "ui/base/layout.h" |
| +#include "ui/display/display_switches.h" |
| +#include "ui/display/test/test_screen.h" |
| #include "ui/gfx/favicon_size.h" |
| #include "ui/gfx/image/image.h" |
| #include "ui/gfx/image/image_skia.h" |
| @@ -272,6 +275,19 @@ TEST_F(ExtensionIconManagerTest, ScaleFactors) { |
| EXPECT_EQ(ui::IsSupportedScale(scale), has_representation); |
| } |
| } |
| + |
| + // Now check that the DSFs for active displays are respected. |
|
Devlin
2017/01/09 21:58:33
we should say what a dsf is here, since I don't th
|
| + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| + switches::kForceDeviceScaleFactor, "1.5"); |
| + display::test::TestScreen test_screen; |
| + display::Screen::SetScreenInstance(&test_screen); |
| + TestIconManager icon_manager(this); |
| + |
| + icon_manager.LoadIcon(profile.get(), extension.get()); |
| + WaitForImageLoad(); |
| + gfx::ImageSkia icon = icon_manager.GetIcon(extension->id()).AsImageSkia(); |
| + EXPECT_TRUE(icon.HasRepresentation(1.5f)); |
| + display::Screen::SetScreenInstance(nullptr); |
| } |
| } // namespace |