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

Unified Diff: content/browser/renderer_host/input/web_input_event_unittest.cc

Issue 2234023002: Refactor WebInputEventAura to ui/events/blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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/input/web_input_event_unittest.cc
diff --git a/content/browser/renderer_host/input/web_input_event_unittest.cc b/content/browser/renderer_host/input/web_input_event_unittest.cc
deleted file mode 100644
index f1cbb0e98301adbff5d7a5cfc76a544644b6e0dd..0000000000000000000000000000000000000000
--- a/content/browser/renderer_host/input/web_input_event_unittest.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// 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 "build/build_config.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/WebKit/public/web/WebInputEvent.h"
-#include "ui/display/display.h"
-#include "ui/display/display_switches.h"
-#include "ui/events/event_constants.h"
-
-#if defined(OS_WIN)
-#include "base/win/windows_version.h"
-#include "content/browser/renderer_host/input/web_input_event_builders_win.h"
-#endif
-
-using blink::WebMouseEvent;
-using blink::WebMouseWheelEvent;
-
-namespace content {
-
-#if defined(OS_WIN)
-// This test validates that Pixel to DIP conversion occurs as needed in the
-// WebMouseEventBuilder::Build function.
-TEST(WebInputEventBuilderTest, TestMouseEventScale) {
- if (base::win::GetVersion() < base::win::VERSION_WIN7)
- return;
-
- display::Display::ResetForceDeviceScaleFactorForTesting();
-
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, "2");
-
- // Synthesize a mouse move with x = 300 and y = 200.
- WebMouseEvent mouse_move = WebMouseEventBuilder::Build(
- ::GetDesktopWindow(), WM_MOUSEMOVE, 0, MAKELPARAM(300, 200), 100,
- blink::WebPointerProperties::PointerType::Mouse);
-
- // The WebMouseEvent.x, WebMouseEvent.y, WebMouseEvent.windowX and
- // WebMouseEvent.windowY fields should be in pixels on return and hence
- // should be the same value as the x and y coordinates passed in to the
- // WebMouseEventBuilder::Build function.
- EXPECT_EQ(300, mouse_move.x);
- EXPECT_EQ(200, mouse_move.y);
-
- EXPECT_EQ(300, mouse_move.windowX);
- EXPECT_EQ(200, mouse_move.windowY);
-
- // WebMouseEvent.globalX and WebMouseEvent.globalY are calculated in DIPs.
- EXPECT_EQ(150, mouse_move.globalX);
- EXPECT_EQ(100, mouse_move.globalY);
-
- EXPECT_EQ(blink::WebPointerProperties::PointerType::Mouse,
- mouse_move.pointerType);
-
- command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, "1");
- display::Display::ResetForceDeviceScaleFactorForTesting();
-}
-#endif
-
-} // namespace content

Powered by Google App Engine
This is Rietveld 408576698