Fix a small error in exception handling in convertToBlob

The spec for convertToBlob is here:
https://html.spec.whatwg.org/multipage/scripting.html#dom-offscreencanvas-converttoblob

There are three cases where this API should throw exception, and we don't
have the test to cover that.

Also, our code does not handle the third case in the above spec.

This CL adds layout tests to cover the exception cases and fix the third
case.

BUG=659260

Review-Url: https://codereview.chromium.org/2520973002
Cr-Commit-Position: refs/heads/master@{#433673}
3 files changed