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

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

Issue 561453004: Add RenderView ResetDeviceColorProfileForTesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « content/shell/renderer/test_runner/test_runner.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/callback.h" 7 #include "base/callback.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "cc/blink/web_layer_impl.h" 9 #include "cc/blink/web_layer_impl.h"
10 #include "content/browser/renderer_host/render_widget_host_impl.h" 10 #include "content/browser/renderer_host/render_widget_host_impl.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 RenderViewImpl* render_view_impl = static_cast<RenderViewImpl*>(render_view); 138 RenderViewImpl* render_view_impl = static_cast<RenderViewImpl*>(render_view);
139 render_view_impl->ForceResizeForTesting(new_size); 139 render_view_impl->ForceResizeForTesting(new_size);
140 } 140 }
141 141
142 void SetDeviceScaleFactor(RenderView* render_view, float factor) { 142 void SetDeviceScaleFactor(RenderView* render_view, float factor) {
143 static_cast<RenderViewImpl*>(render_view)-> 143 static_cast<RenderViewImpl*>(render_view)->
144 SetDeviceScaleFactorForTesting(factor); 144 SetDeviceScaleFactorForTesting(factor);
145 } 145 }
146 146
147 void SetDeviceColorProfile(RenderView* render_view, const std::string& name) { 147 void SetDeviceColorProfile(RenderView* render_view, const std::string& name) {
148 if (name == "reset") {
149 static_cast<RenderViewImpl*>(render_view)->
150 ResetDeviceColorProfileForTesting();
151 return;
152 }
153
148 std::vector<char> color_profile; 154 std::vector<char> color_profile;
149 155
150 struct TestColorProfile { 156 struct TestColorProfile {
151 char* data() { 157 char* data() {
152 static unsigned char color_profile_data[] = { 158 static unsigned char color_profile_data[] = {
153 0x00,0x00,0x01,0xea,0x54,0x45,0x53,0x54,0x00,0x00,0x00,0x00, 159 0x00,0x00,0x01,0xea,0x54,0x45,0x53,0x54,0x00,0x00,0x00,0x00,
154 0x6d,0x6e,0x74,0x72,0x52,0x47,0x42,0x20,0x58,0x59,0x5a,0x20, 160 0x6d,0x6e,0x74,0x72,0x52,0x47,0x42,0x20,0x58,0x59,0x5a,0x20,
155 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 161 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
156 0x61,0x63,0x73,0x70,0x74,0x65,0x73,0x74,0x00,0x00,0x00,0x00, 162 0x61,0x63,0x73,0x70,0x74,0x65,0x73,0x74,0x00,0x00,0x00,0x00,
157 0x74,0x65,0x73,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 163 0x74,0x65,0x73,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 } 360 }
355 result.append("===============================================\n"); 361 result.append("===============================================\n");
356 return result; 362 return result;
357 } 363 }
358 364
359 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { 365 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) {
360 return new cc_blink::WebLayerImpl(layer); 366 return new cc_blink::WebLayerImpl(layer);
361 } 367 }
362 368
363 } // namespace content 369 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/test_runner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698