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

Unified Diff: third_party/WebKit/LayoutTests/fast/images/color-profile-image-canvas-svg.html

Issue 1331533002: [poc] curve-filter Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix CanvasRenderingContext2D::createPattern crash for #40 Created 4 years, 11 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: third_party/WebKit/LayoutTests/fast/images/color-profile-image-canvas-svg.html
diff --git a/third_party/WebKit/LayoutTests/fast/images/color-profile-image-canvas-svg.html b/third_party/WebKit/LayoutTests/fast/images/color-profile-image-canvas-svg.html
new file mode 100644
index 0000000000000000000000000000000000000000..1d8715a96fa4d3c6295cca4714dfa387189004c8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/images/color-profile-image-canvas-svg.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<script src="../../resources/run-after-layout-and-paint.js"></script>
+
+<style>
+ canvas, img { margin-bottom: -10px; }
+</style>
+
+<body style="overflow: hidden">
+ <!-- The blue sector of the canvas images should be at 12 o'clock. -->
+ <p title="html canvas 2d element">
+ <canvas width="700px" height="200px" />
+ </p>
+ <!-- The blue sector of the source images should be at 12 o'clock. -->
+ <img title="source image to draw on canvas">
+</body>
+
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
+}
+
+window.onload = function() {
+ if (window.internals)
+ internals.settings.setImageColorProfilesEnabled(true);
+
+ var image = document.querySelector('img');
+ image.onload = function() {
+ runAfterLayoutAndPaint(window.testRunner ? changeColorProfile : profileChanged);
+ };
+
+ image.src = 'resources/color-profile-image-data-url.svg';
+};
+
+function changeColorProfile() {
+ window.testRunner.setColorProfile('sRGB', profileChanged);
+}
+
+function profileChanged() {
+ setTimeout(drawImageToCanvas, 0, document.querySelector('img'));
+}
+
+function drawImageToCanvas(image) {
+ var canvas = document.querySelector('canvas');
+ canvas.getContext('2d').clearRect(0, 0, canvas.width, canvas.height);
+
+ canvas.getContext('2d').drawImage(image, 0, 0);
+
+ if (window.testRunner)
+ runAfterLayoutAndPaint(setWhackedColorProfile);
+}
+
+function setWhackedColorProfile() {
+ if (window.testRunner)
+ window.testRunner.setColorProfile('whacked', done);
+}
+
+function done() {
+ setTimeout(function() { window.testRunner.notifyDone() }, 0);
+}
+</script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698