Make OffscreenCanvas an EventTarget

Right now OffscreenCanvas is not an EventTarget, which means that it
cannot listen to any event such as webgl context lost and restoration.

This CL makes OffscreenCanvas an EventTarget. In order to override the
pure virtual function getExecutionContext in EventTarget, we keep a
Member<ExecutionContext> in OffscreenCanvas.

We also added some layout tests here. In this CL, we only tests webgl
context lost and restoration. The layout tests here should be
upstreamed to khronos group on github later on once the spec for
OffscreenCanvas is landed. Also, notice that the context lost test in
worker verifies that all WebGL's API works in a worker.

Note that the tests we have here is pretty much copied from the webgl's
conformance tests.

BUG=655270, 610759, 630515
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2490443002
Cr-Commit-Position: refs/heads/master@{#432478}
15 files changed