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

Unified Diff: content/shell/renderer/layout_test/layout_test_content_renderer_client.cc

Issue 2226733003: Color: Clean up color profile handling for layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master2
Patch Set: Fix windows Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
diff --git a/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc b/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
index ff84acfacde0f8630afd26ceac9d388018fba5b1..aea2192eb0911d1de0a6a17768d1843ded49076a 100644
--- a/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
+++ b/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
@@ -32,6 +32,7 @@
#include "third_party/WebKit/public/web/WebPluginParams.h"
#include "third_party/WebKit/public/web/WebTestingSupport.h"
#include "third_party/WebKit/public/web/WebView.h"
+#include "ui/gfx/icc_profile.h"
#include "v8/include/v8.h"
using blink::WebAudioDevice;
@@ -203,6 +204,22 @@ LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() {
#endif
}
+std::unique_ptr<gfx::ICCProfile>
+LayoutTestContentRendererClient::GetImageDecodeColorProfile() {
ccameron 2016/08/09 07:11:08 An alternative TODO here would be to change all pl
hubbe 2016/08/09 16:59:54 Why is it that the code behaves differently when y
Dirk Pranke 2016/08/09 20:32:31 Yup, I'd say that's the right thing to do, so mayb
+#if defined(OS_WIN)
+ // TODO(ccameron): Find out what color profile is currently preset on Windows
+ // test machines, and return that here.
+ return nullptr;
+#elif defined(OS_MACOSX)
+ // Layout tests on Mac expect a generic RGB color profile.
+ return base::WrapUnique(new gfx::ICCProfile(gfx::ICCProfile::FromCGColorSpace(
+ CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB))));
+#else
+ // All other platforms expect no color profile to have been specified.
+ return base::WrapUnique(new gfx::ICCProfile());
+#endif
+}
+
void LayoutTestContentRendererClient::DidInitializeWorkerContextOnWorkerThread(
v8::Local<v8::Context> context) {
blink::WebTestingSupport::injectInternalsObject(context);

Powered by Google App Engine
This is Rietveld 408576698