Make ChromeDriver.testTakeElementScreenshot() color space friendly.

Uses the web engine itself to sanity-check the element snapshot PNG,
rather than doing an exact binary comparison of an expected PNG file's
content. This will unblock a soon-upcoming change where the screen
capture pipeline will become color space aware, and so the PNG file from
the snapshot API will start including different color space metadata
(even though its pixel values will be exactly the same).

An extra benefit to testing this way is that more of the browser will
be tested for color space awareness/correctness (i.e., its PNG image
decoder, and HTML Canvas drawing and readback).

Bug: 758057
Change-Id: Ibde9a18fe6b70b5c6532e1f888f8db2c4549eb9b
Reviewed-on: https://chromium-review.googlesource.com/c/1369037
Reviewed-by: John Chen <johnchen@chromium.org>
Commit-Queue: Yuri Wiitala <miu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615078}
2 files changed