Index: components/test_runner/test_runner.cc |
diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc |
index ce011c06ba33822b5a1b3aef43c883ecd1aa4c91..f4b034a9f2fb4136e2f4e4c5778c925b4d6960b7 100644 |
--- a/components/test_runner/test_runner.cc |
+++ b/components/test_runner/test_runner.cc |
@@ -8,8 +8,10 @@ |
#include <limits> |
#include <utility> |
+#include "base/command_line.h" |
#include "base/logging.h" |
#include "base/macros.h" |
+#include "base/strings/string_number_conversions.h" |
#include "base/strings/stringprintf.h" |
#include "build/build_config.h" |
#include "components/test_runner/mock_credential_manager_client.h" |
@@ -56,6 +58,7 @@ |
#include "ui/gfx/geometry/rect_f.h" |
#include "ui/gfx/geometry/size.h" |
#include "ui/gfx/skia_util.h" |
+#include "ui/gfx/switches.h" |
#if defined(__linux__) || defined(ANDROID) |
#include "third_party/WebKit/public/web/linux/WebFontRendering.h" |
@@ -1701,7 +1704,15 @@ void TestRunner::Reset() { |
// Reset the default quota for each origin to 5MB |
delegate_->SetDatabaseQuota(5 * 1024 * 1024); |
delegate_->SetDeviceColorProfile("reset"); |
- delegate_->SetDeviceScaleFactor(1); |
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
Noel Gordon
2016/01/09 03:23:51
Define a static TestRuner::deviceScaleFactorForTes
oshima
2016/01/11 18:52:12
I defined a utility function in anonymous namespac
|
+ double scale = 1; |
+ if (command_line->HasSwitch(switches::kForceDeviceScaleFactor)) { |
+ std::string value = |
+ command_line->GetSwitchValueASCII(switches::kForceDeviceScaleFactor); |
+ if (!base::StringToDouble(value, &scale)) |
+ scale = 1; |
+ } |
+ delegate_->SetDeviceScaleFactor(scale); |
delegate_->SetAcceptAllCookies(false); |
delegate_->SetLocale(""); |
delegate_->UseUnfortunateSynchronousResizeMode(false); |