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

Unified Diff: content/browser/renderer_host/render_widget_host_view_browsertest.cc

Issue 293563002: GetScaleFactorForNativeView should return scale factor in float (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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: content/browser/renderer_host/render_widget_host_view_browsertest.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_browsertest.cc
index d987b2a4a4c699f5a7d163f8c55263753fe80b91..2a549850cccc38877d12233648b026f0aee01b7a 100644
--- a/content/browser/renderer_host/render_widget_host_view_browsertest.cc
+++ b/content/browser/renderer_host/render_widget_host_view_browsertest.cc
@@ -27,6 +27,7 @@
#include "net/base/filename_util.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
+#include "ui/base/layout.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gfx/size_conversions.h"
#include "ui/gfx/switches.h"
@@ -54,16 +55,6 @@ namespace {
return; \
}
-// Convenience macro: Short-circuit a pass for platforms where setting up
-// high-DPI fails.
-#define PASS_TEST_IF_SCALE_FACTOR_NOT_SUPPORTED(factor) \
- if (ui::GetScaleForScaleFactor( \
- GetScaleFactorForView(GetRenderWidgetHostView())) != factor) { \
- LOG(WARNING) << "Blindly passing this test: failed to set up " \
- "scale factor: " << factor; \
- return false; \
- }
-
// Common base class for browser tests. This is subclassed twice: Once to test
// the browser in forced-compositing mode, and once to test with compositing
// mode disabled.
@@ -810,7 +801,13 @@ class CompositingRenderWidgetHostViewTabCaptureHighDPI
private:
virtual bool ShouldContinueAfterTestURLLoad() OVERRIDE {
- PASS_TEST_IF_SCALE_FACTOR_NOT_SUPPORTED(scale());
+ // Short-circuit a pass for platforms where setting up high-DPI fails.
+ if (ui::GetScaleForScaleFactor(ui::GetSupportedScaleFactor(
+ GetScaleFactorForView(GetRenderWidgetHostView()))) != scale()) {
+ LOG(WARNING) << "Blindly passing this test: failed to set up "
+ "scale factor: " << scale();
+ return false;
+ }
return true;
}
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698