Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-getContext.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-getContext.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-getContext.html |
| index 786b1c89c3794f7a128aa61f9b27fb4c2554e7b5..ef7ecf1109ffb19f0f1824cb5c9a7d5efbe6608d 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-getContext.html |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-getContext.html |
| @@ -1,38 +1,39 @@ |
| <!DOCTYPE html> |
| -<script src="../../resources/js-test.js"></script> |
| +<title>Tests basic functionalities of offscreenCanvas.getContext on the main thread.</title> |
|
fs
2016/08/23 08:50:58
OffscreenCanvas
sivag
2016/08/25 07:39:01
Done.
|
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| <script> |
| -description("Tests basic functionalities of offscreenCanvas.getContext on the main thread"); |
| +test(function() { |
| + // Tests constructor of OffscreenCanvas and length/width change |
|
fs
2016/08/23 08:50:57
Add full stops ('.') at end up sentences - here an
sivag
2016/08/25 07:39:01
Done.
|
| + var aCanvas = new OffscreenCanvas(40, 60); |
| + assert_equals(aCanvas.width, 40); |
| + assert_equals(aCanvas.height, 60); |
| -// Tests onstructor of OffscreenCanvas and length/width change |
| -var aCanvas = new OffscreenCanvas(40, 60); |
| -shouldBe("aCanvas.width", "40"); |
| -shouldBe("aCanvas.height", "60"); |
| + aCanvas.width = 110; |
| + aCanvas.height = 90; |
| + assert_equals(aCanvas.width, 110); |
| + assert_equals(aCanvas.height, 90); |
| -aCanvas.width = 110; |
| -aCanvas.height = 90; |
| -shouldBe("aCanvas.width", "110"); |
| -shouldBe("aCanvas.height", "90"); |
| + aCanvas.width = 0; // Zero dimension is allowed |
| + assert_equals(aCanvas.width, 0); |
| -aCanvas.width = 0; // Zero dimension is allowed |
| -shouldBe("aCanvas.width", "0"); |
| + // Tests object type of getContext('2d') |
| + var ctx; |
| + ctx = aCanvas.getContext('2d'); |
|
fs
2016/08/23 08:50:57
Maybe merge this with the previous line.
sivag
2016/08/25 07:39:01
Done.
|
| + assert_true(ctx instanceof OffscreenCanvasRenderingContext2D); |
|
fs
2016/08/23 08:50:57
Double space after instanceof.
sivag
2016/08/25 07:39:01
Done.
|
| + // Calling getContext on a different context type will return null |
| + var ctx2 = aCanvas.getContext("webgl"); |
| + assert_equals(ctx2, null); |
| -// Tests object type of getContext('2d') |
| -var ctx; |
| -shouldNotThrow("ctx = aCanvas.getContext('2d')"); |
| -shouldBeType("ctx", "OffscreenCanvasRenderingContext2D"); |
| + // Calling getContext on the same context type will return the original context type |
| + var ctx3 = aCanvas.getContext("2d"); |
| + assert_not_equals(ctx3, null); |
| + assert_true(ctx3 == ctx); |
|
Srirama
2016/08/23 06:34:24
use assert_equals
sivag
2016/08/25 07:39:01
Done.
|
| -// Calling getContext on a different context type will return null |
| -var ctx2 = aCanvas.getContext("webgl"); |
| -shouldBeNull("ctx2"); |
| - |
| -// Calling getContext on the same context type will return the original context type |
| -var ctx3 = aCanvas.getContext("2d"); |
| -shouldBeNonNull("ctx3"); |
| -shouldBeTrue("ctx3 == ctx"); |
| - |
| -// TODO: change the below part of the test when webgl is supported. |
| -// Calling getContext on an unimplemented context type will return null |
| -var bCanvas = new OffscreenCanvas(20, 20); |
| -var ctx4 = bCanvas.getContext("webgl"); |
| -shouldBeType("ctx4", "WebGLRenderingContext"); |
| + // TODO: change the below part of the test when webgl is supported. |
|
Justin Novosad
2016/08/23 15:53:00
This comment is no longer relevant. WebGL works no
sivag
2016/08/25 07:39:01
Done.
|
| + // Calling getContext on an unimplemented context type will return null |
| + var bCanvas = new OffscreenCanvas(20, 20); |
| + var ctx4 = bCanvas.getContext("webgl"); |
| + assert_true(ctx4 instanceof WebGLRenderingContext); |
| +}); |
| </script> |