OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |