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 <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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 void SetDeviceColorProfile(RenderView* render_view, const std::string& name) { | 354 void SetDeviceColorProfile(RenderView* render_view, const std::string& name) { |
355 if (name == "reset") { | 355 if (name == "reset") { |
356 static_cast<RenderViewImpl*>(render_view) | 356 static_cast<RenderViewImpl*>(render_view) |
357 ->GetWidget() | 357 ->GetWidget() |
358 ->ResetDeviceColorProfileForTesting(); | 358 ->ResetDeviceColorProfileForTesting(); |
359 return; | 359 return; |
360 } | 360 } |
361 | 361 |
362 std::vector<char> color_profile; | 362 std::vector<char> color_profile; |
363 | 363 |
364 struct TestColorProfile { // A whacked (aka color spin) profile. | 364 struct TestColorProfile { // A color spin profile. |
365 char* data() { | 365 char* data() { |
366 static unsigned char color_profile_data[] = { | 366 static unsigned char color_profile_data[] = { |
367 0x00,0x00,0x01,0xea,0x54,0x45,0x53,0x54,0x00,0x00,0x00,0x00, | 367 0x00,0x00,0x01,0xea,0x54,0x45,0x53,0x54,0x00,0x00,0x00,0x00, |
368 0x6d,0x6e,0x74,0x72,0x52,0x47,0x42,0x20,0x58,0x59,0x5a,0x20, | 368 0x6d,0x6e,0x74,0x72,0x52,0x47,0x42,0x20,0x58,0x59,0x5a,0x20, |
369 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | 369 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
370 0x61,0x63,0x73,0x70,0x74,0x65,0x73,0x74,0x00,0x00,0x00,0x00, | 370 0x61,0x63,0x73,0x70,0x74,0x65,0x73,0x74,0x00,0x00,0x00,0x00, |
371 0x74,0x65,0x73,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | 371 0x74,0x65,0x73,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
372 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0xd6, | 372 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0xd6, |
373 0x00,0x01,0x00,0x00,0x00,0x00,0xd3,0x2d,0x74,0x65,0x73,0x74, | 373 0x00,0x01,0x00,0x00,0x00,0x00,0xd3,0x2d,0x74,0x65,0x73,0x74, |
374 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | 374 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 } | 472 } |
473 | 473 |
474 size_t size() { | 474 size_t size() { |
475 const size_t kAdobeRGBColorProfileSizeInBytes = 560u; | 475 const size_t kAdobeRGBColorProfileSizeInBytes = 560u; |
476 return kAdobeRGBColorProfileSizeInBytes; | 476 return kAdobeRGBColorProfileSizeInBytes; |
477 } | 477 } |
478 }; | 478 }; |
479 | 479 |
480 if (name == "sRGB") { | 480 if (name == "sRGB") { |
481 color_profile.assign(name.data(), name.data() + name.size()); | 481 color_profile.assign(name.data(), name.data() + name.size()); |
482 } else if (name == "test" || name == "whacked") { | 482 } else if (name == "test" || name == "colorSpin") { |
483 TestColorProfile test; | 483 TestColorProfile test; |
484 color_profile.assign(test.data(), test.data() + test.size()); | 484 color_profile.assign(test.data(), test.data() + test.size()); |
485 } else if (name == "adobeRGB") { | 485 } else if (name == "adobeRGB") { |
486 AdobeRGBColorProfile test; | 486 AdobeRGBColorProfile test; |
487 color_profile.assign(test.data(), test.data() + test.size()); | 487 color_profile.assign(test.data(), test.data() + test.size()); |
488 } | 488 } |
489 | 489 |
490 static_cast<RenderViewImpl*>(render_view) | 490 static_cast<RenderViewImpl*>(render_view) |
491 ->GetWidget() | 491 ->GetWidget() |
492 ->SetDeviceColorProfileForTesting(color_profile); | 492 ->SetDeviceColorProfileForTesting(color_profile); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 return result; | 570 return result; |
571 } | 571 } |
572 | 572 |
573 void SchedulerRunIdleTasks(const base::Closure& callback) { | 573 void SchedulerRunIdleTasks(const base::Closure& callback) { |
574 scheduler::RendererScheduler* scheduler = | 574 scheduler::RendererScheduler* scheduler = |
575 content::RenderThreadImpl::current()->GetRendererScheduler(); | 575 content::RenderThreadImpl::current()->GetRendererScheduler(); |
576 scheduler::RunIdleTasksForTesting(scheduler, callback); | 576 scheduler::RunIdleTasksForTesting(scheduler, callback); |
577 } | 577 } |
578 | 578 |
579 } // namespace content | 579 } // namespace content |
OLD | NEW |