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

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

Issue 2290233007: Move convertViewportToWindow and convertWindowToViewport from (Closed)
Patch Set: add client to WebSharedWorkerImpl Created 4 years, 3 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 const WebSize& new_size) { 383 const WebSize& new_size) {
384 RenderViewImpl* render_view_impl = static_cast<RenderViewImpl*>(render_view); 384 RenderViewImpl* render_view_impl = static_cast<RenderViewImpl*>(render_view);
385 render_view_impl->ForceResizeForTesting(new_size); 385 render_view_impl->ForceResizeForTesting(new_size);
386 } 386 }
387 387
388 void SetDeviceScaleFactor(RenderView* render_view, float factor) { 388 void SetDeviceScaleFactor(RenderView* render_view, float factor) {
389 static_cast<RenderViewImpl*>(render_view)-> 389 static_cast<RenderViewImpl*>(render_view)->
390 SetDeviceScaleFactorForTesting(factor); 390 SetDeviceScaleFactorForTesting(factor);
391 } 391 }
392 392
393 float GetWindowToViewportScale(RenderView* render_view) { 393 float GetWindowToViewportScale(RenderFrame* render_frame) {
394 blink::WebFloatRect rect(0, 0, 1.0f, 0.0); 394 blink::WebFloatRect rect(0, 0, 1.0f, 0.0);
395 static_cast<RenderViewImpl*>(render_view)->convertWindowToViewport(&rect); 395 static_cast<RenderFrameImpl*>(render_frame)
396 ->GetRenderWidget()
397 ->convertWindowToViewport(&rect);
396 return rect.width; 398 return rect.width;
397 } 399 }
398 400
399 gfx::ICCProfile GetTestingICCProfile(const std::string& name) { 401 gfx::ICCProfile GetTestingICCProfile(const std::string& name) {
400 const unsigned char rgb_profile_data[] = { 402 const unsigned char rgb_profile_data[] = {
401 0x00, 0x00, 0x07, 0xd8, 0x61, 0x70, 0x70, 0x6c, 0x02, 0x20, 0x00, 0x00, 403 0x00, 0x00, 0x07, 0xd8, 0x61, 0x70, 0x70, 0x6c, 0x02, 0x20, 0x00, 0x00,
402 0x6d, 0x6e, 0x74, 0x72, 0x52, 0x47, 0x42, 0x20, 0x58, 0x59, 0x5a, 0x20, 404 0x6d, 0x6e, 0x74, 0x72, 0x52, 0x47, 0x42, 0x20, 0x58, 0x59, 0x5a, 0x20,
403 0x07, 0xd9, 0x00, 0x02, 0x00, 0x19, 0x00, 0x0b, 0x00, 0x1a, 0x00, 0x0b, 405 0x07, 0xd9, 0x00, 0x02, 0x00, 0x19, 0x00, 0x0b, 0x00, 0x1a, 0x00, 0x0b,
404 0x61, 0x63, 0x73, 0x70, 0x41, 0x50, 0x50, 0x4c, 0x00, 0x00, 0x00, 0x00, 406 0x61, 0x63, 0x73, 0x70, 0x41, 0x50, 0x50, 0x4c, 0x00, 0x00, 0x00, 0x00,
405 0x61, 0x70, 0x70, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 407 0x61, 0x70, 0x70, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 return result; 1035 return result;
1034 } 1036 }
1035 1037
1036 void SchedulerRunIdleTasks(const base::Closure& callback) { 1038 void SchedulerRunIdleTasks(const base::Closure& callback) {
1037 blink::scheduler::RendererScheduler* scheduler = 1039 blink::scheduler::RendererScheduler* scheduler =
1038 content::RenderThreadImpl::current()->GetRendererScheduler(); 1040 content::RenderThreadImpl::current()->GetRendererScheduler();
1039 blink::scheduler::RunIdleTasksForTesting(scheduler, callback); 1041 blink::scheduler::RunIdleTasksForTesting(scheduler, callback);
1040 } 1042 }
1041 1043
1042 } // namespace content 1044 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.cc ('k') | third_party/WebKit/Source/core/html/ImageDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698