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

Unified Diff: chrome/browser/extensions/extension_icon_manager_unittest.cc

Issue 2609853003: Load extension icons for more scale factors. (Closed)
Patch Set: more floats Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « no previous file | extensions/browser/extension_icon_image.h » ('j') | extensions/browser/extension_icon_image.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698