Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-webkitLineDash.html |
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-webkitLineDash.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-webkitLineDash.html |
index 269a37e22a9a6c98abb9f699134fd3577aea8036..124d0bc43b8082bcecb793b9c65e67992f39f197 100644 |
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-webkitLineDash.html |
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-webkitLineDash.html |
@@ -1,9 +1,36 @@ |
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
-<html> |
-<head> |
-<script src="../../resources/js-test.js"></script> |
-</head> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
<body> |
-<script src="script-tests/canvas-webkitLineDash.js"></script> |
+ |
+<script> |
+test(function(t) { |
+ |
+ var canvas = document.createElement('canvas'); |
+ document.body.appendChild(canvas); |
+ canvas.width = canvas.height = 700; |
+ var ctx = canvas.getContext('2d'); |
+ |
+ // Verify default values. |
+ assert_equals(ctx.webkitLineDashOffset, undefined); |
Justin Novosad
2017/02/15 20:02:28
webkit-prefixed stuff was removed from the IDL a w
zakerinasab
2017/02/16 17:32:07
Done.
|
+ |
+ // Set dash-style. |
+ ctx.webkitLineDash = [15, 10]; |
+ ctx.webkitLineDashOffset = 5; |
+ ctx.strokeRect (10, 10, 100, 100); |
+ |
+ // Verify dash and offset. |
+ var lineDash; |
+ lineDash = ctx.webkitLineDash; |
+ assert_equals(lineDash[0], 15); |
+ assert_equals(lineDash[1], 10); |
+ assert_equals(ctx.webkitLineDashOffset, 5); |
+ |
+ // Verify that line dash offset persists after |
+ // clearRect (which causes a save/restore of the context |
+ // state to the stack). |
+ ctx.clearRect(0, 0, 700, 700); |
+ assert_equals(ctx.webkitLineDashOffset, 5); |
+ |
+}, "Basic test for webkitLineDash and webkitLineDashOffset."); |
+</script> |
</body> |
-</html> |