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

Side by Side Diff: content/test/layouttest_support.cc

Issue 2093343002: Scale the emulated event in EventSender when use-zoom-for-dsf is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Scale the emulated event in EventSender when use-zoom-for-dsf is enabled Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/test/layouttest_support.h" 5 #include "content/public/test/layouttest_support.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 16 matching lines...) Expand all
27 #include "content/renderer/history_serialization.h" 27 #include "content/renderer/history_serialization.h"
28 #include "content/renderer/layout_test_dependencies.h" 28 #include "content/renderer/layout_test_dependencies.h"
29 #include "content/renderer/render_frame_impl.h" 29 #include "content/renderer/render_frame_impl.h"
30 #include "content/renderer/render_thread_impl.h" 30 #include "content/renderer/render_thread_impl.h"
31 #include "content/renderer/render_view_impl.h" 31 #include "content/renderer/render_view_impl.h"
32 #include "content/renderer/renderer_blink_platform_impl.h" 32 #include "content/renderer/renderer_blink_platform_impl.h"
33 #include "content/shell/common/shell_switches.h" 33 #include "content/shell/common/shell_switches.h"
34 #include "content/test/mailbox_output_surface.h" 34 #include "content/test/mailbox_output_surface.h"
35 #include "device/bluetooth/bluetooth_adapter.h" 35 #include "device/bluetooth/bluetooth_adapter.h"
36 #include "gpu/ipc/service/image_transport_surface.h" 36 #include "gpu/ipc/service/image_transport_surface.h"
37 #include "third_party/WebKit/public/platform/WebFloatRect.h"
37 #include "third_party/WebKit/public/platform/WebGamepads.h" 38 #include "third_party/WebKit/public/platform/WebGamepads.h"
38 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic eMotionData.h" 39 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic eMotionData.h"
39 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic eOrientationData.h" 40 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic eOrientationData.h"
40 #include "third_party/WebKit/public/web/WebHistoryItem.h" 41 #include "third_party/WebKit/public/web/WebHistoryItem.h"
41 #include "third_party/WebKit/public/web/WebView.h" 42 #include "third_party/WebKit/public/web/WebView.h"
42 43
43 #if defined(OS_MACOSX) 44 #if defined(OS_MACOSX)
44 #include "content/browser/frame_host/popup_menu_helper_mac.h" 45 #include "content/browser/frame_host/popup_menu_helper_mac.h"
45 #elif defined(OS_WIN) 46 #elif defined(OS_WIN)
46 #include "content/child/font_warmup_win.h" 47 #include "content/child/font_warmup_win.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 const WebSize& new_size) { 226 const WebSize& new_size) {
226 RenderViewImpl* render_view_impl = static_cast<RenderViewImpl*>(render_view); 227 RenderViewImpl* render_view_impl = static_cast<RenderViewImpl*>(render_view);
227 render_view_impl->ForceResizeForTesting(new_size); 228 render_view_impl->ForceResizeForTesting(new_size);
228 } 229 }
229 230
230 void SetDeviceScaleFactor(RenderView* render_view, float factor) { 231 void SetDeviceScaleFactor(RenderView* render_view, float factor) {
231 static_cast<RenderViewImpl*>(render_view)-> 232 static_cast<RenderViewImpl*>(render_view)->
232 SetDeviceScaleFactorForTesting(factor); 233 SetDeviceScaleFactorForTesting(factor);
233 } 234 }
234 235
236 float GetWindowToViewportScale(RenderView* render_view) {
237 blink::WebFloatRect rect(0, 0, 1.0f, 0.0);
238 static_cast<RenderViewImpl*>(render_view)->convertWindowToViewport(&rect);
239 return rect.width;
240 }
241
235 void SetDeviceColorProfile(RenderView* render_view, const std::string& name) { 242 void SetDeviceColorProfile(RenderView* render_view, const std::string& name) {
236 if (name == "reset") { 243 if (name == "reset") {
237 render_view->GetWidget()->ResetDeviceColorProfileForTesting(); 244 render_view->GetWidget()->ResetDeviceColorProfileForTesting();
238 return; 245 return;
239 } 246 }
240 247
241 std::vector<char> color_profile; 248 std::vector<char> color_profile;
242 249
243 struct TestColorProfile { // A whacked (aka color spin) profile. 250 struct TestColorProfile { // A whacked (aka color spin) profile.
244 char* data() { 251 char* data() {
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 return result; 460 return result;
454 } 461 }
455 462
456 void SchedulerRunIdleTasks(const base::Closure& callback) { 463 void SchedulerRunIdleTasks(const base::Closure& callback) {
457 scheduler::RendererScheduler* scheduler = 464 scheduler::RendererScheduler* scheduler =
458 content::RenderThreadImpl::current()->GetRendererScheduler(); 465 content::RenderThreadImpl::current()->GetRendererScheduler();
459 scheduler::RunIdleTasksForTesting(scheduler, callback); 466 scheduler::RunIdleTasksForTesting(scheduler, callback);
460 } 467 }
461 468
462 } // namespace content 469 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698